.tool-rail {
  position: fixed;
  z-index: 90;
  left: 9px;
  top: 61px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 50px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(46, 53, 50, .97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.tool {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 43px;
  padding: 3px 2px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}

.tool::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: transparent;
}

.tool span { font-size: 17px; line-height: 18px; }
.tool small { font-size: 8px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tool:hover { color: var(--ink); border-color: var(--line); background: var(--panel-3); }
.tool.active { color: var(--accent); border-color: rgba(255, 113, 91, .48); background: var(--accent-soft); }
.tool.active::before { background: var(--accent); box-shadow: 0 0 8px rgba(255, 113, 91, .42); }

.inspector {
  position: fixed;
  z-index: 80;
  right: 9px;
  top: 61px;
  width: 278px;
  max-height: calc(100vh - 70px);
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(46, 53, 50, .98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.inspector-empty { display: grid; justify-items: start; padding: 20px; text-align: left; }
.inspector-empty > span { color: var(--accent); font-size: 25px; line-height: 1; opacity: .72; }
.inspector-empty h2 { margin: 13px 0 4px; font-size: 12px; font-weight: 750; letter-spacing: .02em; text-transform: uppercase; }
.inspector-empty p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.inspector-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #29302d;
}

.inspector-head h2 { margin: 0; font-size: 11px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.inspector-section { padding: 10px; border-bottom: 1px solid var(--line); }
.field { display: grid; gap: 4px; margin-bottom: 9px; }
.field:last-child { margin-bottom: 0; }
.field label { color: var(--muted); font-size: 9px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }

.field input,
.field textarea,
.field select,
.modal input,
.modal textarea,
.modal select {
  width: 100%;
  padding: 6px 7px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #252b28;
  font-size: 11px;
  transition: border-color .12s ease, background .12s ease;
}

.field input:hover,
.field textarea:hover,
.field select:hover,
.modal input:hover,
.modal textarea:hover,
.modal select:hover { border-color: var(--line-strong); }

.field input:focus,
.field textarea:focus,
.field select:focus,
.modal input:focus,
.modal textarea:focus,
.modal select:focus { border-color: var(--accent); background: #29302d; }

.field textarea { min-height: 68px; resize: vertical; line-height: 1.45; }
.field input[type="color"] { height: 30px; padding: 3px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.inspector-actions { display: flex; gap: 5px; padding: 9px 10px; }
.inspector-actions .button { flex: 1; font-size: 10px; }

.create-fab {
  position: absolute;
  z-index: 60;
  left: 68px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 9px 24px rgba(0, 0, 0, .42), 0 0 18px rgba(255, 113, 91, .16);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .14s ease, box-shadow .14s ease, transform .14s ease;
}

.create-fab:hover { background: var(--accent-hover); box-shadow: 0 9px 24px rgba(0, 0, 0, .42), 0 0 22px rgba(255, 113, 91, .28); }
.create-fab:active { transform: translateY(1px); }

.zoom-controls {
  position: absolute;
  z-index: 60;
  left: 112px;
  bottom: 12px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(46, 53, 50, .97);
  box-shadow: var(--shadow);
}

.zoom-controls button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.zoom-controls button:last-child { border-right: 0; }
.zoom-controls button:hover { color: var(--accent); background: var(--accent-soft); }
.zoom-controls span { font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; }

.minimap {
  position: absolute;
  z-index: 55;
  right: 296px;
  bottom: 12px;
  width: 142px;
  height: 86px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(46, 53, 50, .94);
  box-shadow: var(--shadow);
}

.minimap::before {
  content: "NAVIGATOR";
  position: absolute;
  left: 6px;
  top: 4px;
  color: var(--muted-2);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 7px;
  letter-spacing: .13em;
}

.minimap-node { position: absolute; min-width: 3px; min-height: 3px; background: #cbd2d0; }
.minimap-group { position: absolute; border: 1px solid #7b8782; }
.minimap #minimap-window { position: absolute; border: 1px solid var(--accent); background: rgba(255, 113, 91, .08); }

.modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(19, 23, 21, .84);
  backdrop-filter: blur(9px);
}

.modal {
  width: min(460px, 100%);
  max-height: min(700px, 92vh);
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #2e3532;
  box-shadow: 0 32px 100px rgba(0, 0, 0, .72);
}

.modal-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 13px; font-weight: 760; letter-spacing: .01em; }
.modal-close { width: 28px; height: 28px; padding: 0; border: 1px solid transparent; color: var(--muted); background: transparent; font-size: 18px; cursor: pointer; }
.modal-close:hover { border-color: var(--line); color: var(--ink); background: var(--panel-3); }
.modal-body { display: grid; gap: 9px; padding: 11px; }
.modal-copy { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 5px; padding: 9px 10px; border-top: 1px solid var(--line); }

.create-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.create-choice { min-height: 70px; padding: 9px; border: 1px solid var(--line); color: var(--ink); background: var(--panel-2); text-align: left; cursor: pointer; }
.create-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.create-choice strong { display: block; margin-bottom: 3px; font-size: 11px; font-weight: 760; text-transform: uppercase; letter-spacing: .025em; }
.create-choice span { color: var(--muted); font-size: 10px; line-height: 1.35; }

.toast-root { position: fixed; z-index: 2000; right: 12px; bottom: 12px; display: grid; gap: 5px; width: min(330px, calc(100vw - 24px)); pointer-events: none; }
.toast { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px 9px 13px; border: 1px solid var(--line-strong); background: #343c38; box-shadow: var(--shadow); animation: toast-in .18s ease-out; }
.toast::before { content: ""; position: absolute; inset: -1px auto -1px -1px; width: 3px; background: var(--accent); }
.toast.success::before { background: var(--success); }
.toast.error::before { background: var(--danger); }
.toast strong { display: block; font-size: 11px; }
.toast span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }

@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 980px) {
  .inspector { display: none; }
  .minimap { right: 12px; }
}

@media (max-width: 600px) {
  .tool-rail { left: 6px; top: 58px; width: 43px; }
  .tool { min-height: 38px; }
  .tool small { display: none; }
  .create-fab { left: 55px; bottom: 8px; }
  .zoom-controls { left: 99px; bottom: 8px; }
  .minimap { display: none; }
}
