:root {
  color-scheme: dark;
  --bg: #11110f;
  --panel: #191916;
  --panel-raised: #20201c;
  --line: rgba(255, 255, 255, 0.095);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f4f1e9;
  --muted: #8e8d84;
  --accent: #d8ff48;
  --accent-ink: #161911;
  --danger: #f08b76;
  --radius: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 15, .9);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 27px; height: 27px; color: var(--accent); stroke-width: 1.5; }
.brand div { display: grid; gap: 1px; }
.brand strong { font-size: 13px; letter-spacing: .19em; font-weight: 720; }
.brand span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-size: 9px; letter-spacing: .06em; }

.topbar-actions { display: flex; align-items: center; gap: 9px; }
.privacy-note { color: var(--muted); font-size: 11px; margin-right: 8px; display: flex; align-items: center; gap: 7px; }
.privacy-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(216,255,72,.08); }

.button, .icon-button, .tool-button, .tiny-button, .upload-zone, .row-toggle {
  border: 0;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), opacity .18s var(--ease);
}

.button { min-height: 39px; border-radius: 7px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 650; }
.button:active, .icon-button:active, .tool-button:active { transform: scale(.97); }
.button-primary { background: var(--accent); color: var(--accent-ink); padding: 0 18px; }
.button-primary:hover { background: #e2ff78; box-shadow: 0 7px 28px rgba(216,255,72,.14); }
.button-secondary { background: var(--panel-raised); border: 1px solid var(--line); color: #d5d2c8; }
.button-secondary:hover { border-color: var(--line-strong); color: var(--text); }
.button-secondary[aria-pressed="true"] { color: var(--accent); border-color: rgba(216,255,72,.28); background: rgba(216,255,72,.07); }
.button-quiet { background: transparent; border: 1px solid var(--line); color: #c5c2b9; }
.button-quiet:hover { background: var(--panel-raised); color: var(--text); }

.icon-button { width: 35px; height: 35px; border-radius: 7px; background: transparent; display: inline-grid; place-items: center; color: var(--muted); }
.icon-button:hover { background: var(--panel-raised); color: var(--text); }

.workspace {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(292px, 320px);
}

.stage-wrap {
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 18px 18px 13px;
  background: #0d0d0c;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.stage {
  min-height: 0;
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #090a08;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.018) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.018) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.018) 75%);
  background-size: 30px 30px;
  background-position: 0 0, 0 15px, 15px -15px, -15px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 70px rgba(0,0,0,.25);
  isolation: isolate;
}
.stage:focus { outline: none; }

.stage::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 80px rgba(0,0,0,.2);
  z-index: 8;
}

.view-plane {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  transform-origin: center;
  will-change: transform;
  transition: transform .22s var(--ease);
}
.stage.is-panning .view-plane { transition: none; }
.stage.is-view-zoomed { cursor: grab; }
.stage.is-panning { cursor: grabbing; }

#cameraVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #080907;
  opacity: 0;
  transition: opacity .5s var(--ease);
}

#cameraVideo.is-live { opacity: 1; }
#cameraVideo.is-mirrored { transform: scaleX(-1); }

.corrected-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease);
}
.stage.is-corrected #cameraVideo { opacity: 0; }
.stage.is-corrected .corrected-video { opacity: 1; }

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  background: radial-gradient(circle at 50% 45%, rgba(216,255,72,.035), transparent 30%);
  transition: opacity .4s var(--ease), visibility .4s;
  z-index: 2;
}

.camera-placeholder.is-hidden { opacity: 0; visibility: hidden; }
.placeholder-orbit { width: 90px; height: 90px; border: 1px solid rgba(216,255,72,.16); border-radius: 50%; display: grid; place-items: center; margin-bottom: 25px; animation: breathe 3.8s ease-in-out infinite; }
.placeholder-orbit::before { content: ""; width: 56px; height: 56px; border: 1px solid rgba(216,255,72,.28); border-radius: 50%; }
.placeholder-orbit span { position: absolute; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 22px rgba(216,255,72,.65); animation: orbit 5s linear infinite; transform-origin: 0 0; }
.camera-placeholder .eyebrow { color: var(--accent); margin-bottom: 10px; }
.camera-placeholder h1 { margin: 0; font-size: clamp(25px, 3vw, 42px); font-weight: 510; letter-spacing: -.035em; }
.camera-placeholder > p:not(.eyebrow) { max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.6; margin: 11px 0 22px; }
.permission-copy { color: #66665f; font-size: 10px; margin-top: 12px; }

.overlay-layer { position: absolute; inset: 0; z-index: 4; touch-action: none; cursor: grab; }
.overlay-layer.is-dragging { cursor: grabbing; }
.overlay-layer.is-locked { pointer-events: none; cursor: default; }
#overlayImage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 500px;
  max-width: none;
  height: auto;
  transform-origin: center;
  user-select: none;
  will-change: transform, opacity;
  filter: saturate(.98);
  transition: opacity .15s linear;
}

.grid-overlay { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; background: linear-gradient(to right, transparent 33.2%, rgba(216,255,72,.36) 33.33%, transparent 33.46%, transparent 66.52%, rgba(216,255,72,.36) 66.66%, transparent 66.8%), linear-gradient(to bottom, transparent 33.2%, rgba(216,255,72,.36) 33.33%, transparent 33.46%, transparent 66.52%, rgba(216,255,72,.36) 66.66%, transparent 66.8%); transition: opacity .2s; }
.grid-overlay.is-visible { opacity: 1; }
.crosshair { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .2s; }
.crosshair.is-visible { opacity: 1; }
.crosshair i, .crosshair b { position: absolute; display: block; background: rgba(216,255,72,.48); }
.crosshair i { width: 70px; height: 1px; left: calc(50% - 35px); top: 50%; }
.crosshair b { width: 1px; height: 70px; top: calc(50% - 35px); left: 50%; }

.calibration-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  cursor: crosshair;
  touch-action: none;
  background: rgba(3, 4, 3, .08);
}
.calibration-layer:not([hidden]) { display: block; }
.calibration-layer svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.calibration-shape { fill: rgba(216,255,72,.06); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
.calibration-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
.calibration-target-line { stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 2px 5px rgba(0,0,0,.8)); }
.calibration-handle { fill: #11110f; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 2px 5px rgba(0,0,0,.8)); }
.calibration-label { fill: var(--accent); stroke: rgba(8,9,7,.9); stroke-width: 3px; paint-order: stroke; font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; dominant-baseline: central; }
.calibration-magnifier {
  position: absolute;
  z-index: 3;
  width: 140px;
  height: 140px;
  overflow: hidden;
  pointer-events: none;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #080907;
  box-shadow: 0 14px 35px rgba(0,0,0,.55), 0 0 0 4px rgba(8,9,7,.72);
  transform: translateZ(0);
}
.calibration-magnifier:not([hidden]) { display: block; }
.calibration-magnifier canvas { display: block; width: 100%; height: 100%; }
.calibration-magnifier::before, .calibration-magnifier::after { content: ""; position: absolute; z-index: 2; left: 50%; top: 50%; background: var(--accent); transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(8,9,7,.7); }
.calibration-magnifier::before { width: 28px; height: 1px; }
.calibration-magnifier::after { width: 1px; height: 28px; }
.calibration-magnifier span { position: absolute; z-index: 3; right: 12px; bottom: 9px; color: var(--accent); font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace; text-shadow: 0 1px 4px #000; }
.calibration-toolbar {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: min(660px, calc(100% - 28px));
  min-height: 58px;
  padding: 10px 11px 10px 15px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
  background: rgba(14,14,12,.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: default;
}
.calibration-toolbar > div:first-child { display: grid; gap: 3px; }
.calibration-toolbar span { color: var(--accent); font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; }
.calibration-toolbar strong { font-size: 11px; font-weight: 600; white-space: nowrap; }
.calibration-actions { display: flex; align-items: center; gap: 6px; }
.calibration-actions .button { min-height: 34px; padding: 0 11px; font-size: 10px; white-space: nowrap; }
.calibration-actions .button:disabled { opacity: .35; cursor: default; }
.stage.is-calibrating .overlay-layer, .stage.is-calibrating .grid-overlay, .stage.is-calibrating .crosshair { opacity: 0 !important; pointer-events: none; }

.stage-status { position: absolute; left: 13px; bottom: 12px; z-index: 9; display: flex; align-items: center; gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; letter-spacing: .05em; color: rgba(255,255,255,.65); pointer-events: none; }
.stage-status span { background: rgba(10,10,8,.62); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(8px); border-radius: 5px; padding: 5px 7px; }
.stage-status button { pointer-events: auto; min-height: 25px; padding: 0 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 5px; background: rgba(10,10,8,.68); backdrop-filter: blur(8px); color: rgba(255,255,255,.7); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .03em; }
.stage-status button:hover { color: var(--accent); border-color: rgba(216,255,72,.3); }
.stage-status button svg { width: 13px; height: 13px; }
#cameraStatus { display: flex; align-items: center; gap: 6px; }
#cameraStatus i { width: 5px; height: 5px; border-radius: 50%; background: #75756d; }
#cameraStatus.is-live i { background: var(--accent); box-shadow: 0 0 7px rgba(216,255,72,.7); }

.stage-hint { display: flex; gap: 18px; justify-content: center; color: #686861; font-size: 10px; height: 18px; align-items: center; }
kbd { border: 1px solid var(--line-strong); background: var(--panel); color: #aaa89f; border-radius: 4px; padding: 2px 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; box-shadow: 0 1px 0 rgba(255,255,255,.07) inset; }

.inspector {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
  scrollbar-width: thin;
  scrollbar-color: #35352f transparent;
}

.inspector-tabs { display: none; }

.control-section { padding: 24px 21px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.section-heading.compact { margin-bottom: 13px; }
.eyebrow { margin: 0 0 5px; color: #707069; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; letter-spacing: .15em; }
.section-heading h2, .dialog-heading h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; font-weight: 610; }
.source-state { border: 1px solid var(--line); padding: 4px 7px; border-radius: 4px; color: #76766e; font-size: 9px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.source-state.is-live { color: var(--accent); border-color: rgba(216,255,72,.2); background: rgba(216,255,72,.05); }

.camera-picker { display: grid; grid-template-columns: minmax(0, 1fr) 39px; align-items: end; gap: 7px; }
.select-wrap { display: grid; grid-template-columns: 1fr; gap: 7px; position: relative; }
.select-wrap > span { font-size: 10px; color: var(--muted); }
.select-wrap select { width: 100%; appearance: none; background: var(--panel-raised); color: #d5d2c8; border: 1px solid var(--line); border-radius: 7px; height: 39px; padding: 0 34px 0 11px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.select-wrap svg { position: absolute; right: 10px; bottom: 10px; color: var(--muted); pointer-events: none; }
.refresh-camera { width: 39px; height: 39px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-raised); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease); }
.refresh-camera:hover { color: var(--accent); border-color: rgba(216,255,72,.28); background: rgba(216,255,72,.05); }
.refresh-camera.is-refreshing svg { animation: spin .65s linear infinite; }
.camera-hint { min-height: 14px; margin: 7px 0 10px; color: #6f6f68; font-size: 9px; line-height: 1.45; }
.camera-hint.has-phone { color: var(--accent); }
.paired-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.perspective-control { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.perspective-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.perspective-heading span { color: #b6b3ab; font-size: 10px; }
.perspective-heading strong { color: #6f6f68; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .06em; }
.perspective-heading strong.is-active { color: var(--accent); }
.ratio-controls { display: grid; gap: 8px; }
.ratio-preset { margin: 0; }
.custom-ratio { grid-template-columns: 1fr auto 1fr; align-items: end; gap: 7px; }
.custom-ratio:not([hidden]) { display: grid; }
.custom-ratio label { display: grid; gap: 5px; }
.custom-ratio label span { color: var(--muted); font-size: 8px; }
.custom-ratio input { width: 100%; height: 35px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-raised); color: var(--text); padding: 0 9px; font-size: 10px; }
.custom-ratio b { color: var(--muted); font-size: 10px; padding-bottom: 11px; font-weight: 500; }
.perspective-actions { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.button-perspective { flex: 1; background: rgba(216,255,72,.07); border: 1px solid rgba(216,255,72,.2); color: var(--accent); }
.button-perspective:hover { background: rgba(216,255,72,.12); border-color: rgba(216,255,72,.36); }
.perspective-note { margin: 8px 0 0; color: #66665f; font-size: 9px; line-height: 1.45; }
.perspective-offset { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.perspective-offset[hidden] { display: none; }
.perspective-offset-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.perspective-offset-heading > span { color: #aaa89f; font-size: 9px; }
.perspective-offset .tiny-button { color: #8f8e86; }
.perspective-offset .tiny-button:hover { color: var(--accent); }
.perspective-offset > small { color: #66665f; font-size: 8px; line-height: 1.45; }

.tiny-button { padding: 4px 0; background: transparent; color: var(--danger); font-size: 9px; }
.tiny-button:hover { color: #ffac9b; }
.upload-zone { width: 100%; min-height: 82px; padding: 13px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; text-align: left; border: 1px dashed rgba(255,255,255,.16); border-radius: 8px; background: rgba(255,255,255,.015); }
.upload-zone:hover, .upload-zone.is-dragover { border-color: rgba(216,255,72,.44); background: rgba(216,255,72,.035); }
.upload-icon { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: rgba(216,255,72,.08); color: var(--accent); }
.upload-zone > span:last-child { display: grid; gap: 3px; }
.upload-zone strong { font-size: 11px; font-weight: 600; }
.upload-zone small { color: var(--muted); font-size: 9px; }
.artwork-file { min-height: 62px; align-items: center; grid-template-columns: 47px 1fr 32px; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.artwork-file:not([hidden]) { display: grid; }
.artwork-file img { width: 47px; height: 47px; border-radius: 5px; object-fit: cover; background: #0b0b0a; }
.artwork-file div { min-width: 0; display: grid; gap: 4px; }
.artwork-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; }
.artwork-file span { color: var(--muted); font-size: 9px; }

.saved-artworks { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.saved-artworks:not([hidden]) { display: grid; gap: 9px; }
.saved-artworks-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.saved-artworks-heading span { color: #aaa89f; font-size: 9px; }
.saved-artworks-heading small { color: #66665f; font-size: 8px; }
.saved-artworks-list { display: flex; gap: 7px; overflow-x: auto; padding: 1px 1px 5px; scrollbar-width: thin; scrollbar-color: #35352f transparent; }
.saved-artwork { position: relative; flex: 0 0 68px; min-width: 0; }
.saved-artwork-load { width: 68px; padding: 0; display: grid; gap: 5px; border: 0; background: transparent; color: #aaa89f; text-align: left; cursor: pointer; }
.saved-artwork-load img { width: 68px; height: 45px; object-fit: cover; border: 1px solid var(--line); border-radius: 5px; background: #0b0b0a; transition: border-color .18s var(--ease), opacity .18s var(--ease); }
.saved-artwork-load span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.saved-artwork-load:hover img, .saved-artwork.is-active .saved-artwork-load img { border-color: rgba(216,255,72,.45); }
.saved-artwork.is-active .saved-artwork-load span { color: var(--accent); }
.saved-artwork-delete { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: rgba(12,12,10,.82); color: #bbb8af; cursor: pointer; font-size: 12px; line-height: 1; }
.saved-artwork-delete:hover { color: var(--danger); border-color: rgba(240,139,118,.45); }

.opacity-preset-settings { margin-top: 15px; padding: 13px 0 1px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.opacity-preset-settings > span { color: #8f8e86; font-size: 9px; }
.opacity-preset-settings > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opacity-preset-settings label { display: flex; align-items: center; justify-content: space-between; height: 35px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-raised); color: #aaa89f; font-size: 9px; }
.opacity-preset-settings label span { display: flex; align-items: center; color: var(--muted); }
.opacity-preset-settings input { width: 35px; border: 0; outline: 0; background: transparent; color: var(--text); text-align: right; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; appearance: textfield; }
.opacity-preset-settings input::-webkit-inner-spin-button { appearance: none; }

.strobe-settings { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 11px; }
.strobe-heading { display: flex; align-items: center; justify-content: space-between; }
.strobe-heading span { color: #8f8e86; font-size: 9px; }
.strobe-heading strong { color: #6f6f68; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .06em; }
.strobe-heading strong.is-active { color: var(--accent); }
.button-strobe { width: 100%; min-height: 36px; border: 1px solid var(--line); background: var(--panel-raised); color: #c5c2b9; }
.button-strobe:hover { border-color: rgba(216,255,72,.3); color: var(--accent); }
.button-strobe[aria-pressed="true"] { border-color: rgba(216,255,72,.38); background: rgba(216,255,72,.1); color: var(--accent); }
.strobe-settings > p { margin: -2px 0 0; color: #8e655e; font-size: 8px; line-height: 1.45; }
.strobe-timing { margin-top: -7px; color: #6f6f68; font-size: 8px; }

.slider-group { display: grid; gap: 17px; margin-top: 18px; opacity: .38; pointer-events: none; transition: opacity .25s; }
.slider-group.is-enabled { opacity: 1; pointer-events: auto; }
.range-control { display: grid; gap: 9px; }
.range-control > span { display: flex; justify-content: space-between; font-size: 10px; color: #b6b3ab; }
.range-control output { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
input[type="range"] { --value: 22.5%; appearance: none; width: 100%; height: 14px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--accent) var(--value), #393934 var(--value)); border-radius: 99px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -5px; border-radius: 50%; background: var(--text); border: 2px solid var(--panel); box-shadow: 0 0 0 1px #77766e; }
input[type="range"]::-moz-range-track { height: 2px; background: #393934; }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--text); border: 2px solid var(--panel); }

.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 19px; }
.tool-button { height: 49px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-raised); color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; }
.tool-button svg { width: 16px; height: 16px; }
.tool-button span { font-size: 8px; }
.tool-button:hover { border-color: var(--line-strong); color: var(--text); }
.tool-button[aria-pressed="true"] { border-color: rgba(216,255,72,.27); background: rgba(216,255,72,.06); color: var(--accent); }

.view-options { display: grid; }
.view-zoom-control { display: grid; gap: 7px; padding-bottom: 13px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.view-zoom-control > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.view-zoom-control > div > span { color: #696961; font-size: 8px; line-height: 1.4; }
.row-toggle { background: transparent; min-height: 39px; display: flex; justify-content: space-between; align-items: center; padding: 0; color: #aaa89f; }
.row-toggle > span { display: flex; align-items: center; gap: 9px; font-size: 10px; }
.row-toggle svg { width: 15px; height: 15px; color: #6f6f68; }
.row-toggle i { width: 26px; height: 14px; border-radius: 99px; background: #353530; position: relative; transition: background .2s; }
.row-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #88877f; transition: transform .2s var(--ease), background .2s; }
.row-toggle[aria-pressed="true"] i { background: rgba(216,255,72,.28); }
.row-toggle[aria-pressed="true"] i::after { transform: translateX(12px); background: var(--accent); }
.button-capture { width: 100%; margin-top: 15px; background: transparent; border: 1px solid var(--line-strong); color: #c7c4bb; }
.button-capture:hover { background: var(--panel-raised); border-color: rgba(216,255,72,.25); color: var(--accent); }

.focus-controls { display: flex; position: absolute; z-index: 12; left: 50%; bottom: 18px; transform: translateX(-50%); align-items: center; gap: 8px; }
#focusExitButton { display: none; }
.glass { background: rgba(14,14,12,.68); border: 1px solid rgba(255,255,255,.15); backdrop-filter: blur(12px); color: #dedbd2; }
.opacity-jump { min-width: 116px; height: 38px; padding: 0 12px; border-radius: 7px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.opacity-jump:hover { border-color: rgba(216,255,72,.35); color: var(--accent); }
.opacity-jump b { font: 500 17px ui-monospace, SFMono-Regular, Menlo, monospace; }
.opacity-jump span { color: #b6b3ab; font-size: 9px; }
.opacity-jump output { color: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.opacity-jump.is-active { border-color: rgba(216,255,72,.42); background: rgba(216,255,72,.1); color: var(--accent); }

.app-shell.is-focus { display: block; }
.app-shell.is-focus .topbar, .app-shell.is-focus .inspector, .app-shell.is-focus .stage-hint { display: none; }
.app-shell.is-focus .workspace, .app-shell.is-focus .stage-wrap { height: 100vh; display: block; padding: 0; }
.app-shell.is-focus .stage { width: 100%; height: 100%; border: 0; border-radius: 0; }
.app-shell.is-focus .focus-controls { display: flex; animation: rise .35s var(--ease) both; }
.app-shell.is-focus #focusExitButton { display: inline-grid; }
.app-shell.is-focus .stage-status { bottom: 18px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 15px); background: var(--text); color: #171714; padding: 9px 13px; border-radius: 6px; font-size: 10px; font-weight: 650; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes breathe { 50% { transform: scale(1.05); border-color: rgba(216,255,72,.27); } }
@keyframes orbit { from { transform: rotate(0deg) translateX(44px); } to { transform: rotate(360deg) translateX(44px); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-height: 950px) and (min-width: 801px) {
  .app-shell { grid-template-rows: 50px minmax(0, 1fr); }
  .topbar { padding: 0 17px; }
  .stage-wrap { padding: 10px; gap: 6px; }
  .stage-hint { height: 14px; font-size: 9px; }
  .inspector { overflow: hidden; display: grid; grid-template-rows: 42px minmax(0, 1fr); }
  .inspector-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 7px 10px 0; border-bottom: 1px solid var(--line); background: #171714; }
  .inspector-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: #77766e; cursor: pointer; font-size: 9px; }
  .inspector-tabs button:hover { color: #c9c6bd; }
  .inspector-tabs button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
  .control-section { display: none; min-height: 0; overflow-y: auto; border-bottom: 0; }
  .control-section.is-active { display: block; }
  .control-section { padding: 14px 17px; }
  .section-heading { margin-bottom: 11px; }
  .section-heading h2 { font-size: 14px; }
  .camera-hint { margin: 5px 0 7px; }
  .perspective-control { margin-top: 12px; padding-top: 11px; }
  .perspective-heading { margin-bottom: 8px; }
  .upload-zone { min-height: 62px; padding: 10px; }
  .artwork-file { min-height: 52px; padding-bottom: 10px; }
  .opacity-preset-settings, .strobe-settings { margin-top: 10px; padding-top: 9px; gap: 8px; }
  .slider-group { margin-top: 12px; gap: 12px; }
  .range-control { gap: 6px; }
  .tool-grid { margin-top: 12px; }
  .tool-button { height: 43px; }
  .button-capture { margin-top: 10px; }
}

@media (max-width: 800px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; grid-template-rows: 58px auto; }
  .workspace { display: block; }
  .stage-wrap { height: min(70vh, 600px); padding: 10px; }
  .inspector { overflow: visible; border: 0; border-top: 1px solid var(--line); }
  .stage-hint { display: none; }
  .privacy-note { display: none; }
  .button-quiet { width: 35px; padding: 0; font-size: 0; }
  .control-section { padding: 21px; }
}

@media (max-width: 430px) {
  .topbar { padding: 0 13px; }
  .brand span { display: none; }
  .stage-wrap { height: 55vh; }
  .camera-placeholder h1 { font-size: 24px; }
  .camera-placeholder > p:not(.eyebrow) { font-size: 11px; }
  .placeholder-orbit { width: 65px; height: 65px; margin-bottom: 17px; }
  .placeholder-orbit::before { width: 40px; height: 40px; }
  .placeholder-orbit span { animation-name: orbit-mobile; }
  .opacity-jump { min-width: 104px; }
  .calibration-toolbar { top: 8px; align-items: stretch; flex-direction: column; }
  .calibration-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; }
}

@keyframes orbit-mobile { from { transform: rotate(0deg) translateX(32px); } to { transform: rotate(360deg) translateX(32px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
