:root {
  --bg: #0b1220;
  --bg-2: #111a2e;
  --panel: #152038;
  --panel-2: #1b2846;
  --line: #26365a;
  --text: #e6edf7;
  --text-2: #9fb0cc;
  --text-3: #6b7f9f;
  --teal: #14b8a6;
  --teal-2: #0f9488;
  --indigo: #818cf8;
  --amber: #fbbf24;
  --red: #f87171;
  --green: #4ade80;
  --radius: 12px;
  --font: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0 0 .5em; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
#app { min-height: 100%; }

/* ---------- boot / spinner ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--text-2); font-family: var(--display); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #ffffff22; border-top-color: var(--teal); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: #22325a; border-color: #34497a; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #04201d; }
.btn.primary:hover { background: #2dd4bf; }
.btn.danger { background: #3a1620; border-color: #7f1d1d; color: #fecaca; }
.btn.danger:hover { background: #5b1a28; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: 5px 9px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 12px 22px; font-size: 16px; border-radius: 12px; }
.btn.active { background: var(--teal); color: #04201d; border-color: var(--teal); }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); outline: none; }
.input:focus { border-color: var(--teal); }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.error-text { color: var(--red); font-size: 13px; }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; color: var(--text-3); }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }
.badge.green { color: var(--green); border-color: #14532d; background: #0f2a1c; }
.badge.indigo { color: var(--indigo); border-color: #3730a3; background: #1e1b4b; }
.badge.amber { color: var(--amber); border-color: #78350f; background: #2a1d07; }

/* ---------- site chrome ---------- */
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 12px 28px; background: #0b1220e6; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav .links { display: flex; gap: 4px; }
.nav .links a { color: var(--text-2); padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.nav .links a.on, .nav .links a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav .spacer { flex: 1; }
.page { max-width: 1180px; margin: 0 auto; padding: 32px 28px 80px; }
.footer { border-top: 1px solid var(--line); padding: 26px 28px; color: var(--text-3); display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 60px 0 40px; }
.hero h1 { font-size: 54px; line-height: 1.02; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--teal), var(--indigo)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; color: var(--text-2); line-height: 1.55; max-width: 520px; }
.hero-canvas { aspect-ratio: 4/3; border-radius: 20px; background: radial-gradient(circle at 50% 30%, #1d2b4f, #0b1220 70%); border: 1px solid var(--line); overflow: hidden; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 30px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.feature .ico { font-size: 24px; margin-bottom: 8px; }
.feature p { color: var(--text-2); line-height: 1.5; margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 50px; }
.step { padding: 20px; border-radius: 16px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); }
.step b { font-family: var(--display); color: var(--teal); font-size: 28px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 30px; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 26px; margin: 0; }
.note { padding: 10px 12px; border-radius: 10px; background: #102a2a; border: 1px solid #134e4a; color: #99f6e4; font-size: 13px; line-height: 1.45; }

/* ---------- dashboard ---------- */
.dash-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; font-size: 30px; }
.tabs { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.tabs button.on { background: var(--teal); color: #04201d; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, border-color .12s; }
.card:hover { transform: translateY(-2px); border-color: #34497a; }
.card .thumb { aspect-ratio: 16/10; background: radial-gradient(circle at 50% 40%, #213159, #0e1628); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .ph { font-size: 44px; opacity: .5; }
.card .thumb .tags { position: absolute; top: 8px; left: 8px; display: flex; gap: 5px; }
.card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { font-family: var(--display); font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { color: var(--text-3); font-size: 12px; }
.card .actions { display: flex; gap: 6px; padding: 0 14px 12px; align-items: center; }
.empty { text-align: center; padding: 70px 20px; border: 2px dashed var(--line); border-radius: 18px; color: var(--text-2); }
.empty .big { font-size: 46px; }
.menu { position: absolute; z-index: 50; min-width: 190px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 5px; box-shadow: 0 12px 30px #0008; }
.menu button { display: flex; width: 100%; text-align: left; gap: 8px; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--panel); }
.menu button.danger { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.like { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 4px 10px; cursor: pointer; font-weight: 700; color: var(--text-2); }
.like.on { color: #fb7185; border-color: #9f1239; background: #2a0f19; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: #020617b3; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .12s; }
.modal { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px #000a; }
.modal h2 { margin: 0; font-size: 21px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--teal); padding: 10px 14px; border-radius: 10px; min-width: 220px; box-shadow: 0 8px 24px #0007; animation: fade .2s; }
.toast.error { border-left-color: var(--red); }

/* ---------- tutorials ---------- */
.tut { display: grid; grid-template-columns: 70px 1fr auto; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.tut .num { font-family: var(--display); font-size: 30px; color: var(--teal); text-align: center; }
.tut p { margin: 4px 0 0; color: var(--text-2); }

/* =========================================================
   EDITOR
   ========================================================= */
.ed { position: fixed; inset: 0; display: grid; grid-template-rows: 52px 1fr; background: var(--bg); }
.ed-top { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.ed-top .title-input { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; font-family: var(--display); font-weight: 700; font-size: 16px; width: 230px; }
.ed-top .title-input:hover, .ed-top .title-input:focus { border-color: var(--line); outline: none; background: var(--bg); }
.ed-status { font-size: 12px; color: var(--text-3); min-width: 80px; }
.ed-status.error { color: var(--red); }
.modes { display: inline-flex; gap: 3px; background: var(--panel); padding: 3px; border-radius: 10px; border: 1px solid var(--line); margin: 0 auto; }
.modes button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--text-2); font-size: 13px; letter-spacing: .02em; }
.modes button.on { background: var(--teal); color: #04201d; }
.ed-main { display: grid; grid-template-columns: 250px 1fr 290px; min-height: 0; }
.ed-main.code-mode { grid-template-columns: 250px minmax(0, 1fr) minmax(0, 1fr); }
.ed-left, .ed-right { background: var(--bg-2); border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.ed-right { border-right: 0; border-left: 1px solid var(--line); }
.ed-view { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.ed-view canvas { display: block; width: 100%; height: 100%; outline: none; }
.sec { padding: 12px; border-bottom: 1px solid var(--line); }
.sec h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 0 0 9px; font-family: var(--font); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.part { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.15; }
.part:hover { border-color: var(--teal); color: var(--text); }
.part .pi { font-size: 20px; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 9px; }
.cat-tabs button { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; color: var(--text-2); font-weight: 600; }
.cat-tabs button.on { background: var(--panel-2); color: var(--text); border-color: var(--teal); }
.prop { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12.5px; color: var(--text-2); }
.xyz { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.xyz input, .prop input, .prop select { width: 100%; padding: 5px 6px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; font-family: var(--mono); }
.xyz input:focus, .prop input:focus { outline: none; border-color: var(--teal); }
.prop input[type=color] { padding: 1px; height: 26px; }
.prop input[type=checkbox] { width: auto; }
.olist, .ulist { display: flex; flex-direction: column; gap: 2px; }
.olist div, .ulist div { padding: 5px 8px; border-radius: 7px; cursor: pointer; font-size: 12.5px; display: flex; gap: 6px; align-items: center; color: var(--text-2); }
.olist div:hover, .ulist div:hover { background: var(--panel); }
.olist div.sel { background: #134e4a; color: var(--text); }
.toolbar-float { position: absolute; top: 10px; left: 10px; display: flex; gap: 4px; background: #111a2ee6; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.toolbar-float .btn { padding: 5px 9px; font-size: 12px; }
.view-hint { position: absolute; bottom: 10px; left: 10px; font-size: 11.5px; color: var(--text-3); background: #0b1220c0; padding: 5px 9px; border-radius: 8px; pointer-events: none; }
.sim-hud { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.hp { width: 200px; background: #0b1220d0; border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; font-size: 12px; font-weight: 700; }
.hp .bar { height: 8px; border-radius: 99px; background: #ffffff15; overflow: hidden; margin-top: 4px; }
.hp .bar i { display: block; height: 100%; background: var(--green); transition: width .2s; }
.hp.enemy .bar i { background: var(--red); }
.banner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 54px; font-weight: 700; text-shadow: 0 4px 30px #000; pointer-events: none; }
.serial { font-family: var(--mono); font-size: 12px; background: #060b16; border: 1px solid var(--line); border-radius: 10px; height: 180px; overflow-y: auto; padding: 8px; white-space: pre-wrap; word-break: break-all; }
.serial .err { color: var(--red); }
.serial .sys { color: var(--text-3); }
.pins { width: 100%; border-collapse: collapse; font-size: 12px; }
.pins td { padding: 4px 4px; border-bottom: 1px solid var(--line); }
.ir-remote { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ir-remote .btn { justify-content: center; padding: 6px 0; user-select: none; touch-action: none; }
.pins td:last-child { text-align: right; font-family: var(--mono); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #334155; }
.dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* wiring */
.wire-row { display: grid; grid-template-columns: 1fr 92px; gap: 6px; align-items: center; font-size: 12.5px; margin-bottom: 5px; }
.wire-row select { padding: 4px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.wire-row select.bad { border-color: var(--red); }
.wire-comp { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; margin-bottom: 8px; }
.wire-comp b { display: block; font-size: 12.5px; margin-bottom: 6px; }
.check { font-size: 12.5px; padding: 8px 10px; border-radius: 10px; margin-bottom: 8px; }
.check.ok { background: #0f2a1c; color: var(--green); border: 1px solid #14532d; }
.check.bad { background: #2a0f15; color: #fda4af; border: 1px solid #7f1d1d; }

/* code editor */
.code-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: #070c18; }
.code-tools { display: flex; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.code-wrap { position: relative; flex: 1; min-height: 0; overflow: auto; display: flex; }
.gutter { padding: 12px 8px 12px 10px; text-align: right; color: #3b4d70; font-family: var(--mono); font-size: 13px; line-height: 20px; user-select: none; background: #070c18; position: sticky; left: 0; z-index: 2; }
.gutter .errl { color: var(--red); font-weight: 700; }
.code-stack { position: relative; flex: 1; min-width: max-content; }
.code-stack pre, .code-stack textarea { margin: 0; padding: 12px; font-family: var(--mono); font-size: 13px; line-height: 20px; white-space: pre; tab-size: 2; border: 0; min-height: 100%; }
.code-stack pre { pointer-events: none; color: #d6deeb; }
.code-stack textarea { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; background: transparent; color: transparent; caret-color: #fff; outline: none; overflow: hidden; }
.tk-kw { color: #c792ea; } .tk-ty { color: #82aaff; } .tk-num { color: #f78c6c; } .tk-str { color: #c3e88d; } .tk-com { color: #5c6f92; font-style: italic; } .tk-fn { color: #7fdbca; } .tk-pp { color: #ffcb6b; }
.code-err { padding: 7px 10px; font-size: 12px; font-family: var(--mono); color: #fda4af; background: #2a0f15; border-top: 1px solid #7f1d1d; }
.blockly-host { flex: 1; min-height: 0; position: relative; }
.gen-code { max-height: 30%; overflow: auto; margin: 0; padding: 8px 10px; font-family: var(--mono); font-size: 11.5px; color: #9fb0cc; border-top: 1px solid var(--line); background: #060b16; white-space: pre; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .features, .steps { grid-template-columns: 1fr 1fr; }
}
.toolbar-float:empty { display: none; }
.blocklyTreeLabel, .blocklyToolboxCategoryLabel { font-family: var(--font) !important; font-size: 13px !important; font-weight: 600; }
.dropzone { border: 1.5px dashed rgba(20,184,166,.55); border-radius: 12px; padding: 14px 10px; text-align: center; cursor: pointer; background: rgba(20,184,166,.06); display: grid; gap: 4px; transition: background .15s, border-color .15s; }
.dropzone:hover { background: rgba(20,184,166,.12); border-color: #14b8a6; }
.ed-view.dropping { outline: 3px dashed #14b8a6; outline-offset: -10px; }
.ed-view.dropping::after { content: 'Drop to add as a part'; position: absolute; inset: 0; display: grid; place-items: center; font: 600 20px var(--font); color: #5eead4; background: rgba(8,15,30,.55); pointer-events: none; }
.ed-left .row .input { min-width: 0; flex: 1; }
/* Thingiverse window */
.modal.tv-modal { max-width: 860px; max-height: calc(100vh - 40px); }
.tv-head { display: flex; align-items: center; justify-content: space-between; }
.tv-body { display: flex; flex-direction: column; gap: 12px; overflow: auto; min-height: 120px; }
.tv-body .row .input { flex: 1; min-width: 0; }
.tv-steps { margin: 0; padding-left: 20px; line-height: 1.8; color: var(--text-2); font-size: 14px; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tv-card { display: flex; flex-direction: column; gap: 4px; padding: 8px; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; color: var(--text); cursor: pointer; font: inherit; }
.tv-card:hover { border-color: #14b8a6; }
.tv-card img, .tv-noimg { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #0b1222; }
.tv-noimg { display: grid; place-items: center; font-size: 28px; color: var(--text-2); }
.tv-name { font-weight: 600; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tv-thing { display: flex; gap: 14px; align-items: flex-start; }
.tv-thing img { width: 160px; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.tv-license { margin-top: 8px; font-size: 13px; color: #fcd34d; }
.tv-files { display: flex; flex-direction: column; gap: 6px; }
.tv-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.tv-credit { font-size: 11.5px; color: #fcd34d; margin: 0 0 6px; line-height: 1.5; }
.tv-sites { margin: -4px 0 0; }
.tv-note { background: #1e293b; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }

/* ---------- phones ---------- */
.hero > *, .dash-head > * { min-width: 0; }
@media (max-width: 640px) {
  .nav { flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .nav .links { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav .links a { white-space: nowrap; }
  .nav .account-link { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand { font-size: 16px; }
  .page { padding: 20px 14px 60px; }
  .hero { gap: 24px; padding: 24px 0; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 16px; }
  .hero .row { flex-wrap: wrap; }
  .features, .steps { grid-template-columns: 1fr; }
  .dash-head h1 { font-size: 24px; }
  .dash-head .input { flex: 1 1 100%; }
  .grid { grid-template-columns: 1fr; }
  .footer { padding: 20px 14px; }
}

/* ---------- editor on tablets (portrait) and phones: side panels become drawers ---------- */
.drawer-btn { display: none; }
@media (max-width: 900px) {
  .ed { grid-template-rows: auto 1fr; }
  .ed-top { flex-wrap: wrap; padding: 6px 8px; gap: 6px; }
  .ed-top .title-input { width: auto; flex: 1 1 0; min-width: 40px; }
  .ed-top > .btn.sm { padding-left: 8px; padding-right: 8px; }
  .ed-status { display: none; }
  .ed-top .modes { order: 10; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .ed-top .modes button { flex: 1; padding: 7px 8px; white-space: nowrap; }
  .drawer-btn { display: inline-flex; }
  .ed-main, .ed-main.code-mode { grid-template-columns: minmax(0, 1fr); position: relative; overflow: hidden; }
  .ed-view, .code-pane { grid-column: 1; grid-row: 1; }
  .code-pane { border-left: 0; }
  .ed-left, .ed-right { position: absolute; top: 0; bottom: 0; z-index: 15; width: min(300px, 86vw); transition: transform .2s ease; box-shadow: 0 0 40px #000a; }
  .ed-left { left: 0; transform: translateX(-105%); }
  .ed-right { right: 0; transform: translateX(105%); }
  .ed-main.show-left .ed-left, .ed-main.show-right .ed-right { transform: none; }
}

/* ---------- sign-in extras (hosted mode) ---------- */
.social-list { display: flex; flex-direction: column; gap: 8px; }
.btn.social { justify-content: center; gap: 10px; background: var(--bg); }
.or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.linkish { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; }

/* ---------- account + legal pages ---------- */
.page.narrow { max-width: 760px; }
.panel-sec { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 16px 0; }
.panel-sec h2 { margin: 0 0 6px; font-size: 18px; }
.panel-sec .field { display: flex; flex-direction: column; gap: 6px; }
.danger-zone { border-color: #7f1d1d; }
.legal h2 { font-size: 19px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--text-2); line-height: 1.6; }
.legal ul { padding-left: 20px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.check input { margin-top: 3px; accent-color: var(--teal); }
