/* SVG load: full-screen WebGL view plus one control panel, chrome from the --lab-* tokens. */
html, body { overflow: hidden; }
body { background: radial-gradient(circle at 50% 40%, #2c2a5a, var(--lab-bg0) 70%); }

#svg-canvas { position: fixed; inset: 0; display: block; width: 100vw; height: 100vh; touch-action: none; cursor: grab; }
#svg-canvas:active { cursor: grabbing; }

#svg-bar {
  position: fixed; z-index: 20; top: 8px; left: 8px; width: 290px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 10px;
  font: var(--lab-font-size)/1.3 var(--lab-font); user-select: none;
}
#svg-bar h1 { margin: 0; color: var(--lab-ink); font-size: 14px; font-weight: 800; }
.svg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.svg-row > label { display: inline-flex; align-items: center; gap: 6px; }
#svg-bar .lab-button { padding: 0 10px; }
#svg-bar [aria-pressed="true"] { background: var(--lab-accent); border-color: var(--lab-accent); color: var(--lab-accent-ink); }
.svg-slider { display: grid; grid-template-columns: 44px 1fr 3em; align-items: center; gap: 8px; }
.svg-slider input { width: 100%; }
#svg-depth-val { color: var(--lab-ink); font-family: var(--lab-mono); text-align: right; }
#svg-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.svg-open { cursor: pointer; color: var(--lab-accent-ink); }
#svg-bar input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--lab-border); border-radius: var(--lab-radius-sm); background: none; cursor: pointer; }
#svg-file:focus-visible + .svg-open { outline: 2px solid var(--lab-focus, var(--lab-accent)); outline-offset: 2px; }
#svg-info { color: var(--lab-dim); font-family: var(--lab-mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#svg-status {
  position: fixed; z-index: 25; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 10px 16px; border-radius: var(--lab-radius-sm); background: var(--lab-overlay);
  color: var(--lab-ink); font: var(--lab-font-size)/1.3 var(--lab-font); pointer-events: none;
}
#svg-status[hidden] { display: none; }
#svg-status.is-error { color: var(--lab-red); top: auto; bottom: 64px; transform: translateX(-50%); }

/* Drop target outline while a file is dragged over the page */
body::after {
  content: "Drop an SVG file"; position: fixed; inset: 12px; z-index: 40; display: grid; place-items: center;
  border: 3px dashed var(--lab-accent); border-radius: var(--lab-radius, 12px); background: rgba(29, 27, 58, .6);
  color: var(--lab-ink); font: 800 22px var(--lab-font); opacity: 0; pointer-events: none; transition: opacity .15s;
}
body.svg-dropping::after { opacity: 1; }

@media (max-width: 600px) {
  #svg-bar { top: auto; bottom: calc(48px + env(safe-area-inset-bottom)); left: 8px; right: 8px; width: auto; gap: 8px; }
  #svg-bar h1, .svg-hide-small { display: none; }
  #svg-hint { top: calc(16px + env(safe-area-inset-top)); bottom: auto; }
  #svg-status.is-error { bottom: auto; top: 64px; }
}
