/* OnlineImageEditorFree.com — editor workspace (original) */
html, body.editor-body { height: 100%; margin: 0; overflow: hidden; }
body.editor-body { font-family: var(--font-sans); color: var(--text); background: #eef2f7; }

.ed-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ---- Top toolbar ---- */
.ed-topbar {
  display: flex; align-items: center; gap: .4rem; padding: .4rem .7rem;
  background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
  flex: 0 0 auto; z-index: 20; overflow-x: auto;
}
.ed-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--ink-900); margin-right: .3rem; }
.ed-brand .logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--grad-cta); display: grid; place-items: center; color: #fff; }
.ed-brand .logo-mark svg { width: 18px; height: 18px; }
.ed-brand b { color: var(--primary-hover); }
.ed-tb-group { display: flex; gap: .2rem; }
.ed-tb-sep { width: 1px; height: 26px; background: var(--border); margin: 0 .35rem; }
.ed-spacer { flex: 1; }
.ed-tb {
  display: inline-flex; align-items: center; gap: .35rem; background: #fff; border: 1px solid transparent;
  color: var(--ink-700); padding: .45rem .6rem; border-radius: var(--r-sm); cursor: pointer; font-size: .85rem; font-weight: 600;
}
.ed-tb:hover:not(:disabled) { background: var(--sky-50); color: var(--primary-hover); }
.ed-tb:disabled { opacity: .4; cursor: not-allowed; }
.ed-tb svg { width: 18px; height: 18px; }
.ed-tb.ed-icononly { padding: .45rem .55rem; min-width: 34px; justify-content: center; font-size: 1.1rem; }
.ed-zoom { font-size: .82rem; color: var(--text-muted); min-width: 44px; text-align: center; }
.ed-download svg { width: 18px; height: 18px; }
.ed-brand-text { white-space: nowrap; }
@media (max-width: 720px) { .ed-tb span { display: none; } .ed-brand-text { display: none; } }

/* ---- Main area ---- */
.ed-main { flex: 1 1 auto; display: flex; min-height: 0; }

/* Left rail */
.ed-rail {
  flex: 0 0 76px; background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .1rem; padding: .5rem .35rem; overflow-y: auto;
}
.ed-tool {
  display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .5rem .2rem;
  border: 1px solid transparent; border-radius: var(--r-sm); background: #fff; color: var(--ink-500);
  cursor: pointer; font-size: .64rem; font-weight: 600;
}
.ed-tool svg { width: 20px; height: 20px; }
.ed-tool:hover { background: var(--sky-50); color: var(--primary-hover); }
.ed-tool.active { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--sky-200); }

/* Center stage */
.ed-stage { flex: 1 1 auto; position: relative; overflow: auto; display: grid; place-items: center;
  background:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%), linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%), linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 22px 22px; background-position: 0 0, 0 11px, 11px -11px, -11px 0; background-color: #f1f5f9;
}
.ed-canvas-wrap { box-shadow: var(--shadow-lg); background: transparent; line-height: 0; }
.ed-canvas-wrap.hidden { display: none; }
.canvas-container { outline: 1px solid rgba(2,132,199,.25); }

/* Empty state overlay */
.ed-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.ed-empty.hidden { display: none; }
.ed-empty-card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 2.2rem 2.4rem; text-align: center; box-shadow: var(--shadow); pointer-events: auto; max-width: 420px; }
.ed-empty-card .dz-icon { width: 54px; height: 54px; margin: 0 auto .6rem; color: var(--primary); }
.ed-empty-card h2 { font-size: 1.3rem; }

/* Right properties panel */
.ed-props { flex: 0 0 272px; background: #fff; border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.ed-props-head { padding: .8rem 1rem; font-weight: 700; border-bottom: 1px solid var(--border); font-size: .95rem; }
.ed-props-body { padding: 1rem; overflow-y: auto; flex: 1; }
.ed-hint { color: var(--text-muted); font-size: .88rem; }

/* Property controls */
.pf { margin-bottom: 1rem; }
.pf > label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-700); margin-bottom: .35rem; }
.pf-row { display: flex; gap: .5rem; align-items: center; }
.pf input[type="number"], .pf input[type="text"], .pf select, .pf textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: .5rem .6rem; font-size: .88rem; font-family: inherit;
}
.pf input[type="range"] { width: 100%; accent-color: var(--primary); }
.pf input:focus, .pf select:focus, .pf textarea:focus { outline: none; border-color: var(--sky-400); box-shadow: 0 0 0 3px var(--sky-100); }
.pf-val { font-size: .78rem; color: var(--text-muted); min-width: 38px; text-align: right; }
.pf-color { width: 42px; height: 34px; padding: 2px; border: 1.5px solid var(--border); border-radius: var(--r-sm); cursor: pointer; background: #fff; }
.pf-check { display: flex; align-items: center; gap: .45rem; font-size: .84rem; }
.pf-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.pf-grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: .4rem; }
.pf-btn { width: 100%; justify-content: center; margin-top: .3rem; }
.chip-btn { border: 1px solid var(--border); background: #fff; border-radius: var(--r-sm); padding: .5rem; cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--ink-700); display: flex; align-items: center; justify-content: center; gap: .3rem; }
.chip-btn:hover { background: var(--sky-50); color: var(--primary-hover); border-color: var(--sky-200); }
.chip-btn svg { width: 16px; height: 16px; }
.chip-btn.active { background: var(--primary-soft); border-color: var(--sky-300); color: var(--primary-hover); }

/* Layers list */
.layer-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: .4rem; background: #fff; font-size: .82rem; }
.layer-item.sel { border-color: var(--sky-300); background: var(--sky-50); }
.layer-item .li-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-item button { background: none; border: 0; cursor: pointer; color: var(--ink-500); padding: .2rem; border-radius: 5px; display: grid; place-items: center; }
.layer-item button:hover { background: var(--ink-100); color: var(--primary-hover); }
.layer-item button svg { width: 15px; height: 15px; }

/* Status bar */
.ed-status { flex: 0 0 auto; display: flex; align-items: center; gap: .5rem; padding: .3rem .9rem;
  background: var(--ink-900); color: #cbd5e1; font-size: .78rem; }
.ed-st-sep { width: 1px; height: 14px; background: #334155; }
.ed-st-msg { color: #7dd3fc; }

/* Swatches */
.swatches { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.swatch { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(0,0,0,.1); cursor: pointer; }

/* Toast */
.ed-toast { position: fixed; bottom: 46px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink-900); color: #fff; padding: .7rem 1.1rem; border-radius: var(--r-pill); font-size: .85rem;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s var(--ease); z-index: 60; }
.ed-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Mobile: rail becomes bottom bar, props becomes bottom sheet */
@media (max-width: 860px) {
  .ed-main { flex-direction: column; }
  .ed-rail { flex: 0 0 auto; flex-direction: row; overflow-x: auto; border-right: 0; border-top: 1px solid var(--border);
    order: 3; padding: .4rem; gap: .2rem; }
  .ed-tool { flex: 0 0 auto; min-width: 58px; }
  .ed-stage { order: 1; }
  .ed-props { order: 2; flex: 0 0 auto; max-height: 40vh; border-left: 0; border-top: 1px solid var(--border); }
}
