:root {
  --bg: #f4f1ea;
  --ink: #1c1915;
  --muted: #6f675c;
  --line: #e4ddd2;
  --card: #fffdf8;
  --accent: #9a3412;
  --accent-ink: #fff7ed;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { font: 15px/1.45 "Iowan Old Style", Palatino, "Songti SC", serif; color: var(--ink); background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.login { min-height: 100%; display: grid; place-items: center; }
.card { width: 360px; background: var(--card); border: 1px solid var(--line); padding: 28px; }
.card h1 { margin: 0 0 6px; font-size: 28px; font-weight: 500; }
.card p, .muted { color: var(--muted); }
label { display: block; margin: 14px 0 6px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: #fff; padding: 8px 10px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; padding: 8px 14px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.err { color: #9f1239; min-height: 1.2em; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--card); }
.top h1 { margin: 0; font-size: 22px; font-weight: 500; flex: 1; }
.list { max-width: 760px; margin: 24px auto; padding: 0 18px; }
.board { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); padding: 14px 16px; margin-bottom: 10px; }
.board button.name { background: none; border: 0; text-align: left; flex: 1; font-size: 18px; }
.stage { height: 100%; display: grid; grid-template-rows: 52px 1fr; }
.bar { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.bar input.title { width: 220px; }
.work { display: grid; grid-template-columns: 240px 1fr; min-height: 0; }
.side { border-right: 1px solid var(--line); padding: 12px; overflow: auto; background: #faf7f2; }
.side h2 { margin: 14px 0 8px; font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
.side .tools { display: flex; flex-wrap: wrap; gap: 6px; }
.asset { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); cursor: grab; }
.asset img { width: 42px; height: 42px; object-fit: cover; background: #eee; }
.asset span { flex: 1; }
.asset button { border: 1px solid var(--line); background: #fff; padding: 4px 6px; font-size: 12px; }
.canvas { position: relative; overflow: hidden; background:
  linear-gradient(transparent 23px, #e7e0d4 24px),
  linear-gradient(90deg, transparent 23px, #e7e0d4 24px);
  background-size: 24px 24px; background-color: #f7f3ec; }
.world { position: absolute; inset: 0; transform-origin: 0 0; }
.node { position: absolute; background: var(--card); border: 1px solid #d9d0c3; box-shadow: 0 8px 20px rgba(40, 30, 10, 0.06); min-width: 180px; }
.node header { display: flex; gap: 6px; align-items: center; padding: 6px 8px; cursor: grab; background: #f3ece2; font-size: 13px; }
.node header span { flex: 1; }
.node .body { padding: 8px; }
.node textarea { min-height: 72px; resize: vertical; }
.node img, .node video { width: 100%; max-height: 220px; object-fit: contain; display: block; background: #1c1915; }
.ports { position: absolute; right: -7px; top: 36px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: crosshair; }
.edge { position: absolute; pointer-events: none; overflow: visible; }
svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.node .body > select { margin-bottom: 6px; }
.row select, .row input { width: auto; }
