:root {
  --ink: #16181A; --ink-2: #575A5E; --gold: #B08A4E; --paper: #F6F5F1; --panel: #FFFFFF;
  --line: #E2DFD6; --canvas-bg: #FFFFFF; --bad: #A33A2B;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --canvas-bg: #FFFFFF; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 Manrope, system-ui, sans-serif; color: var(--ink); background: var(--paper); }
#app { display: grid; grid-template: "top top" auto "side stage" 1fr / 340px 1fr; height: 100vh; }
.top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: var(--ink); color: #EDEBE4; }
.brand { font-family: Sora, sans-serif; font-size: 15px; } .brand strong { color: var(--gold); font-weight: 600; margin-right: 6px; }
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 12px; }
.steps li { padding: 4px 10px; border-radius: 999px; background: #26292C; color: #9A9C9F; }
.steps li.on { background: var(--gold); color: var(--ink); font-weight: 600; }
.side { grid-area: side; overflow: auto; padding: 16px; border-right: 1px solid var(--line); background: var(--paper); }
.stage { grid-area: stage; position: relative; min-height: 0; }
#plan { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; background: var(--canvas-bg); }
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); pointer-events: none; }
.loaded .empty { display: none; }
.only-loaded { display: none; } .loaded .only-loaded { display: block; } .loaded .tools.only-loaded { display: flex; }
.drop { display: block; border: 1.5px dashed #C9C4B6; border-radius: 12px; padding: 18px; background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--gold); background: #FBF8F1; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-title { display: block; font-family: Sora, sans-serif; font-weight: 600; font-size: 15px; }
.drop-sub { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }
.status { font-size: 12.5px; color: var(--ink-2); margin: 10px 2px 4px; } .status.bad { color: var(--bad); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.panel h2 { font: 600 13px Sora, sans-serif; margin: 0 0 8px; } .panel h2 small { font: 400 12px Manrope, sans-serif; color: var(--ink-2); }
.stats { margin: 0; display: grid; gap: 8px; } .stats div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.stats dt { color: var(--ink-2); } .stats dd { margin: 0; font-weight: 600; text-align: right; } .stats small { display: block; font-weight: 400; color: var(--ink-2); font-size: 11.5px; }
.legend { display: grid; gap: 4px; }
.lg { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.lg .sw { width: 14px; height: 14px; border-radius: 3px; flex: none; } .lg em { margin-left: auto; font-style: normal; color: var(--ink-2); font-size: 12px; }
.layers-wrap { max-height: 300px; overflow: auto; }
.layers { width: 100%; border-collapse: collapse; font-size: 12px; }
.layers th { text-align: left; color: var(--ink-2); font-weight: 500; position: sticky; top: 0; background: var(--panel); }
.layers td { padding: 3px 4px 3px 0; border-top: 1px solid #F0EEE8; }
.layers td:first-child { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select { font: inherit; font-size: 12px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); max-width: 150px; }
.tools { position: absolute; right: 14px; bottom: 14px; gap: 6px; }
.tools button { font: 600 14px Manrope, sans-serif; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.tools button:hover { border-color: var(--gold); }
@media (max-width: 800px) {
  #app { grid-template: "top" auto "stage" 55vh "side" auto / 100%; height: auto; }
  .side { border-right: 0; border-top: 1px solid var(--line); padding: 16px; }
  .steps { display: none; }
}
