body.editor-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.editor-page .site-header { position: static; flex: 0 0 auto; }
.top-links { display: flex; gap: 14px; margin-left: 18px; }
.top-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.top-links a:hover { color: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.toolbar .sep, .stage-bar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.toolbar .grow { flex: 1; }
.hint-inline { color: var(--muted); font-size: 12px; }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; cursor: pointer; }
.btn.secondary.active, .btn.active { outline: 2px solid var(--accent); }
.file-btn { display: inline-flex; align-items: center; }

.editor-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr) 380px; }
.panel { background: var(--surface); overflow: auto; min-height: 0; display: flex; flex-direction: column; }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); }
.tabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.tabs button { flex: 1; padding: 10px 6px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.pane { padding: 12px; }
.pane[hidden] { display: none; }

.stage { position: relative; min-width: 0; min-height: 0; background: var(--surface-2); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage.drop::after { content: "Rilascia i file per importarli"; position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent); background: rgba(11, 122, 134, 0.08); pointer-events: none; }
.stage-bar { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--surface); padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.boot-error { position: absolute; inset: 40% 20% auto 20%; padding: 16px; background: var(--red-soft); color: var(--red); border-radius: 10px; text-align: center; }
.toast { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: 80%; }
.toast.show { opacity: 1; }
.toast.error { background: var(--red); color: #fff; }

.field { display: grid; grid-template-columns: 1fr; gap: 3px; margin: 8px 0; font-size: 13px; }
.field .lbl { color: var(--muted); font-weight: 600; }
.field small, .hint, .axis-hint, .block small { color: var(--muted); font-size: 12px; line-height: 1.4; display: block; }
.field input[type="text"], .field input[type="number"], .field select, .row-actions select, textarea {
  width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.field.check { grid-template-columns: 1fr auto; align-items: center; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cols .field { margin: 4px 0; }
.group { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 0 10px 8px; }
.group > summary { cursor: pointer; font-weight: 700; padding: 9px 0; font-size: 14px; }
.block { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; background: var(--bg); }
.block .sub { margin-top: 4px; }
.block-head { display: flex; align-items: center; justify-content: space-between; }
.row-actions { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.row-actions select { flex: 1; width: auto; }
.mini { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 6px; cursor: pointer; padding: 1px 7px; font-size: 14px; line-height: 1.4; }
.mini:hover { color: var(--red); border-color: var(--red); }
.part-list { display: flex; flex-direction: column; gap: 4px; }
.part-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--bg); font-size: 13px; }
.part-item:hover { border-color: var(--accent); }
.part-item.active { background: var(--accent-soft); border-color: var(--accent); }
.part-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.part-item .tag { font-size: 11px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); font-size: 13px; }
.warn-text { color: var(--yellow) !important; }
.colors { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.color-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.color-row input[type="color"] { width: 38px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.color-row span { flex: 1; color: var(--muted); }
#output { font-family: var(--mono); font-size: 12px; margin-top: 8px; min-height: 300px; resize: vertical; }
.issues { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.issues li { padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.issues .error { background: var(--red-soft); color: var(--red); }
.issues .warn { background: var(--yellow-soft); color: var(--yellow); }
.issues .info, .issues .ok { background: var(--accent-soft); color: var(--accent); }
.tabs .badge { margin-left: 4px; }

@media (max-width: 1100px) {
  body.editor-page { height: auto; overflow: auto; }
  .editor-grid { grid-template-columns: 1fr; }
  .stage { height: 60vh; }
  .panel.left, .panel.right { border: 0; max-height: none; }
}
