/* ═══════════════════════════════════════════════════════════
   Studio Editor — Canva-like design tool (RTL, dark UI)
   ═══════════════════════════════════════════════════════════ */
.ed-app {
    --ed-bg:        #0f1120;
    --ed-panel:     #171a2e;
    --ed-panel2:    #1e2238;
    --ed-border:    rgba(255,255,255,.08);
    --ed-text:      #eceefc;
    --ed-mute:      #9aa0c3;
    --ed-primary:   #6366f1;
    --ed-primary-2: #8b5cf6;
    --ed-radius:    12px;

    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    background: var(--ed-bg); color: var(--ed-text);
    font-family: Vazirmatn, Tahoma, sans-serif;
    z-index: 5000;
}

/* ─── Topbar ─── */
.ed-topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 0 14px; height: 54px; flex-shrink: 0;
    background: var(--ed-panel); border-bottom: 1px solid var(--ed-border);
}
.ed-topbar-right, .ed-topbar-left { display: flex; align-items: center; gap: 8px; }
.ed-topbar-center { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ed-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ed-text); font-weight: 800; font-size: .92rem; }
.ed-logo img { border-radius: 6px; }
.ed-proj-name {
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .8rem; color: var(--ed-mute); cursor: pointer; padding: 4px 10px;
    border-radius: 8px; border: 1px solid transparent;
}
.ed-proj-name:hover { color: var(--ed-text); border-color: var(--ed-border); background: var(--ed-panel2); }
.ed-topbar-sep { width: 1px; height: 22px; background: var(--ed-border); }
.ed-zoom-wrap { display: flex; align-items: center; gap: 2px; }
.ed-zoom-label {
    min-width: 46px; text-align: center; font-size: .74rem; color: var(--ed-mute);
    background: transparent; border: none; cursor: pointer; font-family: inherit;
    font-variant-numeric: tabular-nums; padding: 4px 2px; border-radius: 8px;
}
.ed-zoom-label:hover { background: var(--ed-panel2); color: var(--ed-text); }
.ed-tbtn {
    width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent;
    background: transparent; color: var(--ed-mute); font-size: 1rem; cursor: pointer;
    transition: .15s; display: inline-flex; align-items: center; justify-content: center;
}
.ed-tbtn:hover { background: var(--ed-panel2); color: var(--ed-text); }
.ed-tbtn.active { background: rgba(99,102,241,.18); color: #a5b4fc; }
.ed-tbtn:disabled { opacity: .35; cursor: default; }
.ed-zoom-btn { width: 26px; height: 26px; font-size: .85rem; }

.ed-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: none; border-radius: 10px; padding: 8px 16px;
    font-family: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; transition: .15s;
}
.ed-btn-primary { background: linear-gradient(135deg, var(--ed-primary), var(--ed-primary-2)); color: #fff; }
.ed-btn-primary:hover { filter: brightness(1.12); }
.ed-btn-ghost { background: var(--ed-panel2); color: var(--ed-text); border: 1px solid var(--ed-border); }
.ed-btn-ghost:hover { border-color: rgba(255,255,255,.2); }
.ed-btn-danger { background: rgba(239,68,68,.14); color: #f87171; }
.ed-btn-danger:hover { background: rgba(239,68,68,.24); }
.ed-w-full { width: 100%; justify-content: center; }

/* ─── Layout ─── */
.ed-main { display: flex; flex: 1; min-height: 0; }

/* Tool rail */
.ed-rail {
    width: 76px; flex-shrink: 0; background: var(--ed-panel);
    border-left: 1px solid var(--ed-border);
    display: flex; flex-direction: column; padding: 10px 6px; gap: 4px;
    overflow-y: auto; scrollbar-width: none;
}
.ed-rail::-webkit-scrollbar { display: none; }
.ed-rail-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 2px; border-radius: 11px; border: none; background: transparent;
    color: var(--ed-mute); cursor: pointer; transition: .15s; font-family: inherit;
}
.ed-rail-btn i { font-size: 1.15rem; }
.ed-rail-btn span { font-size: .62rem; font-weight: 600; }
.ed-rail-btn:hover { background: var(--ed-panel2); color: var(--ed-text); }
.ed-rail-btn.active { background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(139,92,246,.22)); color: #a5b4fc; }

/* Side panel */
.ed-side {
    width: 300px; flex-shrink: 0; background: var(--ed-panel);
    border-left: 1px solid var(--ed-border); overflow-y: auto; padding: 16px 14px 40px;
    position: relative;
}
.ed-side-close { display: none; }
.ed-panel { display: none; }
.ed-panel.active { display: block; }
.ed-panel-title { font-size: .95rem; font-weight: 800; margin: 0 0 12px; }
.ed-section-label { font-size: .7rem; font-weight: 700; color: var(--ed-mute); letter-spacing: .05em; margin: 18px 0 8px; }
.ed-panel-note { font-size: .72rem; color: var(--ed-mute); margin-top: 10px; line-height: 1.7; }
.ed-search { margin-bottom: 10px; }

.ed-grid { display: grid; gap: 8px; }
.ed-grid-1 { grid-template-columns: 1fr; }
.ed-grid-2 { grid-template-columns: 1fr 1fr; }
.ed-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ed-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ed-grid-6 { grid-template-columns: repeat(6, 1fr); }

/* Template / size cards */
.ed-tpl-card, .ed-size-card {
    border: 1.5px solid var(--ed-border); border-radius: 11px; overflow: hidden;
    background: var(--ed-panel2); cursor: pointer; transition: .15s; padding: 0; font-family: inherit;
}
.ed-tpl-card:hover, .ed-size-card:hover { border-color: var(--ed-primary); transform: translateY(-2px); }
.ed-tpl-card canvas { width: 100%; display: block; background: #fff; }
.ed-tpl-cap { font-size: .68rem; font-weight: 700; padding: 6px; color: var(--ed-text); text-align: center; }
.ed-size-card { padding: 12px 6px; text-align: center; color: var(--ed-text); }
.ed-size-card .t { font-size: .78rem; font-weight: 700; display: block; }
.ed-size-card .d { font-size: .64rem; color: var(--ed-mute); margin-top: 2px; display: block; font-variant-numeric: tabular-nums; }

/* Dropzone */
.ed-dropzone {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    border: 2px dashed rgba(255,255,255,.16); border-radius: 13px;
    padding: 22px 12px; cursor: pointer; transition: .15s; text-align: center;
    color: var(--ed-mute); font-size: .76rem; margin-bottom: 12px;
}
.ed-dropzone i { font-size: 1.6rem; color: #a5b4fc; }
.ed-dropzone:hover, .ed-dropzone.drag { border-color: var(--ed-primary); background: rgba(99,102,241,.07); }

/* Upload thumbnails */
.ed-thumb {
    position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
    border: 1.5px solid var(--ed-border); background: var(--ed-panel2); padding: 0; aspect-ratio: 1;
}
.ed-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-thumb:hover { border-color: var(--ed-primary); }
.ed-thumb-del {
    position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border: none;
    border-radius: 6px; background: rgba(15,17,32,.75); color: #fca5a5; font-size: .68rem;
    cursor: pointer; display: none; align-items: center; justify-content: center;
}
.ed-thumb:hover .ed-thumb-del { display: flex; }

/* Text style cards */
.ed-text-card {
    border: 1.5px solid var(--ed-border); border-radius: 11px; background: var(--ed-panel2);
    color: var(--ed-text); padding: 12px; text-align: center; cursor: pointer;
    transition: .15s; font-family: inherit; width: 100%;
}
.ed-text-card:hover { border-color: var(--ed-primary); }

/* Font chips */
.ed-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-chip {
    border: 1.5px solid var(--ed-border); background: var(--ed-panel2); color: var(--ed-text);
    border-radius: 20px; padding: 5px 13px; font-size: .76rem; cursor: pointer; font-family: inherit;
    transition: .15s;
}
.ed-chip:hover, .ed-chip.active { border-color: var(--ed-primary); color: #a5b4fc; }

/* Shape / sticker / icon / color cells */
.ed-shape-cell {
    aspect-ratio: 1; border-radius: 10px; border: 1.5px solid var(--ed-border);
    background: var(--ed-panel2); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: .15s; padding: 0; font-family: inherit;
}
.ed-shape-cell:hover { border-color: var(--ed-primary); }
.ed-shape-cell svg { width: 55%; height: 55%; }
.ed-icon-cell {
    aspect-ratio: 1; border-radius: 10px; border: 1.5px solid var(--ed-border);
    background: var(--ed-panel2); color: #a5b4fc; font-size: 1.15rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: .15s; padding: 0;
}
.ed-icon-cell:hover { border-color: var(--ed-primary); color: #c7d2fe; transform: translateY(-2px); }
.ed-sticker-wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.ed-sticker-cell { font-size: 1.45rem; border: none; background: transparent; cursor: pointer; border-radius: 9px; aspect-ratio: 1; transition: .12s; }
.ed-sticker-cell:hover { background: var(--ed-panel2); transform: scale(1.15); }
.ed-color-cell { aspect-ratio: 1; border-radius: 9px; cursor: pointer; border: 2px solid rgba(255,255,255,.12); transition: .12s; padding: 0; }
.ed-color-cell:hover { transform: scale(1.12); border-color: #fff; }
.ed-color-input { width: 100%; height: 40px; border: 1px solid var(--ed-border); border-radius: 10px; background: var(--ed-panel2); cursor: pointer; }

/* ─── Stage ─── */
.ed-stage {
    flex: 1; min-width: 0; overflow: auto;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(99,102,241,.10), transparent 55%),
        radial-gradient(ellipse at 75% 80%, rgba(139,92,246,.08), transparent 55%),
        var(--ed-bg);
    display: flex; align-items: center; justify-content: center; padding: 34px;
}
.ed-stage-inner { position: relative; display: flex; align-items: center; justify-content: center; }
.ed-ruler {
    position: absolute; z-index: 6; pointer-events: none; overflow: hidden;
    background: rgba(23,26,46,.85); border: 1px solid var(--ed-border); color: var(--ed-mute);
    font-size: .56rem; font-variant-numeric: tabular-nums;
}
.ed-ruler span { position: absolute; padding: 0 4px; }
.ed-ruler-h { top: -22px; right: 0; left: 0; height: 18px; border-bottom: none; }
.ed-ruler-h span { top: 2px; }
.ed-ruler-v { top: 0; bottom: 0; right: -26px; width: 22px; border-left: none; }
.ed-ruler-v span { right: 2px; }
.ed-canvas-wrap {
    position: relative; box-shadow: 0 18px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.07);
    border-radius: 4px; background: #fff;
}
.ed-canvas-wrap canvas { display: block; border-radius: 4px; }
.ed-stage.previewing { padding: 12px; }

/* Context toolbar near selection */
.ed-ctx-bar {
    position: absolute; z-index: 12; display: flex; align-items: center; gap: 4px;
    background: #232744; border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
    padding: 5px 7px; box-shadow: 0 10px 30px rgba(0,0,0,.45); white-space: nowrap;
}
.ed-ctx-btn {
    width: 28px; height: 28px; border: none; border-radius: 8px; background: transparent;
    color: #cdd2f0; cursor: pointer; font-size: .8rem; font-family: inherit;
    display: inline-flex; align-items: center; justify-content: center;
}
.ed-ctx-btn:hover { background: rgba(255,255,255,.09); color: #fff; }
.ed-ctx-btn.active { background: rgba(99,102,241,.3); color: #c7d2fe; }
.ed-ctx-sel, .ed-ctx-num {
    height: 28px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12);
    background: #1a1e33; color: #eceefc; font-family: inherit; font-size: .74rem; padding: 0 6px;
}
.ed-ctx-num { width: 58px; }
.ed-ctx-color { width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: #1a1e33; cursor: pointer; padding: 2px; }
.ed-ctx-range { width: 76px; accent-color: #6366f1; cursor: pointer; }

/* Right-click menu */
.ed-ctx-menu {
    position: absolute; z-index: 900; min-width: 190px;
    background: #202442; border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
    padding: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.ed-ctx-menu button {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: right;
    background: transparent; border: none; color: #dfe3fa; font-family: inherit;
    font-size: .8rem; padding: 8px 10px; border-radius: 9px; cursor: pointer;
}
.ed-ctx-menu button:hover { background: rgba(99,102,241,.18); }
.ed-ctx-menu button.danger { color: #f87171; }
.ed-ctx-menu button.danger:hover { background: rgba(239,68,68,.14); }

/* Zoom menu */
.ed-zoom-menu {
    position: fixed; top: 50px; right: 50%; transform: translateX(50%);
    z-index: 950; min-width: 150px; background: #202442;
    border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 6px;
    box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.ed-zoom-menu button {
    display: block; width: 100%; text-align: right; background: transparent; border: none;
    color: #dfe3fa; font-family: inherit; font-size: .8rem; padding: 8px 12px;
    border-radius: 9px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.ed-zoom-menu button:hover { background: rgba(99,102,241,.18); }

/* ─── Layers ─── */
.ed-layer-list { display: flex; flex-direction: column; gap: 6px; }
.ed-layer-item {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    background: var(--ed-panel2); border: 1.5px solid var(--ed-border); border-radius: 10px;
    padding: 8px 10px; cursor: pointer; transition: .15s;
}
.ed-layer-item:hover { border-color: rgba(99,102,241,.5); }
.ed-layer-item.selected { border-color: var(--ed-primary); background: rgba(99,102,241,.14); }
.ed-layer-item.drag-over { border-top: 2px solid #a5b4fc; }
.ed-layer-name { font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-layer-acts { display: flex; gap: 2px; flex-shrink: 0; }
.ed-layer-acts button {
    width: 24px; height: 24px; border: none; background: transparent; color: var(--ed-mute);
    border-radius: 6px; cursor: pointer; font-size: .74rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.ed-layer-acts button:hover { background: rgba(255,255,255,.08); color: var(--ed-text); }

/* ─── Pages strip ─── */
.ed-pages-wrap { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ed-page-thumb {
    position: relative; width: 76px; cursor: pointer; border-radius: 10px;
    border: 2px solid var(--ed-border); background: var(--ed-panel2); padding: 4px; transition: .15s;
}
.ed-page-thumb:hover { border-color: rgba(99,102,241,.6); }
.ed-page-thumb.active { border-color: var(--ed-primary); }
.ed-page-thumb canvas { width: 100%; display: block; border-radius: 4px; background: #fff; }
.ed-page-label { font-size: .6rem; color: var(--ed-mute); text-align: center; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-page-acts { display: none; gap: 2px; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    background: #232744; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; padding: 2px; z-index: 5; }
.ed-page-thumb:hover .ed-page-acts { display: flex; }
.ed-page-acts button { width: 20px; height: 20px; border: none; background: transparent; color: #cdd2f0; cursor: pointer; font-size: .6rem; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; }
.ed-page-acts button:hover { background: rgba(255,255,255,.1); }
.ed-page-add {
    width: 76px; align-self: stretch; min-height: 110px; border: 2px dashed rgba(255,255,255,.18);
    border-radius: 10px; background: transparent; color: var(--ed-mute); font-family: inherit;
    font-size: .66rem; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
    align-items: center; justify-content: center; transition: .15s;
}
.ed-page-add:hover { border-color: var(--ed-primary); color: #a5b4fc; }
.ed-page-add i { font-size: 1.1rem; }

/* ─── Projects ─── */
.ed-project-card {
    position: relative; border: 1.5px solid var(--ed-border); border-radius: 11px;
    background: var(--ed-panel2); overflow: hidden; cursor: pointer; transition: .15s;
}
.ed-project-card:hover { border-color: var(--ed-primary); transform: translateY(-2px); }
.ed-project-thumb { width: 100%; display: block; background: #fff; }
.ed-project-name { font-size: .72rem; font-weight: 700; padding: 6px 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-project-date { font-size: .6rem; color: var(--ed-mute); padding: 2px 8px 8px; }
.ed-project-acts {
    position: absolute; top: 6px; left: 6px; display: flex; gap: 2px;
    background: rgba(15,17,32,.8); border-radius: 8px; padding: 2px; opacity: 0; transition: .15s;
}
.ed-project-card:hover .ed-project-acts { opacity: 1; }
.ed-project-acts button { width: 24px; height: 24px; border: none; background: transparent; color: #cdd2f0; cursor: pointer; font-size: .7rem; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.ed-project-acts button:hover { background: rgba(255,255,255,.12); }

/* ─── Properties panel ─── */
.ed-props {
    width: 264px; flex-shrink: 0; background: var(--ed-panel);
    border-right: 1px solid var(--ed-border); overflow-y: auto; padding: 16px 14px 40px;
}
.ed-props-empty {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--ed-mute); font-size: .78rem; padding-top: 40px;
}
.ed-props-empty i { font-size: 1.6rem; opacity: .5; }
.ed-prop-group { margin-bottom: 16px; }
.ed-prop-label { font-size: .72rem; font-weight: 700; color: var(--ed-mute); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.ed-prop-row { display: flex; gap: 6px; }
.ed-mini-btn {
    flex: 1; padding: 7px 4px; border-radius: 9px; border: 1.5px solid var(--ed-border);
    background: var(--ed-panel2); color: var(--ed-text); cursor: pointer; font-size: .72rem;
    font-family: inherit; transition: .12s; display: flex; align-items: center; justify-content: center; gap: 4px;
}
.ed-mini-btn:hover { border-color: var(--ed-primary); }
.ed-mini-btn.active { border-color: var(--ed-primary); background: rgba(99,102,241,.16); }
.ed-mini-input {
    width: 100%; padding: 7px 9px; border-radius: 9px; border: 1.5px solid var(--ed-border);
    background: var(--ed-panel2); color: var(--ed-text); font-family: inherit; font-size: .78rem;
}
.ed-mini-input:focus { outline: none; border-color: var(--ed-primary); }
input[type="range"].ed-slider { width: 100%; accent-color: var(--ed-primary); cursor: pointer; }
input[type="color"].ed-color-sm { width: 100%; height: 34px; border: 1px solid var(--ed-border); border-radius: 9px; background: var(--ed-panel2); cursor: pointer; padding: 2px; }
select.ed-mini-input option { background: var(--ed-panel2); }

/* ─── Modal ─── */
.ed-modal-backdrop {
    position: fixed; inset: 0; background: rgba(5,7,18,.72); z-index: 6000;
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px);
}
.ed-modal {
    width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 60px); overflow-y: auto;
    background: var(--ed-panel, #171a2e);
    border: 1px solid rgba(255,255,255,.1); border-radius: 18px; overflow: hidden;
    color: #eceefc; font-family: Vazirmatn, Tahoma, sans-serif;
    box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.ed-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.ed-modal-head h4 { margin: 0; font-size: 1rem; font-weight: 800; }
.ed-modal-body { padding: 6px 18px; }
.ed-modal-foot { display: flex; justify-content: flex-start; gap: 8px; padding: 14px 18px 18px; }
.ed-field-label { display: block; font-size: .74rem; font-weight: 700; color: #9aa0c3; margin: 12px 0 7px; }
.ed-check-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ed-check-row input { accent-color: #6366f1; }
.ed-seg { display: flex; gap: 6px; }
.ed-seg-btn {
    flex: 1; padding: 9px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.1);
    background: #1e2238; color: #eceefc; font-family: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.ed-seg-btn.active { border-color: #6366f1; background: rgba(99,102,241,.18); color: #a5b4fc; }
.ed-modal input[type="range"] { width: 100%; accent-color: #6366f1; }
.ed-help-list div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,.07); font-size: .8rem; }
.ed-help-list div:last-child { border-bottom: none; }
.ed-help-list b { color: #a5b4fc; font-weight: 700; direction: ltr; }
.ed-help-list span { color: #cdd2f0; }

/* ─── Crop mode ─── */
.ed-canvas-wrap.cropping { outline: 1px solid rgba(99,102,241,.5); }
#edCropOverlay {
    position: absolute; inset: 0; z-index: 5; cursor: move;
}
.ed-crop-rect {
    position: absolute; box-sizing: border-box;
    border: 1.5px solid #fff; box-shadow: 0 0 0 9999px rgba(10,12,24,.45);
    cursor: move;
}
.ed-crop-rect::after {
    content: ''; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
    background-size: 33.34% 33.34%;
    pointer-events: none;
}
.ed-crop-rect .ed-crop-h {
    position: absolute; width: 14px; height: 14px; background: #fff;
    border: 2px solid #6366f1; border-radius: 3px; z-index: 2;
}
.ed-crop-bar {
    position: absolute; bottom: 18px; right: 50%; transform: translateX(50%);
    background: var(--ed-panel, #171a2e); border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; gap: 16px;
    box-shadow: 0 14px 44px rgba(0,0,0,.5); z-index: 20; flex-wrap: wrap; justify-content: center;
}
.ed-crop-bar .ed-chip-row { max-width: 420px; }
.ed-btn.ed-btn-primary { border: none; }

/* ─── Toast ─── */
.ed-toast {
    position: fixed; bottom: 26px; right: 50%; transform: translateX(50%) translateY(90px);
    background: #1e2238; color: #eceefc; border: 1px solid rgba(255,255,255,.12);
    padding: 11px 22px; border-radius: 14px; font-size: .84rem; font-weight: 600;
    box-shadow: 0 14px 44px rgba(0,0,0,.5); transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    z-index: 7000; pointer-events: none; max-width: calc(100vw - 40px); text-align: center;
}
.ed-toast.show { transform: translateX(50%) translateY(0); }
.ed-toast.err { border-color: rgba(239,68,68,.5); color: #fca5a5; }

/* ─── Scrollbars ─── */
.ed-side::-webkit-scrollbar, .ed-props::-webkit-scrollbar, .ed-stage::-webkit-scrollbar, .ed-rail::-webkit-scrollbar { width: 9px; height: 9px; }
.ed-side::-webkit-scrollbar-thumb, .ed-props::-webkit-scrollbar-thumb, .ed-stage::-webkit-scrollbar-thumb, .ed-rail::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.14); border-radius: 10px;
}

/* ═══ Mobile: bottom nav + bottom sheets ═══ */
.ed-bottom-nav { display: none; }
.ed-sheet-backdrop { display: none; }

@media (max-width: 1100px) { .ed-props { display: none; } }

@media (max-width: 860px) {
    .ed-rail { display: none; }
    .ed-side {
        position: fixed; right: 0; left: 0; top: auto; bottom: 0; width: auto; max-height: 62vh;
        border-radius: 20px 20px 0 0; border: none; border-top: 1px solid var(--ed-border);
        box-shadow: 0 -18px 60px rgba(0,0,0,.6); transform: translateY(110%); transition: transform .28s ease;
        z-index: 800; padding-bottom: 76px;
    }
    .ed-side.open { transform: translateY(0); }
    .ed-side-close {
        display: flex; position: sticky; top: 0; margin: 0 0 8px auto; width: 30px; height: 30px;
        align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--ed-border);
        background: var(--ed-panel2); color: var(--ed-mute); cursor: pointer; z-index: 5;
    }
    .ed-bottom-nav {
        display: flex; position: fixed; bottom: 0; right: 0; left: 0; z-index: 810;
        background: var(--ed-panel); border-top: 1px solid var(--ed-border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        overflow-x: auto; gap: 2px; scrollbar-width: none;
    }
    .ed-bottom-nav::-webkit-scrollbar { display: none; }
    .ed-bottom-nav .ed-rail-btn { flex: 0 0 auto; min-width: 58px; }
    .ed-crop-bar { bottom: 74px; }
    .ed-proj-name { max-width: 110px; }
}

@media (max-width: 560px) {
    .ed-topbar { padding: 0 8px; gap: 6px; }
    .ed-topbar-center .ed-tbtn:not(.ed-zoom-btn), .ed-topbar-sep { display: none; }
    .ed-btn { font-size: .78rem; padding: 7px 12px; }
    .ed-topbar-left .ed-btn-ghost { display: none; }
    .ed-logo span { display: none; }
    .ed-stage { padding: 14px; padding-bottom: 76px; }
    .ed-zoom-label { min-width: 38px; }
}
