.tree-layout { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .tree-layout { grid-template-columns: minmax(0, 1fr); } .scene { max-width: 560px; margin: 0 auto; } }

.scene {
  position: relative; width: 100%; aspect-ratio: 600 / 760; overflow: hidden;
  border-radius: 24px; border: 1px solid var(--line-hi); box-shadow: var(--shadow);
  background: #0b1d2a; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
#bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#items { position: absolute; inset: 0; }

.orn {
  position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%);
  padding: 0; border: 0; background: none; cursor: grab;
  touch-action: none; -webkit-touch-callout: none;
}
.orn svg { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.orn.selected::after { content: ""; position: absolute; inset: -14%; border: 3px dashed var(--gold-hi); border-radius: 50%; pointer-events: none; }
.orn.dragging { cursor: grabbing; z-index: 5; }
.orn:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 4px; border-radius: 50%; }

.panel { padding: 1.4rem; }
.panel h2 { font-size: 1.3rem; margin: 0 0 .7rem; }
.panel h2:not(:first-child) { margin-top: 1.3rem; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .6rem; }
.pal {
  aspect-ratio: 1; min-height: 56px; padding: 7px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .07);
  transition: transform .2s, border-color .2s;
}
.pal svg { width: 100%; height: 100%; display: block; }
.pal:active { transform: scale(.92); }
@media (hover: hover) { .pal:hover { border-color: var(--line-hi); transform: translateY(-2px); } }
.pal:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
.tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.panel .btn { width: 100%; }
.hint-text { margin: .9rem 0 0; color: var(--muted); font-size: 1rem; text-align: center; }

dialog#picture { width: min(560px, calc(100vw - 1.5rem)); padding: 1.2rem; border: 1px solid var(--line-hi); border-radius: 26px; background: rgba(10, 26, 21, .97); color: var(--ink); text-align: center; }
dialog#picture::backdrop { background: rgba(3, 9, 7, .8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#picture-img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 16px; display: block; }
dialog#picture p { color: var(--muted); margin: .8rem 0; }
dialog#picture .actions { justify-content: center; display: flex; gap: .7rem; flex-wrap: wrap; }
