:root {
  --bg: #0e1112;
  --bg-2: #171b1d;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --surface-soft: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text-primary: #f4f1ea;
  --text-secondary: rgba(244, 241, 234, 0.72);
  --text-tertiary: rgba(244, 241, 234, 0.5);
  --text-quaternary: rgba(244, 241, 234, 0.34);
  --accent: #f2b84b;
  --accent-2: #67c6b3;
  --accent-soft: rgba(242, 184, 75, 0.14);
  --success-soft: rgba(103, 198, 179, 0.14);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.22);
  --radius-card: 8px;
  --radius-panel: 10px;
  --radius-pill: 999px;
  --font-ui: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Monaco, monospace;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

body {
  background: #111416;
  color: var(--text-primary);
  font-family: var(--font-ui);
}

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

button {
  border: 0;
  cursor: pointer;
}

.viewer-root {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
}

.viewer-stage {
  width: 100%;
  max-width: 1200px;
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
}

.viewer-device-wrap {
  transform-origin: top center;
  will-change: transform;
}

.app-surface {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #171b1d 0%, #0d1011 100%);
}

.screen-shell {
  height: 100%;
  overflow-y: auto;
  padding: 76px 20px 104px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.screen-shell-flush {
  padding-left: 14px;
  padding-right: 14px;
  gap: 14px;
}

.top-bar {
  min-height: 48px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  background: #020403;
  padding: 5px;
  border: 0.5px solid rgba(242, 184, 75, 0.24);
}

.top-title {
  min-width: 0;
}

.top-title h1 {
  margin: 0;
  font-size: 24px;
  line-height: 27px;
  letter-spacing: 0;
}

.top-title p,
.hero-panel p,
.compact-panel p,
.instruction-copy {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
}

.sync-badge,
.confidence-chip,
.depth-ribbon {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(103, 198, 179, 0.13);
  color: var(--accent-2);
  border: 0.5px solid rgba(103, 198, 179, 0.26);
  font-size: 12px;
  font-weight: 700;
}

.ghost-icon-button {
  padding: 0;
  background: transparent;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  border-radius: var(--radius-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: #17130b;
  box-shadow: 0 16px 32px rgba(242, 184, 75, 0.18);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border: 0.5px solid var(--border);
}

.button-row {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 10px;
}

.button-icon {
  display: inline-flex;
}

.hero-panel,
.compact-panel,
.model-panel,
.capture-sheet {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.hero-panel {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.hero-panel h2,
.compact-panel h2,
.capture-sheet h2 {
  margin: 3px 0 0;
  font-size: 21px;
  line-height: 25px;
}

.hero-metrics,
.model-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.model-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-tile {
  min-height: 68px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.045);
  border: 0.5px solid var(--border);
  padding: 12px;
}

.metric-tile div {
  font-size: 19px;
  line-height: 23px;
  font-weight: 800;
}

.metric-tile span {
  display: block;
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 15px;
}

.metric-good {
  background: var(--success-soft);
  border-color: rgba(103, 198, 179, 0.22);
}

.stack {
  display: grid;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 16px;
  line-height: 20px;
}

.section-title button {
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  padding: 0;
}

.eyebrow {
  display: block;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.045);
  border: 0.5px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.pill-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(242, 184, 75, 0.32);
}

.job-row,
.surface-row,
.settings-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.045);
  border: 0.5px solid var(--border);
  padding: 12px;
}

.settings-logo {
  width: 100%;
  height: 84px;
  object-fit: contain;
  border-radius: var(--radius-card);
  background: #020403;
  padding: 12px;
  border: 0.5px solid rgba(242, 184, 75, 0.22);
}

.job-row-main,
.surface-row {
  text-align: left;
  background: transparent;
  color: inherit;
}

.job-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.job-pin {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-card);
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}

.job-row strong,
.surface-row strong,
.settings-row strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 18px;
  font-style: normal;
}

.job-row em,
.surface-row em,
.settings-row span {
  display: block;
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 16px;
  font-style: normal;
}

.job-row-action {
  min-width: 64px;
  min-height: 44px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.capture-viewport {
  height: 312px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-panel);
  border: 0.5px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(145deg, #384044, #161b1d 55%, #0d1011);
}

.scan-grid {
  position: absolute;
  inset: 0;
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 34px 34px;
}

.house-outline {
  position: absolute;
  left: 48px;
  right: 48px;
  top: 78px;
  height: 154px;
}

.roof-outline {
  height: 70px;
  clip-path: polygon(50% 0, 100% 70%, 0 70%);
  background: rgba(242, 184, 75, 0.2);
  border: 1px solid rgba(242, 184, 75, 0.75);
}

.wall-outline {
  height: 84px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(103, 198, 179, 0.72);
  border-top: 0;
  background: rgba(103, 198, 179, 0.08);
}

.wall-outline span {
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 5px;
  background: rgba(255,255,255,0.08);
}

.corner-marker {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 7px rgba(242, 184, 75, 0.16);
}

.marker-a { left: 42px; top: 210px; }
.marker-b { right: 42px; top: 210px; }
.marker-c { left: calc(50% - 9px); top: 74px; }

.depth-ribbon {
  position: absolute;
  left: 16px;
  top: 16px;
}

.viewport-footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-card);
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.38);
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.viewport-footer span,
.viewport-footer strong {
  font-size: 14px;
}

.capture-sheet {
  padding: 16px;
  display: grid;
  gap: 13px;
}

.sheet-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-heading strong {
  color: var(--accent);
  font-size: 18px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.08);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.evidence-list {
  display: grid;
  gap: 8px;
}

.check-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
}

.check-row span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--accent-2);
}

.check-row p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.check-row-done span {
  background: var(--success-soft);
  border-color: rgba(103, 198, 179, 0.28);
}

.model-panel {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.model-preview {
  height: 170px;
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: linear-gradient(145deg, #263036, #111517);
  border: 0.5px solid var(--border);
}

.mini-house {
  position: absolute;
  left: 72px;
  top: 42px;
  width: 190px;
  height: 110px;
  transform: skewY(-8deg);
}

.mini-roof,
.mini-wall,
.mini-side {
  position: absolute;
  border: 1px solid rgba(255,255,255,0.25);
}

.mini-roof {
  left: 24px;
  top: 0;
  width: 142px;
  height: 58px;
  transform: skewX(-22deg);
  background: #4a4f55;
}

.mini-wall {
  left: 8px;
  top: 54px;
  width: 126px;
  height: 64px;
  background: #63726f;
}

.mini-side {
  left: 134px;
  top: 54px;
  width: 50px;
  height: 64px;
  transform: skewY(-18deg);
  background: #52615f;
}

.confidence-chip {
  position: absolute;
  right: 12px;
  top: 12px;
}

.surface-row {
  width: 100%;
}

.surface-selected {
  border-color: rgba(242, 184, 75, 0.42);
  background: var(--accent-soft);
}

.compact-panel {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.settings-row {
  min-height: 54px;
}

.bottom-tab-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 30;
  height: 74px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 8px 14px;
  border-radius: 18px;
  background: rgba(18, 20, 21, 0.88);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
}

.bottom-tab {
  min-width: 0;
  min-height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  gap: 3px;
  color: var(--text-tertiary);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.bottom-tab-active {
  background: rgba(242, 184, 75, 0.12);
  color: var(--accent);
}
