:root {
  --bg0: #0a0d11; --bg1: #10141a; --bg2: #161b23; --bg3: #1d242e; --bg4: #252d39;
  --line: #262e3a; --line2: #333d4c;
  --text: #e8edf3; --muted: #98a3b3; --dim: #6b7686;
  --accent: #ff9f1c; --accent2: #ffb84d; --accentInk: #1a1204;
  --danger: #f05252; --ok: #34c77b; --info: #4ea1ff;
  --r: 10px; --r-sm: 7px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg0); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.ic { flex: none; display: block; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--text); }
::selection { background: rgba(255,159,28,.35); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line2); background: var(--bg3); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--bg4); border-color: #435066; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accentInk); }
.btn.primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn.danger { background: transparent; border-color: rgba(240,82,82,.5); color: #ff8a8a; }
.btn.danger:hover { background: rgba(240,82,82,.12); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--bg3); color: var(--text); }
.icon-btn.on { background: rgba(255,159,28,.14); color: var(--accent); border-color: rgba(255,159,28,.35); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }

/* form */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .inp {
  height: 36px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--bg1); outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
.field textarea, textarea.inp { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,159,28,.18); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398a3b3' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px !important; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { min-width: 0; }
.grow { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; padding: 4px 0; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.err { color: #ff8a8a; font-size: 13px; min-height: 18px; }

/* toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { background: var(--bg3); border: 1px solid var(--line2); padding: 10px 16px; border-radius: 9px; box-shadow: var(--shadow); font-weight: 500; opacity: 0; transform: translateY(8px); transition: all .2s; }
.toast.in { opacity: 1; transform: none; }
.toast.ok { border-color: rgba(52,199,123,.5); }
.toast.error { border-color: rgba(240,82,82,.6); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(4,6,9,.66); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 900; opacity: 0; transition: opacity .18s; padding: 16px; }
.modal-bg.in { opacity: 1; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); transform: translateY(8px) scale(.99); transition: transform .18s; }
.modal.wide { width: min(880px, 100%); }
.modal-bg.in .modal { transform: none; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 20px; }
.modal-h h3 { font-size: 16px; }
.modal-b { padding: 6px 20px 16px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* top bar (site) */
.topbar { height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(10,13,17,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand small { font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.topbar .sp { flex: 1; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 200; }
.menu.open .menu-pop { display: block; }
.menu-pop .mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; color: var(--text); font-size: 13.5px; }
.menu-pop .mi:hover { background: var(--bg3); text-decoration: none; }
.menu-pop .mi.danger { color: #ff8a8a; }
.menu-pop .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-pop .mh { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #ff9f1c, #ff6a3d); color: #1a1204; display: grid; place-items: center; font-weight: 800; font-size: 13px; border: 0; cursor: pointer; }

/* ---------- landing ---------- */
.hero { max-width: 1180px; margin: 0 auto; padding: 72px 24px 40px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 17px; color: var(--muted); margin: 18px 0 28px; max-width: 520px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { border-radius: 16px; border: 1px solid var(--line2); overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); background: #0e1b2b; aspect-ratio: 4 / 3; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.features { max-width: 1180px; margin: 0 auto; padding: 24px 24px 80px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat { background: var(--bg1); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.feat .fi { width: 38px; height: 38px; border-radius: 9px; background: rgba(255,159,28,.12); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.feat h3 { font-size: 15.5px; margin-bottom: 6px; }
.feat p { color: var(--muted); margin: 0; font-size: 13.5px; }
.foot { border-top: 1px solid var(--line); padding: 22px 24px; color: var(--dim); font-size: 12.5px; text-align: center; }

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1200px 600px at 50% -10%, rgba(255,159,28,.08), transparent 60%); }
.auth-card { width: min(410px, 100%); background: var(--bg1); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 20px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg0); border: 1px solid var(--line); border-radius: 9px; padding: 3px; margin-bottom: 22px; }
.tabs button { height: 34px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--bg3); color: var(--text); }

/* ---------- dashboard ---------- */
.dash { max-width: 1240px; margin: 0 auto; padding: 32px 24px 60px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.dash-head h1 { font-size: 26px; font-weight: 800; }
.dash-head .muted { margin-top: 4px; }
.dash-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.search input { padding-left: 34px; width: 240px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--bg1); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; position: relative; display: flex; flex-direction: column; }
.card:hover { border-color: #3a4556; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.card .thumb { aspect-ratio: 16 / 10; background: #0e1b2b; display: grid; place-items: center; cursor: pointer; border-bottom: 1px solid var(--line); }
.card .thumb { position: relative; overflow: hidden; }
.card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card .thumb .ph { color: #2c4a6b; }
.card .meta { padding: 12px 12px 12px 14px; display: flex; align-items: flex-start; gap: 8px; }
.card .meta .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.card .meta .s { font-size: 12px; color: var(--dim); display: flex; gap: 8px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: rgba(78,161,255,.14); color: #8cc2ff; }
.card .menu-pop { top: auto; bottom: calc(100% + 4px); }
.new-card { border: 1.5px dashed var(--line2); background: transparent; border-radius: 14px; display: grid; place-items: center; color: var(--muted); cursor: pointer; min-height: 220px; font-weight: 700; gap: 8px; transition: border-color .15s, color .15s, background .15s; }
.new-card:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,159,28,.04); }
.new-card .ic { margin: 0 auto 6px; }
.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--line2); border-radius: 16px; }
.empty h3 { font-size: 18px; margin: 14px 0 6px; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tpl { border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--bg1); text-align: left; padding: 0; transition: border-color .15s; }
.tpl:hover, .tpl:focus-visible { border-color: var(--accent); outline: none; }
.tpl .tp { aspect-ratio: 16 / 9; background: #0e1b2b; }
.tpl .tp svg { width: 100%; height: 100%; display: block; }
.tpl .tt { padding: 10px 12px; }
.tpl .tt b { display: block; font-size: 13.5px; }
.tpl .tt span { font-size: 12px; color: var(--muted); }
.acct { max-width: 560px; }
.acct section { background: var(--bg1); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.acct h3 { font-size: 15px; margin-bottom: 14px; }

/* ---------- editor ---------- */
body.editor { overflow: hidden; }
.ed { display: grid; grid-template-rows: 52px 1fr; grid-template-columns: 236px 1fr 300px; height: 100vh; }
.ed-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--bg1); border-bottom: 1px solid var(--line); min-width: 0; }
.ed-top .title { background: transparent; border: 1px solid transparent; height: 32px; padding: 0 8px; border-radius: 6px; font-weight: 700; font-size: 14.5px; width: 240px; min-width: 80px; outline: none; }
.ed-top .title:hover { border-color: var(--line2); }
.ed-top .title:focus { border-color: var(--accent); background: var(--bg0); }
.ed-top .vsep { width: 1px; height: 22px; background: var(--line2); margin: 0 4px; }
.save-st { font-size: 12px; color: var(--dim); white-space: nowrap; min-width: 70px; }
.save-st.err { color: #ff8a8a; }
.zoom-val { font-size: 12px; color: var(--muted); width: 44px; text-align: center; font-variant-numeric: tabular-nums; background: none; border: 0; cursor: pointer; }
.ed-top .sp { flex: 1; }
.tool-group { display: flex; gap: 2px; background: var(--bg0); padding: 3px; border-radius: 9px; border: 1px solid var(--line); }
.tool-group .icon-btn { width: 32px; height: 30px; }
.ed-left, .ed-right { background: var(--bg1); overflow: auto; min-height: 0; }
.ed-left { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.ed-right { border-left: 1px solid var(--line); }
.pal-search { padding: 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg1); z-index: 2; }
.pal-cat { padding: 8px 10px 4px; }
.pal-cat h4 { font-size: 10.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; margin: 6px 4px 8px; }
.pal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pal-item { border: 1px solid var(--line); background: var(--bg2); border-radius: 9px; padding: 6px 4px 6px; cursor: grab; display: flex; flex-direction: column; align-items: center; gap: 3px; user-select: none; transition: border-color .12s, background .12s; }
.pal-item:hover { border-color: var(--accent); background: var(--bg3); }
.pal-item svg { width: 100%; height: 44px; }
.pal-item span { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.2; min-height: 25px; display: flex; align-items: center; }
.canvas-wrap { position: relative; overflow: hidden; min-width: 0; min-height: 0; }
#svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
#svg.tool-wire, #svg.drafting { cursor: crosshair; }
#svg.tool-text { cursor: text; }
#svg.tool-pan, #svg.panning { cursor: grab; }
#svg.panning:active { cursor: grabbing; }
#svg .comp { cursor: move; }
#svg .wire, #svg .wlabel { cursor: pointer; }
#svg .noteg { cursor: move; }
#svg .pin { cursor: crosshair; }
#svg .pin:hover, #svg .pin.hot { r: 6; fill: var(--accent); stroke: var(--accent); }
#svg .hotspot:hover, #svg .hotspot.hot { r: 7; fill: var(--accent); fill-opacity: 1; stroke-opacity: 1; }
#svg .handle { fill: var(--accent); stroke: #111; stroke-width: 1.5; cursor: move; }
#svg .handle.end { fill: #fff; stroke: var(--accent); stroke-width: 2.5; }
#svg .draft { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 6 5; pointer-events: none; }
#svg .rubber { fill: rgba(255,159,28,.08); stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 3; }
.hud { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.hud .pill { background: rgba(16,20,26,.9); border: 1px solid var(--line2); border-radius: 99px; padding: 5px 12px; font-size: 12px; color: var(--muted); backdrop-filter: blur(4px); }
.hud .pill b { color: var(--text); }
.hud .pill.accent { border-color: rgba(255,159,28,.6); color: var(--accent2); }
.drop-hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.drop-hint > div { text-align: center; color: var(--muted); max-width: 360px; padding: 24px; border-radius: 16px; background: rgba(16,20,26,.8); border: 1px dashed var(--line2); }
.drop-hint h3 { color: var(--text); font-size: 16px; margin: 10px 0 6px; }
.drop-hint p { font-size: 13px; margin: 0 0 12px; }
.drop-hint .btn { pointer-events: auto; }
.minihelp { position: absolute; right: 12px; bottom: 12px; }

#palBtn { display: none; }
/* properties panel */
.pp { padding: 14px 14px 30px; }
.pp h3 { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.pp .kind { font-size: 11px; color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.pp section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pp section:first-child { padding-top: 0; }
.pp section:last-child { border-bottom: 0; }
.pp .sec-h { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.pp .field { margin-bottom: 10px; }
.pp .field input, .pp .field select { height: 32px; font-size: 13px; }
.pp .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp .btnrow { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sw { aspect-ratio: 1; border-radius: 7px; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); padding: 0; }
.sw.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--bg1) inset, inset 0 0 0 1px rgba(255,255,255,.18); }
.conn-list { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.conn-list .ci { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; background: var(--bg2); cursor: pointer; border: 1px solid transparent; }
.conn-list .ci:hover { border-color: var(--line2); }
.conn-list .dot { width: 14px; height: 6px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.conn-list .pn { font-weight: 700; min-width: 34px; color: var(--muted); }
.calc { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.calc .res { font-size: 13px; margin-top: 4px; }
.calc .res b { color: var(--accent2); font-size: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.stat b { display: block; font-size: 17px; }
.stat span { font-size: 11px; color: var(--dim); }
.kbd { font: 600 11px var(--font); background: var(--bg3); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text); }
.help-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.help-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.help-table td:first-child { white-space: nowrap; width: 1%; padding-right: 16px; }
table.bom { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
table.bom th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 6px 8px; border-bottom: 1px solid var(--line2); }
table.bom td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.bom td.n { text-align: right; font-variant-numeric: tabular-nums; }
.bom h4 { font-size: 13px; margin: 6px 0 8px; }
.share-box { display: flex; gap: 8px; }
.share-box input { flex: 1; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--bg1); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--bg4); cursor: pointer; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- viewer ---------- */
.vw { display: grid; grid-template-rows: auto 1fr; height: 100vh; }
.vw-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg1); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vw-top .ttl h1 { font-size: 16px; font-weight: 800; }
.vw-top .ttl div { font-size: 12px; color: var(--muted); }
.vw-body { display: grid; grid-template-columns: 1fr 0; min-height: 0; transition: grid-template-columns .2s; }
.vw-body.side-open { grid-template-columns: 1fr 380px; }
.vw-side { overflow: auto; background: var(--bg1); border-left: 1px solid var(--line); padding: 0; }
.vw-side .in { padding: 16px; }
.ro-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--bg3); color: var(--muted); border: 1px solid var(--line2); display: inline-flex; gap: 5px; align-items: center; }

/* responsive */
@media (max-width: 1100px) {
  .ed { grid-template-columns: 200px 1fr 270px; }
  .ed-top .title { width: 160px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .features { grid-template-columns: 1fr; }
  .ed { grid-template-columns: 1fr; grid-template-rows: 52px 1fr 170px; }
  .ed-left { position: fixed; left: 0; top: 52px; bottom: 0; width: 270px; z-index: 60; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  .ed-left.open { transform: none; }
  #palBtn { display: inline-flex; }
  .ed-top .btn .lbl { display: none; }
  .ed-top .btn.sm { width: 34px; padding: 0; }
  .hud { display: none; }
  .dash-tools .search { flex: 1 1 100%; }
  .ed-top #logo, .save-st { display: none !important; }
  .new-card { display: none; }
  .ed-top .title { width: auto; flex: 1; }
  .ed-top > .sp { display: none; }
  .ed-top { gap: 4px; }
  .ed-right { grid-row: 3; border-left: 0; border-top: 1px solid var(--line); }
  .ed-top .hide-sm { display: none; }
  .vw-body.side-open { grid-template-columns: 1fr; grid-template-rows: 1fr 45vh; }
  .search input { width: 100%; }
  .dash-tools { width: 100%; }
  .tpl-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
}
@media print {
  .vw-top, .vw-side, #toasts { display: none !important; }
  .vw { display: block; height: auto; }
}
