
/* ===== Editor page scoped styles (no dependency on styles.css) ===== */
:root{
  --bg:#f6efe7; --panel:#fff7ef; --ink:#3a2f2a; --muted:#8a7a72;
  --border:#e7d3c5; --accent:#cf7f6b; --ring:#ffd9c8;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body.editor-shell{background:var(--bg);color:var(--ink);font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial;}

.eb-topbar{height:56px;display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.5rem 12px;border-bottom:1px solid var(--border);background:var(--panel);position:sticky;top:0;z-index:20}
.eb-brand{display:flex;align-items:center;gap:.5rem}
.eb-brand__logo{width:28px;height:28px;border-radius:4px}
.eb-btn{appearance:none;border:1px solid var(--border);background:#fff;border-radius:10px;padding:.5rem .8rem;cursor:pointer}
.eb-btn--primary{background:var(--accent);border-color:var(--accent);color:#fff}
.eb-btn--secondary{background:#fff}
.eb-btn--accent{background:var(--ring)}
.eb-iconbtn{appearance:none;border:1px solid var(--border);width:30px;height:30px;border-radius:8px;background:#fff;cursor:pointer}

.eb-layout{display:grid;grid-template-columns:120px 1fr 300px;gap:10px;padding:10px;min-height:calc(100dvh - 56px - 56px)}
.eb-rail{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:10px}
.eb-controls{display:grid;gap:8px}
.ctrl{display:grid;gap:4px}
.ctrl__label{font-size:.85rem;color:var(--muted)}
.ctrl__select{padding:.45rem;border-radius:8px;border:1px solid var(--border);background:#fff}
.ctrl__checkbox{display:flex;gap:.5rem;align-items:center}

.eb-tools{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.eb-tools--grid .eb-tool{display:grid;justify-items:center;gap:4px}
.eb-tool{border:1px solid var(--border);background:#fff;border-radius:12px;padding:6px;cursor:pointer}
.eb-tool.is-active{outline:2px solid var(--accent)}
.eb-tool svg{width:20px;height:20px;display:block}

.eb-loom{margin-top:auto}
.eb-loom__card{background:#fff;border:1px dashed var(--border);border-radius:12px;padding:8px;display:grid;place-items:center}
#loomPreviewCanvas{display:block;width:100%;height:auto}

.eb-stage{display:grid;place-items:center}
.eb-canvas-wrap{position:relative;background:#fff;border:1px dashed var(--border);border-radius:16px;overflow:hidden;max-width:100%;width:min(100%,1000px);aspect-ratio:5/3}
#imgLayer{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
#imgCanvas,#maskCanvas,#textCanvas{position:absolute;inset:0;width:100%;height:100%}
#maskCanvas{mix-blend-mode:multiply;opacity:.45}
.is-hidden{opacity:0!important}

.eb-context{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:10px}
.eb-context__head{display:flex;justify-content:space-between;align-items:center}
.panel{border:1px dashed var(--border);border-radius:10px;padding:8px}
.panel.hidden{display:none}
.group{display:grid;gap:6px}
.btnrow{display:flex;gap:6px;flex-wrap:wrap}
.chipbtn{appearance:none;border:1px solid var(--border);background:#fff;border-radius:999px;padding:.35rem .7rem;cursor:pointer}
.chipbtn.is-active{outline:2px solid var(--accent)}

.pillrow{display:flex;gap:6px;flex-wrap:wrap}
.pill{appearance:none;border:1px solid var(--border);background:#fff;border-radius:999px;padding:.35rem .6rem;cursor:pointer}
.pill.is-active{outline:2px solid var(--accent)}

.eb-status{height:56px;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.5rem 12px;border-top:1px solid var(--border);background:var(--panel);position:sticky;bottom:0}

.hidden{display:none!important}

@media (max-width:1100px){
  .eb-layout{grid-template-columns:110px 1fr 280px}
}
@media (max-width:900px){
  .eb-layout{grid-template-columns:1fr}
  .eb-context{order:3}
  .eb-rail{order:1;flex-direction:row;align-items:flex-start}
  .eb-stage{order:2}
}
