:root {
  color-scheme: dark;
  --bg: #07090c;
  --panel: rgba(18, 22, 28, 0.72);
  --panel-strong: rgba(13, 16, 21, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f7fb;
  --muted: #9da7b4;
  --accent: #62d7ff;
  --accent2: #9ef0ff;
  --snap: #ffe08a;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --safe-b: max(env(safe-area-inset-bottom), 12px);
  --safe-t: max(env(safe-area-inset-top), 12px);
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  background: var(--bg);
  overflow: hidden;
}

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 35%, #141a20 0%, #090c10 44%, #050608 100%);
  isolation: isolate;
  user-select: none;
}

/* Full Screen Canvas */
#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  z-index: 0;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

/* Topbar Header */
.topbar {
  position: absolute;
  top: var(--safe-t);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 1120px);
  height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #bdf7ff, #49c9f5);
  color: #061219;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(98, 215, 255, 0.28);
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-copy small {
  font-size: 11px;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn, .mini-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  transition: background 0.18s ease;
}

.icon-btn:hover, .mini-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(98, 215, 255, 0.12);
  color: #bcefff;
  font-size: 11px;
}

.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.video-watermark {
  position: absolute;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: rgba(7, 11, 16, 0.58);
  color: rgba(235, 244, 250, 0.84);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  pointer-events: none;
}

.video-watermark i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #55f0b4;
  box-shadow: 0 0 0 4px rgba(85, 240, 180, 0.12), 0 0 14px rgba(85, 240, 180, 0.85);
  animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 0.72; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Play/Pause Pulse Feedback Overlay */
.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}

.overlay-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  color: #fff;
  animation: pulseScale 0.4s ease-out forwards;
}

@keyframes pulseScale {
  0% { transform: scale(0.6); opacity: 0; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* Initial Welcome Landing */
.welcome {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 80px 20px;
  z-index: 5;
}

.drop-zone {
  width: min(540px, 92vw);
  min-height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.drop-zone:hover {
  transform: translateY(-3px);
  border-color: rgba(98, 215, 255, 0.45);
}

.drop-icon {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(98, 215, 255, 0.12);
  color: var(--accent);
  margin-bottom: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent2);
}

h1 {
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 10px 0;
}

h2 {
  font-size: 26px;
  letter-spacing: -0.03em;
  margin: 8px 0 16px;
}

.drop-zone p {
  max-width: 380px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 22px;
}

.primary-action {
  padding: 12px 20px;
  border-radius: 999px;
  background: #ffffff;
  color: #071016;
  font-weight: 700;
  font-size: 13px;
}

.drop-zone small {
  margin-top: 12px;
  color: #6f7b88;
}

.drop-hint {
  position: absolute;
  inset: 16px;
  border: 2px dashed rgba(98, 215, 255, 0.6);
  border-radius: 28px;
  background: rgba(4, 14, 19, 0.85);
  display: grid;
  place-items: center;
  z-index: 60;
  backdrop-filter: blur(14px);
}

/* Right-Hand Dock Controls */
.tool-dock {
  position: absolute;
  right: calc(16px + env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  padding: 8px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 18;
}

.dock-sep {
  width: 32px;
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

.tool {
  width: 56px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #a8b2be;
  transition: background 0.18s ease, color 0.18s ease;
}

.tool span {
  font-size: 9px;
  font-weight: 650;
}

.tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tool.active {
  background: rgba(98, 215, 255, 0.16);
  color: #c7f4ff;
  border: 1px solid rgba(98, 215, 255, 0.3);
}

/* Right Side Frame Step & Speed Control Widget */
.jog-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.jog-dial {
  position: relative;
  width: 38px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: #dce4ec;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: none;
  padding: 0;
}

.jog-dial:hover,
.jog-dial:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.jog-dial:active {
  border-color: var(--accent);
}

.jog-indicator {
  display: none;
}

.jog-speed-label {
  font-size: 10px;
  font-weight: 800;
  color: #dce4ec;
  font-variant-numeric: tabular-nums;
}

.jog-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Sheet & Popups */
.sheet {
  position: absolute;
  right: 92px;
  top: 50%;
  transform: translateY(-50%);
  width: min(320px, calc(100vw - 110px));
  max-height: 75vh;
  overflow: auto;
  border-radius: 24px;
  padding: 18px;
  z-index: 25;
}

.sheet-handle {
  display: none;
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 12px;
}

.sheet-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.sheet-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 14px;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sheet-action {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 12px;
  text-align: left;
}

.sheet-action:hover {
  background: rgba(98, 215, 255, 0.12);
  border-color: rgba(98, 215, 255, 0.3);
}

.sheet-action strong {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}

.sheet-action small {
  color: var(--muted);
  font-size: 10px;
}

.sheet-sep {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

/* Toast */
.toast {
  position: absolute;
  right: 18px;
  bottom: 18px;
  max-width: min(340px, calc(100vw - 36px));
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  z-index: 70;
  pointer-events: none;
}

/* Dialog */
.dialog {
  width: min(520px, calc(100vw - 28px));
  border-radius: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  color: var(--text);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.dialog-close {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 20px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.shortcut-grid span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #c3cbd4;
}

kbd {
  padding: 4px 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.app[data-state="ready"] .welcome {
  display: none;
}

[hidden] {
  display: none !important;
}

/* Mobile & Touch Layout Enhancements */
@media (max-width: 760px) {
  .tool-dock {
    top: auto;
    right: 50%;
    bottom: calc(var(--safe-b));
    transform: translateX(50%);
    flex-direction: row;
    width: min(calc(100vw - 24px), 520px);
    justify-content: space-around;
    padding: 6px;
    border-radius: 22px;
  }

  .dock-sep {
    width: 1px;
    height: 30px;
  }

  .jog-widget {
    flex-direction: row;
    gap: 8px;
  }

  .jog-dial {
    width: 44px;
    height: 44px;
  }

  .sheet {
    right: 12px;
    left: 12px;
    top: auto;
    bottom: calc(var(--safe-b) + 80px);
    transform: none;
    width: auto;
    max-height: 50vh;
  }

  .sheet-handle {
    display: block;
  }

  .shortcut-grid {
    grid-template-columns: 1fr;
  }
}
/* ===== Product layer ===== */
:root { --accent:#6ee7ff; --accent2:#8b7cff; --ink:#f7f9fc; --muted2:#a9b2c3; }
body { background:#06080d; }
.app::before { content:""; position:fixed; inset:0; pointer-events:none; background:radial-gradient(circle at 50% 15%, rgba(76,118,255,.11), transparent 38%), radial-gradient(circle at 85% 75%, rgba(69,223,255,.07), transparent 28%); z-index:0; }
#stage { z-index:1; }
.topbar { left:18px; right:18px; top:16px; width:auto; padding:7px 9px 7px 8px; border-radius:18px; background:rgba(13,17,25,.72); border-color:rgba(255,255,255,.1); box-shadow:0 12px 40px rgba(0,0,0,.22); }
.brand { gap:10px; }
.brand-mark { width:34px; height:34px; border-radius:11px; background:linear-gradient(145deg,var(--accent),var(--accent2)); color:#071017; box-shadow:0 0 28px rgba(110,231,255,.2); }
.brand-copy small { color:#8994a8; }
.text-btn { height:34px; padding:0 13px; border:1px solid rgba(255,255,255,.10); border-radius:10px; background:rgba(255,255,255,.055); color:#eef3fa; font:600 12px/1 inherit; cursor:pointer; }
.text-btn:hover { background:rgba(255,255,255,.1); }
.welcome { z-index:5; display:grid; place-items:center; padding:86px 22px 48px; }
.welcome-panel { width:min(1000px,92vw); min-height:540px; display:grid; grid-template-columns:1.08fr .92fr; border-radius:32px; overflow:hidden; background:rgba(12,16,24,.76); border:1px solid rgba(255,255,255,.11); box-shadow:0 30px 100px rgba(0,0,0,.38); }
.welcome-copy { padding:64px 56px; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; }
.welcome-copy h1 { font-size:clamp(46px,6vw,76px); line-height:.94; letter-spacing:-.055em; margin:15px 0 23px; max-width:650px; }
.welcome-copy h1 em { font-style:normal; color:var(--accent); }
.welcome-copy p { max-width:570px; color:#aeb7c7; font-size:16px; line-height:1.65; }
.welcome-actions { display:flex; gap:10px; margin-top:30px; flex-wrap:wrap; }
.welcome-actions button { display:inline-flex; align-items:center; gap:9px; height:48px; padding:0 20px; border-radius:14px; font-weight:750; cursor:pointer; font-size:14px; }
.welcome-actions svg { width:18px; fill:none; stroke:currentColor; stroke-width:1.8; }
.primary-action { border:0; color:#071017; background:linear-gradient(135deg,#89eeff,#77c8ff); box-shadow:0 12px 30px rgba(110,231,255,.17); }
.secondary-action { border:1px solid rgba(255,255,255,.12); color:#f3f6fb; background:rgba(255,255,255,.055); }
.demo-link { margin-top:18px; padding:0; border:0; color:#9ca9bb; background:transparent; cursor:pointer; font:600 12px/1 inherit; }
.demo-link:hover { color:white; }
.privacy-note { margin-top:28px; color:#737f91; font-size:11px; display:flex; gap:7px; align-items:center; }
.privacy-note span { color:#44d6a7; font-size:9px; }
.welcome-visual { position:relative; min-height:540px; background:linear-gradient(145deg,rgba(67,85,119,.17),rgba(4,7,12,.3)); display:grid; place-items:center; overflow:hidden; }
.welcome-visual::before { content:""; position:absolute; inset:0; background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px); background-size:30px 30px; mask-image:linear-gradient(to bottom,transparent 0,#000 18%,#000 82%,transparent); }
.visual-frame { width:78%; height:72%; position:relative; border:1px solid rgba(110,231,255,.18); border-radius:28px; background:radial-gradient(circle at 52% 40%,rgba(110,231,255,.09),transparent 50%),rgba(4,7,12,.35); box-shadow:inset 0 0 80px rgba(110,231,255,.025); }
.silhouette { position:absolute; left:50%; top:45%; width:160px; height:315px; transform:translate(-50%,-50%); filter:drop-shadow(0 0 22px rgba(110,231,255,.15)); }
.silhouette i { position:absolute; display:block; background:linear-gradient(180deg,rgba(222,235,244,.68),rgba(120,143,159,.36)); }
.silhouette .head { width:52px;height:60px;border-radius:50%;left:54px;top:0; }
.silhouette .torso { width:78px;height:130px;border-radius:40% 40% 28% 28%;left:41px;top:63px; }
.silhouette .arm { width:25px;height:130px;border-radius:18px;top:72px;transform-origin:top center; }
.silhouette .a1 { left:34px;transform:rotate(17deg); }.silhouette .a2 { right:34px;transform:rotate(-19deg); }
.silhouette .leg { width:31px;height:145px;border-radius:20px;top:175px;transform-origin:top center; }
.silhouette .l1 { left:48px;transform:rotate(8deg); }.silhouette .l2 { right:48px;transform:rotate(-16deg); }
.measure-preview { position:absolute; color:#8feeff; border-color:#8feeff; font:800 11px/1 ui-monospace,monospace; }
.measure-preview span { position:absolute; padding:6px 8px; border:1px solid rgba(143,238,255,.28); border-radius:8px; background:rgba(4,9,15,.72); }
.measure-preview.knee { width:92px;height:92px;right:14%;bottom:19%;border-left:2px solid;border-top:2px solid;transform:rotate(-25deg); }.measure-preview.knee span{right:-28px;top:-18px;transform:rotate(25deg)}
.measure-preview.hip { width:10px;height:10px;border:2px solid;border-radius:50%;left:42%;top:43%;box-shadow:0 0 0 7px rgba(143,238,255,.08); }.measure-preview.hip span{left:16px;top:-8px}
.scan-line { position:absolute; left:8%; right:8%; height:1px; top:30%; background:linear-gradient(90deg,transparent,#71e6ff,transparent); box-shadow:0 0 14px #71e6ff; animation:scan 4s ease-in-out infinite; opacity:.7; }
@keyframes scan { 0%,100%{top:18%;opacity:.15} 50%{top:78%;opacity:.8} }
.visual-caption { position:absolute; bottom:28px; display:flex; gap:20px; color:#607084; font:700 9px/1 ui-monospace,monospace; letter-spacing:.12em; }
.drop-zone { position:absolute; bottom:19px; width:auto; min-height:0; padding:0; background:none; border:0; color:#5f6b7c; }
.drop-zone:hover { background:none; transform:none; color:#93a1b5; }
.workspace-badge { position:fixed; top:78px; left:50%; transform:translateX(-50%); z-index:8; padding:7px 10px; border-radius:12px; display:flex; gap:8px; align-items:center; background:rgba(8,12,18,.65); font-size:10px; }
.workspace-badge span { color:#6d7a8c; letter-spacing:.12em; font-weight:800; }.workspace-badge b { color:#dce7f2; font-size:11px; }
.tool-dock { right:18px; left:auto; top:50%; transform:translateY(-50%); padding:9px 7px; border-radius:20px; background:rgba(11,15,22,.72); max-height:calc(100vh - 132px); overflow:auto; scrollbar-width:none; }
.tool-dock::-webkit-scrollbar{display:none}.dock-group-label { color:#536072; font-size:7px; font-weight:900; letter-spacing:.13em; text-align:center; margin:2px 0 -1px; }
.tool { width:48px;height:48px;border-radius:13px; }.tool span { font-size:8px; }.tool.active { background:rgba(110,231,255,.12); color:#88eaff; box-shadow:inset 0 0 0 1px rgba(110,231,255,.23); }
.sheet { right:84px; bottom:22px; }
.quick-hint { position:fixed; left:20px; bottom:20px; z-index:9; padding:10px 12px; border-radius:13px; display:flex; align-items:center; gap:8px; color:#8f9bad; font-size:11px; background:rgba(9,13,19,.72); }
.quick-hint b { color:#79e6fa; }.quick-hint button { border:0;background:transparent;color:#6c7888;cursor:pointer;font-size:17px;line-height:1; }
.status-pill { color:#70e7be; background:rgba(56,220,167,.08); border-color:rgba(56,220,167,.18); }.status-pill i { background:#49dcac; box-shadow:0 0 10px #49dcac; }
.toast { right:18px; bottom:18px; left:auto; top:auto; transform:none; }

@media (max-width:760px) {
  .topbar { left:10px; right:10px; top:10px; }
  .brand-copy small { display:none; }
  .top-actions .text-btn { display:none; }
  .welcome { padding:72px 12px 42px; align-items:start; }
  .welcome-panel { grid-template-columns:1fr; min-height:auto; border-radius:24px; }
  .welcome-copy { padding:42px 28px 28px; }
  .welcome-copy h1 { font-size:50px; }
  .welcome-copy p { font-size:14px; }
  .welcome-visual { min-height:280px; }
  .visual-frame { height:230px; width:72%; }.silhouette { transform:translate(-50%,-50%) scale(.7); }
  .visual-caption { bottom:13px; gap:10px; }
  .tool-dock { right:8px; top:auto; bottom:10px; transform:none; flex-direction:row; max-width:calc(100vw - 16px); max-height:none; overflow-x:auto; padding:7px; }
  .dock-group-label,.dock-sep,.jog-widget { display:none; }
  .tool { min-width:45px; width:45px; height:45px; }
  .sheet { right:10px; left:10px; bottom:70px; width:auto; }
  .workspace-badge { top:65px; }
  .video-watermark { right:10px; bottom:74px; }
  .quick-hint { display:none!important; }
}

/* Compact CAD-style flyouts */
.sheet {
  right: 78px !important;
  top: 50% !important;
  bottom: auto !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  padding: 6px !important;
  border-radius: 14px !important;
  transform: translateY(-50%) !important;
  overflow: visible !important;
  background: rgba(9,13,19,.88) !important;
}
.cad-flyout { display:flex; flex-direction:column; gap:4px; }
.flyout-tool {
  width:40px; height:40px; display:grid; place-items:center; border:0;
  border-radius:9px; background:transparent; color:#dbe5ef; cursor:pointer;
}
.flyout-tool:hover { background:rgba(110,231,255,.11); color:#8eeaff; }
.flyout-tool svg { width:20px;height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.calib-inline { display:flex; align-items:center; gap:6px; padding:2px; white-space:nowrap; }
.calib-inline > span { color:#8c99aa; font-size:10px; font-weight:700; padding-left:4px; }
.calib-inline input { width:64px; height:34px; border:1px solid var(--line); background:#070b10; color:#fff; border-radius:8px; padding:0 8px; outline:none; }
.calib-inline select { height:34px; border:1px solid var(--line); background:#070b10; color:#fff; border-radius:8px; padding:0 6px; outline:none; }
.calib-inline button { width:34px;height:34px;border:0;border-radius:8px;background:rgba(255,255,255,.06);color:#dce7f2;cursor:pointer;font-size:16px; }
.calib-inline button[type="submit"] { color:#72efc3; }
.calib-inline button:hover { background:rgba(110,231,255,.12); }

.calibration-panel {
  position: absolute;
  z-index: 75;
  padding: 6px;
  border-radius: 10px;
  background: rgba(9,13,19,.92);
}

@media (max-width:760px) {
  .sheet { right:10px !important; left:auto !important; top:auto !important; bottom:64px !important; transform:none !important; }
  .cad-flyout { flex-direction:row; }
  .calib-inline { max-width:calc(100vw - 24px); }
  .toast { right:10px; bottom:74px; max-width:calc(100vw - 20px); }
}

/* Final product pass: minimal PoseIQ CAD launcher */
.topbar {
  transform: none;
  height: 48px;
  border-radius: 12px;
  padding: 6px 8px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.brand-copy {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.brand-copy strong {
  font-size: 13px;
  letter-spacing: 0;
  line-height: 1.05;
}

.brand-copy small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.icon-btn,
.mini-btn {
  border-radius: 8px;
}

.welcome {
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 88px 18px 40px;
  overflow: hidden;
}

.demo-video-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.34;
  pointer-events: none;
}

.demo-video-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(7, 9, 12, 0.08), rgba(7, 9, 12, 0.56) 58%, rgba(7, 9, 12, 0.92) 100%),
    linear-gradient(90deg, rgba(7, 9, 12, 0.82), rgba(7, 9, 12, 0.32), rgba(7, 9, 12, 0.82));
}

.demo-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.08);
}

.launcher {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.launcher-command {
  min-height: 190px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(10,14,20,.58);
  color: #eef5fb;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 16px 50px rgba(0,0,0,.22);
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}

.launcher-command:hover,
.launcher-command:focus-visible {
  border-color: rgba(110,231,255,.62);
  background: rgba(15,23,31,.78);
  color: #8eeaff;
  outline: none;
}

.launcher-command svg {
  width: 34px;
  height: 34px;
}

.launcher-command span {
  font-size: 15px;
  font-weight: 760;
}

.launcher-command small {
  margin: -6px 0 0;
  color: #7d8998;
  font-size: 11px;
  font-weight: 650;
}

.drop-zone {
  z-index: 1;
  position: relative !important;
  width: auto !important;
  min-height: 0 !important;
  padding: 6px 10px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #657286;
}

.drop-zone:hover,
.drop-zone:focus-visible {
  transform: none !important;
  color: #9fb0c2;
  outline: 1px solid rgba(110,231,255,.28);
}

.drop-hint div {
  display: grid;
  gap: 6px;
  text-align: center;
}

.drop-hint span {
  color: #94a3b5;
  font-size: 12px;
}

.help-links {
  margin: 18px 0 0;
}

.help-links a {
  color: #8eeaff;
  text-decoration: none;
}

.help-links a:hover {
  text-decoration: underline;
}

canvas {
  cursor: crosshair;
}

.app:not([data-state="ready"]) canvas {
  cursor: default;
}

@media (max-width:760px) {
  .launcher {
    grid-template-columns: 1fr;
    width: min(360px, calc(100vw - 28px));
  }

  .launcher-command {
    min-height: 142px;
  }

  .top-actions {
    gap: 2px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }
}

/* Requested final light dock and phone/tablet safe-area fit */
.tool-dock {
  background: rgba(11, 15, 22, 0.35) !important;
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 1024px) {
  .tool-dock {
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Mobile bottom dock safe-area lift */
@media (max-width: 760px) {
  .bottom-dock,
  .tool-dock,
  .controller-bar {
    position: fixed;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) !important;
    z-index: 9999;
    max-width: calc(100vw - 24px);
    padding: 8px 12px;
    background: rgba(11, 15, 22, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .bottom-dock,
  .tool-dock,
  .controller-bar {
    width: 92%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }
}
