@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

.stretch-app {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  color: #2E073F;
  font-family: Inter, "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 12% 12%, rgba(180, 115, 255, .16), transparent 26%), radial-gradient(circle at 90% 22%, rgba(118, 61, 205, .10), transparent 25%), #FAF6FE;
}
.stretch-app *, .stretch-app *::before, .stretch-app *::after { box-sizing: border-box; }
.stretch-app button, .stretch-app input { font: inherit; }
.stretch-app button { cursor: pointer; }
.stretch-app button:focus-visible, .stretch-app input:focus-visible, .stretch-app .iwr-dropzone:focus-visible { outline: 3px solid rgba(117, 57, 194, .36); outline-offset: 3px; }
.stretch-app .iwr-shell { width: min(100%, 1320px); margin: 0 auto; padding: 50px 22px; }
.stretch-app .iwr-hero { max-width: 760px; margin: 0 auto 28px; text-align: center; }
.stretch-app .iwr-hero h1 { margin: 0; color: #3B0270; font-size: 48px; line-height: 1.1; font-weight: 800; letter-spacing: -.045em; }
.stretch-app .iwr-hero p { margin: 15px auto 0; color: #6C5B7B; font-size: 17px; line-height: 1.6; }
.stretch-app .iwr-card { max-width: 1200px; margin: auto; overflow: hidden; background: #FFF; border: 1px solid #EDE2F5; border-radius: 24px; box-shadow: 0 20px 55px rgba(77, 24, 133, .12); }
.stretch-app .iwr-card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid #EDE2F5; }
.stretch-app .iwr-card-title { display: flex; min-width: 0; gap: 13px; align-items: center; }
.stretch-app .iwr-title-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; color: #6B24B7; background: #F3E9FC; border-radius: 13px; }
.stretch-app .iwr-title-icon svg { width: 23px; height: 23px; }
.stretch-app .iwr-card-title h2, .stretch-app .iwr-control-card h3 { margin: 0; color: #3B0270; font-weight: 800; }
.stretch-app .iwr-card-title h2 { font-size: 16px; }
.stretch-app .iwr-card-title p { margin: 4px 0 0; color: #6C5B7B; font-size: 13px; line-height: 1.4; }
.stretch-app .iwr-header-actions, .stretch-app .iwr-tool-group, .stretch-app .iwr-selection-actions { display: flex; align-items: center; gap: 8px; }
.stretch-app .iwr-btn, .stretch-app .iwr-tool-btn, .stretch-app .iwr-icon-btn, .stretch-app .iwr-mode { min-height: 40px; border-radius: 10px; border: 1px solid #DFC9F1; font-weight: 700; transition: .18s ease; }
.stretch-app .iwr-btn { padding: 9px 14px; }
.stretch-app .iwr-btn-primary { color: #FFF; border-color: transparent; background: linear-gradient(135deg, #4B0A93, #8439D5); box-shadow: 0 8px 18px rgba(91, 24, 171, .22); }
.stretch-app .iwr-btn-primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.stretch-app .iwr-btn-secondary, .stretch-app .iwr-tool-btn, .stretch-app .iwr-icon-btn { color: #4B0A93; background: #FFF; }
.stretch-app .iwr-btn-secondary:hover:not(:disabled), .stretch-app .iwr-tool-btn:hover:not(:disabled), .stretch-app .iwr-icon-btn:hover:not(:disabled) { background: #F8F0FD; border-color: #B984E5; }
.stretch-app button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; transform: none; }
.stretch-app .iwr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; padding: 22px; }
.stretch-app .iwr-editor-panel { min-width: 0; }
.stretch-app .iwr-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; }
.stretch-app .iwr-tool-btn { padding: 7px 10px; font-size: 13px; }
.stretch-app .iwr-icon-btn { display: grid; width: 36px; padding: 0; place-items: center; font-size: 21px; }
.stretch-app .iwr-workspace { position: relative; min-height: 485px; overflow: auto; display: grid; place-items: center; border: 1px solid #EDE2F5; border-radius: 16px; background-color: #F7EFFC; background-image: linear-gradient(45deg, rgba(130, 72, 190, .08) 25%, transparent 25%), linear-gradient(-45deg, rgba(130, 72, 190, .08) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(130, 72, 190, .08) 75%), linear-gradient(-45deg, transparent 75%, rgba(130, 72, 190, .08) 75%); background-size: 22px 22px; background-position: 0 0, 0 11px, 11px -11px, -11px 0; }
.stretch-app .iwr-dropzone { display: flex; min-height: 390px; width: 100%; padding: 35px 20px; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #2E073F; border: 2px dashed #CDA8EA; border-radius: 15px; background: rgba(255,255,255,.75); }
.stretch-app .iwr-dropzone.is-dragging { border-color: #6B24B7; background: #F6ECFE; }
.stretch-app .iwr-upload-icon { display: grid; width: 64px; height: 64px; margin-bottom: 13px; place-items: center; color: #6B24B7; border-radius: 20px; background: #F1E5FB; }
.stretch-app .iwr-upload-icon svg { width: 33px; height: 33px; }
.stretch-app .iwr-dropzone h3 { margin: 0; font-size: 20px; color: #3B0270; }
.stretch-app .iwr-dropzone p, .stretch-app .iwr-dropzone small { color: #6C5B7B; }
.stretch-app .iwr-dropzone p { margin: 7px 0 17px; }
.stretch-app .iwr-dropzone small { margin-top: 14px; font-size: 13px; }
.stretch-app .iwr-canvas-wrap { width: 100%; min-height: 485px; padding: 24px; display: grid; place-items: center; }
.stretch-app .iwr-canvas-stage { position: relative; flex: 0 0 auto; touch-action: none; line-height: 0; box-shadow: 0 8px 22px rgba(42, 9, 67, .16); }
.stretch-app #iwr-canvas, .stretch-app #iwr-before-canvas { display: block; max-width: none; image-rendering: auto; }
.stretch-app #iwr-before-canvas { position: absolute; inset: 0; z-index: 2; }
.stretch-app .iwr-selection-box { position: absolute; z-index: 4; pointer-events: none; border: 2px dashed #FFF; outline: 2px solid #6413AA; background: rgba(128, 46, 205, .16); }
.stretch-app .iwr-brush-cursor { position: absolute; z-index: 6; pointer-events: none; border: 2px solid #FFF; outline: 1px solid rgba(58, 2, 112, .85); border-radius: 50%; transform: translate(-50%, -50%); }
.stretch-app .iwr-compare { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.stretch-app .iwr-compare-divider { position: absolute; top: 0; bottom: 0; width: 4px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: #FFF; box-shadow: 0 0 0 1px rgba(59,2,112,.45); transform: translateX(-50%); pointer-events: auto; cursor: ew-resize; }
.stretch-app .iwr-compare-divider::after { content: "↔"; position: absolute; top: 50%; left: 50%; display: grid; width: 31px; height: 31px; place-items: center; color: #3B0270; font-weight: 800; line-height: 1; background: #FFF; border: 1px solid #D8B8EF; border-radius: 50%; transform: translate(-50%, -50%); }
.stretch-app .iwr-compare-label { position: absolute; top: 12px; z-index: 1; padding: 6px 9px; color: #FFF; font-size: 12px; font-weight: 800; line-height: 1; background: rgba(43, 8, 78, .78); border-radius: 7px; }
.stretch-app .iwr-before-label { left: 12px; } .stretch-app .iwr-after-label { right: 12px; }
.stretch-app .iwr-image-meta { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 11px; color: #6C5B7B; font-size: 12px; }
.stretch-app .iwr-status, .stretch-app .iwr-message { margin: 9px 0 0; font-size: 13px; line-height: 1.45; }
.stretch-app .iwr-status { color: #6C5B7B; } .stretch-app .iwr-message { padding: 9px 11px; color: #8B1124; background: #FFF0F2; border: 1px solid #F1B7C0; border-radius: 8px; }
.stretch-app .iwr-controls { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.stretch-app .iwr-control-card { padding: 17px; background: #FFF; border: 1px solid #EDE2F5; border-radius: 15px; box-shadow: 0 6px 16px rgba(77, 24, 133, .045); }
.stretch-app .iwr-control-card h3 { margin-bottom: 14px; font-size: 17px; }
.stretch-app .iwr-mode-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stretch-app .iwr-mode { min-height: 37px; padding: 6px 5px; color: #5F3875; font-size: 12px; background: #FAF6FE; }
.stretch-app .iwr-mode.is-active { color: #FFF; border-color: #5A129D; background: #5A129D; }
.stretch-app .iwr-mode-help, .stretch-app .iwr-control-note, .stretch-app .iwr-export-info { margin: 11px 0 0; color: #6C5B7B; font-size: 12px; line-height: 1.5; }
.stretch-app .iwr-source-btn { width: 100%; margin-top: 13px; }
.stretch-app .iwr-range-label { display: flex; justify-content: space-between; gap: 8px; margin: 16px 0 7px; color: #2E073F; font-size: 13px; font-weight: 750; }
.stretch-app output { color: #6B24B7; }
.stretch-app input[type="range"] { width: 100%; height: 6px; accent-color: #6B24B7; cursor: pointer; }
.stretch-app .iwr-switch-row { margin-top: 16px; }
.stretch-app .iwr-switch { display: flex; align-items: center; gap: 9px; color: #2E073F; font-size: 13px; font-weight: 700; cursor: pointer; }
.stretch-app .iwr-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.stretch-app .iwr-switch span { position: relative; display: inline-block; flex: 0 0 38px; width: 38px; height: 22px; background: #D9C8E4; border-radius: 99px; transition: .18s; }
.stretch-app .iwr-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #FFF; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.24); transition: .18s; }
.stretch-app .iwr-switch input:checked + span { background: #6B24B7; } .stretch-app .iwr-switch input:checked + span::after { transform: translateX(16px); }
.stretch-app .iwr-switch input:focus-visible + span { outline: 3px solid rgba(117,57,194,.36); outline-offset: 2px; }
.stretch-app .iwr-selection-actions { margin-top: 15px; } .stretch-app .iwr-selection-actions .iwr-btn { flex: 1; font-size: 12px; }
.stretch-app .iwr-format-group { display: flex; gap: 11px; margin: 0; padding: 0; border: 0; }
.stretch-app .iwr-format-group legend { margin-bottom: 8px; color: #2E073F; font-size: 13px; font-weight: 750; }
.stretch-app .iwr-format-group label { display: flex; align-items: center; gap: 5px; color: #2E073F; font-size: 13px; cursor: pointer; }
.stretch-app .iwr-format-group input { accent-color: #6B24B7; }
.stretch-app .iwr-field-label { display: block; margin: 15px 0 7px; color: #2E073F; font-size: 13px; font-weight: 750; }
.stretch-app .iwr-text-input { width: 100%; min-height: 42px; padding: 9px 10px; color: #2E073F; background: #FAF6FE; border: 1px solid #DCC9EA; border-radius: 9px; }
.stretch-app .iwr-download-wide { width: 100%; margin-top: 15px; }
@media (max-width: 900px) {
  .stretch-app .iwr-layout { grid-template-columns: minmax(0, 1fr); }
  .stretch-app .iwr-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .stretch-app .iwr-controls .iwr-control-card:last-child { grid-column: span 2; }
}
@media (max-width: 620px) {
  .stretch-app .iwr-shell { padding: 32px 12px; }
  .stretch-app .iwr-hero h1 { font-size: 31px; }
  .stretch-app .iwr-hero p { font-size: 16px; }
  .stretch-app .iwr-card { border-radius: 18px; }
  .stretch-app .iwr-card-header { align-items: flex-start; padding: 16px; flex-direction: column; }
  .stretch-app .iwr-header-actions { width: 100%; } .stretch-app .iwr-header-actions .iwr-btn { flex: 1; }
  .stretch-app .iwr-layout { gap: 16px; padding: 12px; }
  .stretch-app .iwr-workspace, .stretch-app .iwr-canvas-wrap { min-height: 360px; }
  .stretch-app .iwr-canvas-wrap { padding: 16px; }
  .stretch-app .iwr-toolbar { align-items: stretch; flex-direction: column; }
  .stretch-app .iwr-tool-group { justify-content: space-between; }
  .stretch-app .iwr-tool-btn { flex: 1; }
  .stretch-app .iwr-controls { display: flex; }
  .stretch-app .iwr-controls .iwr-control-card:last-child { grid-column: auto; }
  .stretch-app .iwr-control-card h3 { font-size: 19px; }
  .stretch-app .iwr-dropzone { min-height: 330px; }
}