@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;
  width: 100%;
  overflow: hidden;
  font-family: Inter, "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #2E073F;
  background: #FAF6FE;
}
.stretch-app * { box-sizing: border-box; }
.stretch-app .pixelator-shell {
  min-height: 100%;
  padding: 64px 20px;
  background: radial-gradient(circle at 50% 0%, rgba(168,85,247,.16), transparent 34%), #FAF6FE;
}
.stretch-app .pixelator-hero { max-width: 760px; margin: 0 auto 34px; text-align: center; }
.stretch-app .pixelator-hero h1 {
  margin: 0;
  color: #3B0270;
  font-size: 48px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.04em;
}
.stretch-app .pixelator-hero p { margin: 14px auto 0; max-width: 680px; color: #6C5B7B; font-size: 17px; line-height: 1.6; }
.stretch-app .pixelator-card {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px;
  background: #FFFFFF;
  border: 1px solid #EDE2F5;
  border-radius: 24px;
  box-shadow: 0 20px 55px rgba(79, 16, 124, .11);
}
.stretch-app .pixelator-card-header, .stretch-app .pixelator-heading-group, .stretch-app .pixelator-actions,
.stretch-app .pixelator-preview-tools, .stretch-app .pixelator-zoom-controls, .stretch-app .pixelator-dimension-summary,
.stretch-app .pixelator-switch-row { display: flex; align-items: center; }
.stretch-app .pixelator-card-header { justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid #EDE2F5; }
.stretch-app .pixelator-heading-group { gap: 13px; }
.stretch-app .pixelator-grid-icon, .stretch-app .pixelator-upload-icon {
  display: grid; place-items: center; flex: 0 0 auto; color: #6F00FF; background: #F3EAFE; border-radius: 12px; font-size: 26px;
}
.stretch-app .pixelator-grid-icon { width: 46px; height: 46px; }
.stretch-app .pixelator-heading-group h2, .stretch-app .pixelator-settings-card h3 { margin: 0; color: #3B0270; font-weight: 800; }
.stretch-app .pixelator-heading-group h2 { font-size: 20px; }
.stretch-app .pixelator-heading-group p { margin: 4px 0 0; color: #6C5B7B; font-size: 14px; }
.stretch-app .pixelator-actions { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stretch-app .pixelator-button, .stretch-app .pixelator-icon-button, .stretch-app .pixelator-text-button {
  border: 0; cursor: pointer; font: inherit; font-weight: 700; transition: .2s ease;
}
.stretch-app .pixelator-button { min-height: 42px; padding: 10px 16px; border-radius: 10px; }
.stretch-app .pixelator-button-primary { color: #FFFFFF; background: linear-gradient(135deg, #6F00FF, #A855F7); box-shadow: 0 8px 18px rgba(111,0,255,.2); }
.stretch-app .pixelator-button-secondary { color: #5D1594; background: #FFFFFF; border: 1px solid #8E41D2; }
.stretch-app button:hover:not(:disabled) { transform: translateY(-1px); }
.stretch-app button:disabled { cursor: not-allowed; opacity: .48; }
.stretch-app .pixelator-status, .stretch-app .pixelator-error { min-height: 0; margin: 0; font-size: 14px; }
.stretch-app .pixelator-status:not(:empty) { margin-top: 14px; color: #5D1594; }
.stretch-app .pixelator-error:not(:empty) { margin-top: 14px; padding: 10px 12px; color: #861A38; background: #FFF1F4; border: 1px solid #F3B9C8; border-radius: 9px; }
.stretch-app .pixelator-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 26px; padding-top: 26px; }
.stretch-app .pixelator-upload-zone { min-width: 0; outline: none; }
.stretch-app .pixelator-upload-zone:focus-visible { border-radius: 16px; box-shadow: 0 0 0 4px rgba(111,0,255,.2); }
.stretch-app .pixelator-upload-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 475px; padding: 35px 20px; text-align: center;
  background: #FAF6FE; border: 2px dashed #D9C5E9; border-radius: 16px; color: #6C5B7B;
}
.stretch-app .pixelator-upload-zone.pixelator-dragging .pixelator-upload-empty { border-color: #6F00FF; background: #F3EAFE; }
.stretch-app .pixelator-upload-icon { width: 64px; height: 64px; margin-bottom: 5px; font-size: 35px; }
.stretch-app .pixelator-upload-empty strong { color: #3B0270; font-size: 18px; }
.stretch-app .pixelator-upload-empty small { max-width: 380px; font-size: 13px; line-height: 1.5; }
.stretch-app .pixelator-preview-wrap { min-width: 0; }
.stretch-app .pixelator-preview-meta { display: flex; justify-content: space-between; gap: 10px; padding: 0 2px 12px; font-size: 13px; }
.stretch-app .pixelator-preview-meta strong { overflow: hidden; color: #3B0270; text-overflow: ellipsis; white-space: nowrap; }
.stretch-app .pixelator-preview-meta span { color: #6C5B7B; white-space: nowrap; }
.stretch-app .pixelator-canvas-panel {
  position: relative; display: grid; place-items: center; min-height: 430px; overflow: hidden; padding: 24px; background-color: #FAF6FE;
  background-image: linear-gradient(45deg, rgba(111,0,255,.035) 25%, transparent 25%), linear-gradient(-45deg, rgba(111,0,255,.035) 25%, transparent 25%);
  background-size: 20px 20px; border: 1px solid #EDE2F5; border-radius: 16px;
}
.stretch-app #pixelator-preview-canvas, .stretch-app #pixelator-after-canvas, .stretch-app #pixelator-before-image {
  display: block; max-width: 100%; max-height: 520px; width: auto; height: auto; image-rendering: pixelated;
}
.stretch-app #pixelator-preview-canvas { transform-origin: center; transition: transform .18s ease; }
.stretch-app .pixelator-processing {
  position: absolute; z-index: 4; top: 16px; left: 50%; padding: 7px 11px; color: #FFFFFF; background: #3B0270; border-radius: 999px;
  font-size: 12px; font-weight: 700; transform: translateX(-50%);
}
.stretch-app .pixelator-preview-tools { justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-top: 14px; }
.stretch-app .pixelator-zoom-controls { gap: 8px; }
.stretch-app .pixelator-icon-button { width: 34px; height: 34px; color: #5D1594; background: #FFFFFF; border: 1px solid #D9C5E9; border-radius: 8px; font-size: 20px; }
.stretch-app #pixelator-zoom-label { min-width: 46px; color: #6C5B7B; text-align: center; font-size: 13px; font-weight: 700; }
.stretch-app .pixelator-text-button { color: #5D1594; background: transparent; padding: 8px; font-size: 13px; }
.stretch-app .pixelator-switch-row { gap: 10px; color: #2E073F; cursor: pointer; font-size: 14px; }
.stretch-app .pixelator-switch-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.stretch-app .pixelator-switch {
  position: relative; display: inline-block; flex: 0 0 40px; width: 40px; height: 22px; background: #CDBDD9; border-radius: 99px; transition: .2s ease;
}
.stretch-app .pixelator-switch::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #FFFFFF; border-radius: 50%; content: ""; transition: .2s ease; }
.stretch-app .pixelator-switch-row input:checked + .pixelator-switch { background: #6F00FF; }
.stretch-app .pixelator-switch-row input:checked + .pixelator-switch::after { transform: translateX(18px); }
.stretch-app .pixelator-switch-row small { display: block; margin-top: 2px; color: #6C5B7B; font-size: 12px; font-weight: 400; }
.stretch-app .pixelator-dimension-summary { justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 13px 2px 0; color: #6C5B7B; font-size: 13px; }
.stretch-app .pixelator-dimension-summary strong { color: #3B0270; }
.stretch-app .pixelator-controls-column { min-width: 0; }
.stretch-app .pixelator-controls-column fieldset { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
.stretch-app .pixelator-settings-card { padding: 19px; background: #FFFFFF; border: 1px solid #EDE2F5; border-radius: 15px; }
.stretch-app .pixelator-settings-card h3 { margin-bottom: 17px; font-size: 17px; }
.stretch-app .pixelator-control { margin-top: 15px; }
.stretch-app .pixelator-control:first-of-type { margin-top: 0; }
.stretch-app .pixelator-control > label, .stretch-app .pixelator-label, .stretch-app .pixelator-dimension-grid label { display: flex; justify-content: space-between; gap: 10px; color: #2E073F; font-size: 13px; font-weight: 700; }
.stretch-app output { color: #6F00FF; }
.stretch-app input[type="range"] { width: 100%; accent-color: #6F00FF; cursor: pointer; }
.stretch-app .pixelator-range-input { display: grid; grid-template-columns: minmax(0, 1fr) 72px; align-items: center; gap: 12px; margin-top: 9px; }
.stretch-app input[type="number"], .stretch-app select {
  width: 100%; min-height: 38px; padding: 7px 9px; color: #2E073F; background: #FAF6FE; border: 1px solid #D9C5E9; border-radius: 8px; font: inherit;
}
.stretch-app .pixelator-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.stretch-app .pixelator-segmented label { cursor: pointer; }
.stretch-app .pixelator-segmented input { position: absolute; opacity: 0; }
.stretch-app .pixelator-segmented span { display: block; padding: 9px; color: #6C5B7B; background: #FAF6FE; border: 1px solid #EDE2F5; border-radius: 8px; text-align: center; font-size: 13px; font-weight: 700; }
.stretch-app .pixelator-segmented input:checked + span { color: #FFFFFF; background: #6F00FF; border-color: #6F00FF; }
.stretch-app .pixelator-rectangle-controls { margin-top: 14px; padding-top: 1px; }
.stretch-app .pixelator-settings-card > .pixelator-switch-row { margin-top: 18px; }
.stretch-app .pixelator-dimension-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stretch-app .pixelator-dimension-grid label { display: block; }
.stretch-app .pixelator-number-wrap { position: relative; display: block; margin-top: 8px; }
.stretch-app .pixelator-number-wrap input { padding-right: 29px; }
.stretch-app .pixelator-number-wrap i { position: absolute; top: 50%; right: 9px; color: #6C5B7B; font-size: 12px; font-style: normal; transform: translateY(-50%); }
.stretch-app .pixelator-inline-note { margin: 13px 0; color: #6C5B7B; font-size: 12px; line-height: 1.45; }
.stretch-app .pixelator-reset-size { width: 100%; }
.stretch-app .pixelator-export-summary { margin-top: 15px; padding: 11px; color: #5D1594; background: #F7F0FC; border: 1px solid #EDE2F5; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.stretch-app .pixelator-compare { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: #FAF6FE; }
.stretch-app .pixelator-compare > img { max-width: calc(100% - 48px); max-height: calc(100% - 48px); }
.stretch-app .pixelator-after-layer { position: absolute; inset: 0 0 0 50%; display: grid; place-items: center; overflow: hidden; }
.stretch-app .pixelator-after-layer canvas { max-width: calc(200% - 48px); max-height: calc(100% - 48px); }
.stretch-app .pixelator-divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #FFFFFF; box-shadow: 0 0 0 1px rgba(59,2,112,.25); pointer-events: none; }
.stretch-app .pixelator-divider::after { position: absolute; top: 50%; left: 50%; width: 32px; height: 32px; color: #FFFFFF; background: #6F00FF; border: 2px solid #FFFFFF; border-radius: 50%; content: "↔"; font-size: 16px; line-height: 28px; text-align: center; transform: translate(-50%, -50%); }
.stretch-app .pixelator-compare-label { position: absolute; z-index: 2; top: 13px; padding: 5px 9px; color: #FFFFFF; background: rgba(59,2,112,.84); border-radius: 6px; font-size: 12px; font-weight: 800; pointer-events: none; }
.stretch-app .pixelator-label-before { left: 13px; }
.stretch-app .pixelator-label-after { right: 13px; }
.stretch-app .pixelator-compare-range { position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.stretch-app :focus-visible { outline: 3px solid rgba(111,0,255,.4); outline-offset: 2px; }
.stretch-app input:disabled, .stretch-app select:disabled { cursor: not-allowed; opacity: .58; }
@media (max-width: 820px) {
  .stretch-app .pixelator-shell { padding: 42px 14px; }
  .stretch-app .pixelator-layout { grid-template-columns: minmax(0, 1fr); }
  .stretch-app .pixelator-canvas-panel { min-height: 360px; }
}
@media (max-width: 560px) {
  .stretch-app .pixelator-shell { padding: 30px 10px; }
  .stretch-app .pixelator-hero h1 { font-size: 31px; }
  .stretch-app .pixelator-hero p { font-size: 16px; }
  .stretch-app .pixelator-card { padding: 17px; border-radius: 18px; }
  .stretch-app .pixelator-card-header { align-items: flex-start; flex-direction: column; }
  .stretch-app .pixelator-actions { width: 100%; }
  .stretch-app .pixelator-actions .pixelator-button { flex: 1; }
  .stretch-app .pixelator-heading-group p { font-size: 13px; }
  .stretch-app .pixelator-canvas-panel { min-height: 300px; padding: 14px; }
  .stretch-app .pixelator-upload-empty { min-height: 360px; }
  .stretch-app .pixelator-preview-tools { align-items: flex-start; flex-direction: column; }
}