.demo-editor,
.demo-editor * { box-sizing: border-box; }
.demo-editor[hidden],
.demo-editor [hidden] { display: none !important; }
.demo-editor { --ed-bg: #080808; --ed-panel: #111; --ed-raised: #1b1b1b; --ed-line: #2e2e2e; --ed-text: #eee; --ed-muted: #96969c; --ed-accent: #d8f878; position: fixed; inset: 0; z-index: 10000; color: var(--ed-text); background: var(--ed-bg); color-scheme: dark; accent-color: var(--ed-accent); font: 14px/1.45 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
.demo-editor button, .demo-editor input, .demo-editor select { font: inherit; }
.demo-editor button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.demo-editor button:disabled, .demo-editor input:disabled, .demo-editor select:disabled { cursor: not-allowed; opacity: .42; }
.demo-editor button:focus-visible, .demo-editor select:focus-visible, .demo-editor input:focus-visible { outline: 3px solid var(--ed-accent); outline-offset: 4px; }
.demo-editor svg { width: 20px; height: 20px; flex-shrink: 0; }
.demo-editor-dialog { width: 100%; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); outline: 0; }
.demo-editor-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 84px; padding: 17px 28px; background: var(--ed-panel); border-bottom: 1px solid var(--ed-line); }
.demo-editor-heading { display: flex; gap: 13px; align-items: center; }
.demo-editor-mark { display: grid; width: 42px; height: 42px; place-items: center; color: var(--ed-accent); background: var(--ed-raised); border: 1px solid var(--ed-line); border-radius: 13px; }
.demo-editor-mark svg { width: 26px; height: 26px; }
.demo-editor h2, .demo-editor h3, .demo-editor p { margin: 0; }
.demo-editor h2 { font-size: 17px; font-weight: 650; letter-spacing: -.4px; }
.demo-editor-heading p { margin-top: 3px; font-size: 12px; color: var(--ed-muted); }
.demo-editor-header-actions { display: flex; align-items: center; gap: 18px; }
.demo-editor-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 16px; border: 1px solid var(--ed-line); border-radius: 11px; background: var(--ed-raised); color: var(--ed-text); font-size: 13px; font-weight: 550; transition: background .16s, border-color .16s, transform .16s, box-shadow .16s; }
.demo-editor-button:hover:not(:disabled) { background: #242424; border-color: #444; }
.demo-editor-button:active:not(:disabled) { transform: translateY(1px); }
.demo-editor-button-primary { background: var(--ed-accent); border-color: var(--ed-accent); color: #080808; font-weight: 700; }
.demo-editor-button-primary:hover:not(:disabled) { background: var(--ed-accent); border-color: var(--ed-accent); box-shadow: 0 0 0 3px #d8f8781a; }
.demo-editor-close { display: grid; place-items: center; width: 38px; height: 38px; background: var(--ed-raised); border: 1px solid var(--ed-line); border-radius: 50%; color: var(--ed-muted); }
.demo-editor-close:hover { background: #242424; color: var(--ed-text); }
.demo-editor-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.demo-editor-workspace { min-width: 0; min-height: 0; padding: 20px 28px 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 17px; }
.demo-editor-image-meta { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 21px; font-size: 12px; color: var(--ed-muted); }
.demo-editor-filename { max-width: 70%; color: var(--ed-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-editor-resolution { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.demo-editor-stage { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; overflow: hidden; border-radius: 18px; background-color: var(--ed-panel); background-image: radial-gradient(#2e2e2e .7px, transparent .7px); background-size: 12px 12px; border: 1px solid var(--ed-line); }
.demo-editor-canvas { display: block; max-width: calc(100% - 40px); max-height: calc(100% - 40px); object-fit: contain; box-shadow: 0 16px 60px #0009, 0 2px 9px #0008; border-radius: 3px; background-image: linear-gradient(45deg, #2e2e2e 25%, transparent 25%),linear-gradient(-45deg, #2e2e2e 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #2e2e2e 75%),linear-gradient(-45deg, transparent 75%, #2e2e2e 75%); background-color: #1b1b1b; background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.demo-editor-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px; }
.demo-editor-empty-icon { width: 68px; height: 68px; display: grid; place-items: center; margin-bottom: 22px; background: var(--ed-raised); border: 1px solid var(--ed-line); border-radius: 20px; color: var(--ed-accent); }
.demo-editor-empty-icon svg { width: 31px; height: 31px; }
.demo-editor-empty h3 { font-size: 20px; font-weight: 550; letter-spacing: -.6px; }
.demo-editor-empty p { margin: 10px 0 22px; color: var(--ed-muted); font-size: 13px; line-height: 1.7; }
.demo-editor-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; background: #111111ed; color: var(--ed-text); }
.demo-editor-spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ed-line); border-top-color: var(--ed-accent); animation: demo-editor-spin .85s linear infinite; }
@keyframes demo-editor-spin { to { transform: rotate(360deg); } }
.demo-editor-comparison-label { position: absolute; left: 50%; top: 20px; transform: translateX(-50%); background: #080808e8; border: 1px solid var(--ed-line); color: var(--ed-text); font-size: 12px; padding: 8px 13px; border-radius: 8px; pointer-events: none; white-space: nowrap; backdrop-filter: blur(12px); }
.demo-editor-drop-hint { position: absolute; inset: 14px; display: none; align-items: center; justify-content: center; border: 2px dashed var(--ed-accent); border-radius: 13px; color: var(--ed-accent); background: #080808ee; font-size: 18px; font-weight: 550; }
.demo-editor-dragging .demo-editor-drop-hint { display: flex; }
.demo-editor-workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding-bottom: 15px; color: var(--ed-muted); font-size: 11px; }
.demo-editor-compare { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ed-line); border-radius: 10px; padding: 9px 12px; background: var(--ed-panel); color: var(--ed-text); font-size: 12px; user-select: none; touch-action: none; }
.demo-editor-compare svg { width: 17px; height: 17px; }
.demo-editor-compare[aria-pressed="true"] { border-color: var(--ed-accent); background: #d8f8780d; color: var(--ed-accent); }
.demo-editor-sidebar { display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--ed-panel); border-left: 1px solid var(--ed-line); min-height: 0; }
.demo-editor-sidebar-scroll { min-height: 0; overflow: auto; padding: 5px 24px 0; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.demo-editor-tool-section { padding: 21px 0 23px; border-bottom: 1px solid var(--ed-line); }
.demo-editor-tool-section:last-child { border-bottom: 0; }
.demo-editor-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.demo-editor-section-title h3 { font-size: 13px; font-weight: 620; letter-spacing: -.2px; }
.demo-editor-section-kicker { color: var(--ed-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.demo-editor-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.demo-editor-preset { display: block; min-width: 0; padding: 3px; border: 1px solid transparent; border-radius: 11px; color: var(--ed-muted); background: transparent; transition: background .16s, border-color .16s; }
.demo-editor-preset canvas { display: block; width: 100%; aspect-ratio: 96 / 76; height: auto; border-radius: 8px; background: var(--ed-raised); }
.demo-editor-preset span { display: block; padding: 7px 0 4px; font-size: 10px; }
.demo-editor-preset:hover:not(:disabled) { background: var(--ed-raised); }
.demo-editor-preset[aria-pressed="true"] { border-color: var(--ed-accent); color: var(--ed-accent); background: #d8f8780d; }
.demo-editor-slider-label { display: flex; justify-content: space-between; align-items: center; gap: 15px; font-size: 12px; color: var(--ed-text); margin-top: 19px; }
.demo-editor-slider-label:first-of-type { margin-top: 0; }
.demo-editor-slider-label output { min-width: 32px; padding: 2px 4px; text-align: right; font-size: 11px; color: var(--ed-muted); font-variant-numeric: tabular-nums; }
.demo-editor-slider { display: block; width: 100%; height: 4px; margin: 14px 0 5px; border-radius: 5px; appearance: none; -webkit-appearance: none; background: linear-gradient(to right, var(--ed-accent) var(--slider-fill,50%), var(--ed-line) var(--slider-fill,50%)); cursor: pointer; }
.demo-editor-slider::-webkit-slider-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--ed-accent); border: 2px solid var(--ed-accent); appearance: none; -webkit-appearance: none; box-shadow: 0 2px 6px #0006; }
.demo-editor-slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ed-accent); border: 2px solid var(--ed-accent); box-shadow: 0 2px 6px #0006; }
.demo-editor-rotate { width: 100%; font-size: 12px; min-height: 39px; color: var(--ed-text); background: var(--ed-raised); }
.demo-editor-rotate svg { width: 17px; height: 17px; }
.demo-editor-crop-label { display: block; margin: 18px 0 9px; font-size: 11px; color: var(--ed-muted); }
.demo-editor-select { width: 100%; min-height: 41px; padding: 9px 10px; color: var(--ed-text); font-size: 12px; border: 1px solid var(--ed-line); border-radius: 10px; background: var(--ed-raised); cursor: pointer; }
.demo-editor-select option { background: var(--ed-raised); color: var(--ed-text); }
.demo-editor-reset { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 21px; padding: 5px; border: 0; background: transparent; color: var(--ed-muted); font-size: 11px; }
.demo-editor-reset svg { width: 14px; height: 14px; }
.demo-editor-reset:hover:not(:disabled) { color: var(--ed-accent); }
.demo-editor-export-panel { padding: 16px 24px 18px; border-top: 1px solid var(--ed-line); background: var(--ed-panel); }
.demo-editor-download { width: 100%; min-height: 47px; border-radius: 11px; font-size: 13px; }
.demo-editor-export-note { text-align: center; font-size: 10px; color: var(--ed-muted); margin-top: 10px !important; }
.demo-editor-error { margin-bottom: 12px !important; padding: 10px 11px; background: #e8807612; color: #ffb8af; border: 1px solid #e8807640; border-radius: 9px; font-size: 12px; line-height: 1.55; }
.demo-editor-status { color: var(--ed-muted); font-size: 11px; line-height: 1.55; }
.demo-editor-status:not(:empty) { margin-bottom: 11px !important; }
@media (min-width: 1600px) {
  .demo-editor-body { grid-template-columns: minmax(0, 1fr) 380px; }
  .demo-editor-workspace { padding: 25px 40px 0; }
  .demo-editor-sidebar-scroll { padding-right: 30px; padding-left: 30px; }
  .demo-editor-export-panel { padding-right: 30px; padding-left: 30px; }
}
@media (max-width: 850px) {
  .demo-editor-body { grid-template-columns: minmax(0, 1fr) 290px; }
  .demo-editor-header { padding: 15px 19px; min-height: 77px; }
  .demo-editor-workspace { padding: 16px 18px 0; gap: 13px; }
  .demo-editor-sidebar-scroll { padding-right: 18px; padding-left: 18px; }
  .demo-editor-export-panel { padding-right: 18px; padding-left: 18px; }
  .demo-editor-workspace-footer { flex-direction: column-reverse; justify-content: center; gap: 9px; padding-bottom: 15px; }
}
@media (max-width: 650px) {
  .demo-editor-dialog { grid-template-rows: auto minmax(0, 1fr); }
  .demo-editor-header { padding: 11px 14px; min-height: 68px; gap: 10px; }
  .demo-editor-heading { gap: 9px; }
  .demo-editor-mark { width: 35px; height: 35px; border-radius: 11px; }
  .demo-editor-mark svg { width: 22px; height: 22px; }
  .demo-editor h2 { font-size: 14px; }
  .demo-editor-heading p { font-size: 10px; }
  .demo-editor-header-actions { gap: 9px; }
  .demo-editor-header .demo-editor-upload { width: 35px; height: 35px; min-height: 35px; padding: 7px; border-radius: 10px; }
  .demo-editor-header .demo-editor-upload span { display: none; }
  .demo-editor-close { width: 34px; height: 34px; }
  .demo-editor-body { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow: auto; overscroll-behavior: contain; }
  .demo-editor-workspace { min-height: 360px; height: min(55dvh, 520px); padding: 13px 14px 0; gap: 10px; }
  .demo-editor-image-meta { font-size: 10px; }
  .demo-editor-stage { border-radius: 14px; }
  .demo-editor-canvas { max-width: calc(100% - 26px); max-height: calc(100% - 26px); }
  .demo-editor-workspace-footer { flex-direction: row; gap: 9px; padding-bottom: 13px; min-height: 44px; }
  .demo-editor-workspace-footer > span { max-width: 120px; font-size: 9px; line-height: 1.4; }
  .demo-editor-compare { padding: 8px 9px; font-size: 10px; gap: 5px; }
  .demo-editor-sidebar { display: block; border-left: 0; border-top: 1px solid var(--ed-line); }
  .demo-editor-sidebar-scroll { overflow: visible; padding: 0 20px; }
  .demo-editor-tool-section { padding: 20px 0; }
  .demo-editor-presets { gap: 12px; }
  .demo-editor-preset canvas { max-height: 100px; object-fit: cover; }
  .demo-editor-preset span { font-size: 11px; }
  .demo-editor-section-title h3 { font-size: 14px; }
  .demo-editor-export-panel { padding: 17px 20px max(20px, env(safe-area-inset-bottom)); }
  .demo-editor-empty { padding: 15px; }
  .demo-editor-empty-icon { width: 50px; height: 50px; margin-bottom: 12px; border-radius: 15px; }
  .demo-editor-empty h3 { font-size: 17px; }
  .demo-editor-empty p { font-size: 11px; margin: 8px 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-editor *, .demo-editor *::before, .demo-editor *::after { transition: none !important; }
  .demo-editor-spinner { animation: none; }
}
