:root {
  --ws: #16171a;
  --panel: #1f2125;
  --panel-2: #26292e;
  --line: rgba(255,255,255,0.08);
  --text: #ececec;
  --muted: #9a9ca3;
  --accent: #4f5ef7;
  --danger: #ef5b5b;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ws); color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Top bar */
.bar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #1a1b1e; flex-wrap: wrap; }
.brand { font-weight: 600; font-size: 15px; margin: 0 8px 0 0; }
.controls { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.seg button.on { background: #3a3d44; color: var(--text); }
.seg.small button { padding: 4px 9px; font-size: 12px; }
.btn { border: 1px solid var(--line); background: var(--panel-2); padding: 6px 12px; border-radius: 8px; font-size: 13px; white-space: nowrap; }
.btn:hover { background: #30333a; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #6170ff; }
.btn.danger { color: #ff8a8a; }
.btn.on { border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 12px; }
.link-btn:hover { color: var(--text); }
.icon-btn { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; }
.icon-btn:hover { color: var(--text); }
.muted { color: var(--muted); font-weight: 400; }

.size-ctrl { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border-radius: 8px; padding: 3px 8px; font-size: 13px; }
.size-ctrl input { width: 110px; }
.size-ctrl output { width: 38px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.size-ctrl .btn.on { border-color: var(--accent); color: #fff; }
.panel-toggle { display: flex; padding: 4px; }
body.no-side .side { display: none; }
.hint-inline { font-size: 12px; margin-left: auto; }

/* Workspace */
.workspace { flex: 1; display: flex; min-height: 0; }
.side { width: 340px; flex-shrink: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; padding: 12px; overflow-y: auto; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 600; font-size: 13px; }
.count { color: var(--muted); font-weight: 400; }
.tray-panel { flex: 1; display: flex; flex-direction: column; min-height: 220px; }
.tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; align-content: start; min-height: 40px; }
.tray .tile { border-radius: 4px; cursor: pointer; }
.tray .tile.picked { outline: 3px solid var(--accent); outline-offset: -3px; }
.tray .tile .check { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.tray .tile.picked .check { background: var(--accent); border-color: var(--accent); }
.tray-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.tray-tools span { flex: 1; }
.tray-empty { margin-top: 8px; border: 1.5px dashed rgba(255,255,255,0.18); border-radius: 8px; padding: 18px 14px; color: var(--muted); font-size: 12px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.tray-empty strong { color: var(--text); font-size: 13px; }

.insp-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.insp-row .btn.on { border-color: var(--accent); color: #fff; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
.slider.wide input { max-width: none; }
.insp-thumb { width: 96px; flex-shrink: 0; border-radius: 4px; overflow: hidden; }
.insp-actions { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.field { margin-bottom: 10px; }
.label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
textarea { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: inherit; font-size: 13px; padding: 8px; resize: vertical; }
.slider { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin: 4px 0; }
.slider input { flex: 1; max-width: 150px; }
.slider output { width: 40px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.row-btns { display: flex; gap: 6px; margin-top: 6px; }
.row-btns .btn { flex: 1; }
.hint { color: var(--muted); font-size: 11px; margin: 8px 0 0; text-align: center; }
.hint.left { text-align: left; margin-top: 4px; }

/* Stage */
.stage { flex: 1; display: flex; gap: 28px; padding: 20px 24px; overflow: auto; align-items: flex-start; }
.phone-col, .ref-col { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.phone-label { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-height: 26px; }
.phone-label .sub { color: var(--muted); font-weight: 400; }
.phone, .ref-phone, .add-ref { zoom: var(--fit, 1); }
.phone, .ref-phone { width: 390px; height: 844px; border-radius: 44px; overflow: hidden; border: 8px solid #2c2e33; background: #000; position: relative; }
.phone.drag-target { outline: 3px solid var(--accent); outline-offset: 3px; }
.screen { width: 100%; height: 100%; overflow-y: auto; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.loading { height: 100%; display: flex; align-items: center; justify-content: center; color: #8a8d93; font-size: 14px; background: #0c1014; }
.refs { display: flex; gap: 28px; }
.ref-name { font-weight: 600; flex: 1; }
.ref-col .seg { margin-left: auto; }
.ref-shot { height: 100%; overflow-y: auto; scrollbar-width: none; }
.ref-shot img { width: 100%; display: block; }
.add-ref { width: 390px; height: 844px; border-radius: 44px; border: 2px dashed rgba(255,255,255,0.18); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); background: none; text-align: center; padding: 30px; }
.add-ref:hover { border-color: rgba(255,255,255,0.35); color: var(--text); }
.add-ref strong { color: var(--text); font-size: 15px; }

/* ---------- Instagram mock ---------- */
.ig {
  --bg: #0c1014; --fg: #f5f5f5; --fg2: #a8a8a8; --btn: #25292e; --line: #262626; --ring: #3a3d42; --blue: #4a5df9; --link: #e0f1ff;
  background: var(--bg); color: var(--fg); min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  padding-bottom: 100px; position: relative;
}
.ig.light { --bg: #fff; --fg: #000; --fg2: #737373; --btn: #efefef; --line: #dbdbdb; --ring: #dbdbdb; --link: #00376b; }
.ig [contenteditable] { outline: none; border-radius: 4px; cursor: text; }
.ig [contenteditable]:hover { box-shadow: 0 0 0 1px rgba(127,127,127,0.35); }
.ig [contenteditable]:focus { box-shadow: 0 0 0 1.5px var(--blue); }
.ig-status { height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 6px 30px 0 36px; font-weight: 600; font-size: 16px; }
.ig-status .icons { display: flex; gap: 6px; align-items: center; }
.ig-nav { height: 46px; display: flex; align-items: center; padding: 0 16px; gap: 12px; }
.ig-nav .user { font-weight: 700; font-size: 21px; display: flex; align-items: center; gap: 5px; flex: 1; letter-spacing: -0.3px; min-width: 0; }
.ig-nav .user span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-nav.me .user { justify-content: center; }
.ig-nav svg { width: 25px; height: 25px; display: block; flex-shrink: 0; }
.ig-nav .back svg { width: 24px; height: 24px; }
.badge { width: 18px !important; height: 18px !important; flex-shrink: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #ff3040; flex-shrink: 0; }
.ig-head { display: flex; align-items: center; gap: 22px; padding: 10px 16px 4px; }
.avatar { width: 86px; height: 86px; border-radius: 50%; flex-shrink: 0; background: #333 center/cover no-repeat; position: relative; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--ring); margin: 3px; }
.editable .avatar { cursor: pointer; }
.editable .avatar:hover::after { content: "Change"; position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.head-right { flex: 1; min-width: 0; }
.fullname { font-weight: 600; font-size: 15px; margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.fullname .pending { width: 17px; height: 17px; color: var(--fg2); }
.stats { display: flex; justify-content: space-between; padding-right: 18px; }
.stat b { display: block; font-size: 17px; font-weight: 600; line-height: 1.25; }
.stat span { font-size: 14px; }
.ig-bio { padding: 6px 16px 0; font-size: 14px; line-height: 1.33; }
.ig-bio .cat { color: var(--fg2); }
.ig-bio .bio { white-space: pre-wrap; }
.ig-bio .mention { color: var(--link); }
.ig.dark-link .ig-bio .mention { color: #8ca2ff; }
.ig-bio .link { color: var(--link); display: flex; align-items: center; gap: 6px; margin-top: 2px; font-weight: 500; }
.ig:not(.light) .ig-bio .link, .ig:not(.light) .ig-bio .mention { color: #a4b4ff; }
.mutuals { display: flex; align-items: center; gap: 10px; padding: 12px 16px 0; font-size: 13px; line-height: 1.3; }
.mutuals .stack { display: flex; flex-shrink: 0; }
.mutuals .stack i { width: 22px; height: 22px; border-radius: 50%; background: #3a3d42; border: 2px solid var(--bg); margin-left: -7px; }
.mutuals .stack i:first-child { margin-left: 0; }
.mutuals b { font-weight: 600; }
.ig-btns { display: flex; gap: 6px; padding: 14px 16px 4px; }
.ig-btns div { flex: 1; height: 34px; border-radius: 9px; background: var(--btn); display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 600; font-size: 14px; }
.ig-btns .follow { background: var(--blue); color: #fff; }
.ig-btns .sq { flex: 0 0 36px; }
.ig-btns svg { width: 16px; height: 16px; }
.ig-dash { margin: 12px 16px 0; background: var(--btn); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.ig-dash b { display: block; font-weight: 600; }
.ig-dash span { color: var(--fg2); font-size: 13px; }
.ig.light .ig-dash span { color: #5e5e5e; }
.ig-hl { display: flex; gap: 14px; padding: 16px 14px 10px; overflow-x: auto; scrollbar-width: none; }
.ig-hl::-webkit-scrollbar { display: none; }
.hl { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 70px; flex-shrink: 0; position: relative; }
.hl-img { width: 64px; height: 64px; border-radius: 50%; background: #2a2d31 center/cover no-repeat; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--ring); margin-top: 4px; }
.editable .hl-img { cursor: pointer; }
.ig.light .hl-img { background-color: #efefef; }
.hl-img.new { background: none; box-shadow: 0 0 0 1px var(--ring); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 300; }
.hl-label { font-size: 12px; max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.hl .x { position: absolute; top: -2px; right: 0; width: 18px; height: 18px; border-radius: 50%; border: 0; background: #555; color: #fff; font-size: 12px; line-height: 18px; padding: 0; display: none; }
.hl:hover .x { display: block; }
.ig.visitor .add-hl { display: none; }
.ig.visitor:hover .add-hl { display: flex; opacity: .55; }
.ig-tabs { display: flex; border-bottom: 1px solid var(--line); margin-top: 6px; }
.ig-tabs div { flex: 1; display: flex; justify-content: center; padding: 10px 0 9px; color: var(--fg2); }
.ig-tabs div.on { color: var(--fg); box-shadow: inset 0 -1.5px 0 var(--fg); }
.ig-tabs svg { width: 24px; height: 24px; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; min-height: 120px; }
.tile { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #222; cursor: pointer; }
.sq .tile { aspect-ratio: 1 / 1; }
.crop { position: absolute; display: block; max-width: none; pointer-events: none; user-select: none; }
.tile .ico { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 0 2px rgba(0,0,0,0.5)); }
.tile .plan { position: absolute; bottom: 6px; left: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; opacity: 0; transition: opacity .12s; }
.grid .tile:hover .plan { opacity: 1; }
.tile.selected::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--accent); }
.tile.ghost { opacity: 0.35; }
.grid .tile { cursor: grab; }
.tile:focus-visible { outline-offset: -3px; }
.grid-empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: var(--fg2); font-size: 14px; border: 1.5px dashed var(--line); margin: 12px; border-radius: 8px; }
.exporting .edit-only, .exporting .plan { display: none !important; }

/* Floating bottom bar */
.tabbar { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; z-index: 6; pointer-events: none; }
.tabbar .pill { display: flex; align-items: center; gap: 30px; padding: 12px 22px; border-radius: 34px; background: rgba(38,40,44,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #f5f5f5; box-shadow: 0 2px 12px rgba(0,0,0,.35); }
.tabbar.light .pill { background: rgba(246,246,246,.88); color: #111; }
.tabbar svg { width: 26px; height: 26px; }
.tabbar .me { width: 44px; height: 36px; border-radius: 18px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; margin: -4px -10px -4px 0; }
.tabbar .me i { width: 26px; height: 26px; border-radius: 50%; background: #444 center/cover; border: 1.5px solid currentColor; }

/* Post viewer (inside a phone) */
.pv { position: absolute; inset: 0; background: var(--bg); color: var(--fg); z-index: 5; overflow-y: auto; scrollbar-width: none; padding-bottom: 100px; }
.pv-top { height: 46px; display: flex; align-items: center; padding: 0 12px; font-weight: 700; font-size: 17px; }
.pv-top .t { flex: 1; text-align: center; margin-right: 28px; }
.pv-top button { border: 0; background: none; color: var(--fg); padding: 4px; display: flex; }
.pv-top svg { width: 24px; height: 24px; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.pv-head .av { width: 34px; height: 34px; border-radius: 50%; background: #333 center/cover; }
.pv-head .who { flex: 1; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 4px; }
.pv-head .fbtn { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.pv-head svg { width: 22px; height: 22px; }
.pv-media { position: relative; overflow: hidden; background: #000; touch-action: pan-y; }
.pv-track { display: flex; height: 100%; transition: transform .28s ease; }
.pv-slide { flex: 0 0 100%; height: 100%; position: relative; overflow: hidden; }
.pv-count { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 12px; z-index: 2; }
.pv-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #222; font-size: 16px; display: flex; align-items: center; justify-content: center; z-index: 2; opacity: 0; transition: opacity .15s; }
.pv-media:hover .pv-arrow { opacity: 1; }
.pv-arrow.l { left: 10px; } .pv-arrow.r { right: 10px; }
.pv-arrow[disabled] { display: none; }
.pv-actions { display: flex; align-items: center; gap: 16px; padding: 10px 14px 4px; position: relative; }
.pv-actions svg { width: 25px; height: 25px; }
.pv-actions .save { margin-left: auto; }
.pv-dots { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); display: flex; gap: 4px; }
.pv-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg2); opacity: .5; }
.pv-dots i.on { background: var(--blue); opacity: 1; }
.pv-cap { padding: 6px 14px; font-size: 14px; line-height: 1.35; white-space: pre-wrap; }
.pv-cap b { font-weight: 600; margin-right: 4px; }
.pv-date { padding: 4px 14px 20px; color: var(--fg2); font-size: 12px; }
.pv-reel-badge { position: absolute; bottom: 12px; left: 12px; color: #fff; font-size: 12px; font-weight: 600; background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 10px; z-index: 2; }

/* Editor modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ed { background: var(--panel); border-radius: 14px; width: min(1180px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.ed-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 12px; }
.ed-head h2 { font-size: 15px; margin: 0; flex: 1; font-weight: 600; }
.ed-head-actions { display: flex; gap: 8px; }
.ed-body { flex: 1; display: flex; min-height: 0; }
.ed-stage { height: 300px; position: relative; background: #0e0f11; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 8px; }
.ed-media { position: relative; }
.ed-media img, .ed-media video { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.ed-frame { position: absolute; box-shadow: 0 0 0 9999px rgba(0,0,0,.62); border: 1.5px solid #fff; cursor: move; touch-action: none; }
.ed-frame::before, .ed-frame::after { content: ""; position: absolute; pointer-events: none; border: 0 solid rgba(255,255,255,.35); opacity: 0; transition: opacity .15s; }
.ed-frame.dragging::before, .ed-frame.dragging::after { opacity: 1; }
.ed-frame::before { top: 0; bottom: 0; left: 33.33%; right: 33.33%; border-left-width: 1px; border-right-width: 1px; }
.ed-frame::after { left: 0; right: 0; top: 33.33%; bottom: 33.33%; border-top-width: 1px; border-bottom-width: 1px; }
.ed-side { width: 300px; border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 16px; padding: 5px 10px; font-size: 12px; color: var(--muted); }
.chips button.on { border-color: var(--accent); color: #fff; background: rgba(79,94,247,.18); }
.ed-side input[type=range] { width: 100%; }
.ed-grid-row { display: flex; gap: 12px; align-items: center; }
.ed-grid-ctrl .label { margin-bottom: 0; }
.ed-grid-tile { width: 60px; aspect-ratio: 3/4; position: relative; overflow: hidden; border-radius: 4px; flex-shrink: 0; background: #222; }
.ed-grid-ctrl { flex: 1; }
.ed-grid-ctrl .slider input { max-width: 110px; }
.ed-strip-wrap { display: flex; gap: 6px; padding: 8px 0 10px; align-items: center; overflow-x: auto; scrollbar-width: thin; }
.ed-strip { display: flex; gap: 6px; }
.ed-slide { width: 48px; height: 60px; position: relative; border-radius: 6px; overflow: hidden; flex-shrink: 0; cursor: pointer; background: #222; border: 2px solid transparent; }
.ed-slide.on { border-color: var(--accent); }
.ed-slide .n { position: absolute; left: 4px; bottom: 3px; font-size: 10px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000; }
.ed-slide .vid { position: absolute; right: 4px; bottom: 3px; font-size: 10px; color: #fff; text-shadow: 0 0 3px #000; }
.ed-slide .rm { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; line-height: 18px; padding: 0; display: none; }
.ed-slide:hover .rm { display: block; }
.add-slide { width: 48px; height: 60px; border-radius: 6px; border: 1.5px dashed rgba(255,255,255,.25); background: none; color: var(--muted); font-size: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.add-slide span { font-size: 10px; }
.add-slide:hover { color: var(--text); border-color: rgba(255,255,255,.5); }
.progress { position: absolute; inset: 0; background: rgba(0,0,0,.7); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 14px; z-index: 5; }
.progress .bar-o { width: 260px; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
.progress .bar-i { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.drop-overlay { position: fixed; inset: 0; background: rgba(79,94,247,0.12); border: 3px dashed var(--accent); display: none; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; pointer-events: none; z-index: 50; }
.drop-overlay.show { display: flex; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; background: #30333a; padding: 9px 16px; border-radius: 8px; font-size: 13px; transition: all 0.2s; pointer-events: none; z-index: 60; display: flex; align-items: center; gap: 14px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast button { border: 0; background: none; color: #9aa6ff; font-weight: 600; padding: 0; }

@media (max-width: 900px) {
  body { overflow: auto; height: auto; }
  .workspace { flex-direction: column; }
  .side { width: auto; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .tray { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .stage { overflow-x: auto; overflow-y: visible; padding: 16px; }
  .phone, .ref-phone, .add-ref { zoom: min(var(--fit, 1), 0.85); }
  .modal { padding: 8px; }
  .ed-head { flex-wrap: wrap; }
  .ed-head h2 { flex-basis: 100%; }
  .ed-head-actions { flex-wrap: wrap; }
  .ed-body { flex-direction: column; overflow-y: auto; }
  .ed-stage { min-height: 260px; }
  .ed-side { width: auto; border-left: 0; border-top: 1px solid var(--line); }
}

.inspector.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.pv-top .t { pointer-events: none; }
