/* Anvul Spatial wizard — dark mobile-first */
/* Root tokens reconciled to freemcs.css canonical per audit-ui-polish.md §5.
   Picks: --radius 12px, --surface #1e1e1d, --text #f5f0e8, font Inter. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* LIGHT — FreeMCS retired dark mode 2026-06; mirrors css/freemcs.css + /home. */
  --bg: #f1f5f3;
  --bg-elevated: #f7faf9;
  --surface: #ffffff;
  --border: #e3ebe7;
  --text: #0f211b;
  --text-muted: #5d6f67;
  --text-subtle: #8a988f;
  --accent: #10B981;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --accent-strong: #047857;
  --success: #059669;
  --warn: #b9892b;
  --error: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 14px;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 18px 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
}
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
}
header.top h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
}
header.top .step-pill {
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.progress span {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s;
}
.progress span.done { background: var(--accent); }
.progress span.current { background: var(--accent-strong); }
.step {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.step.active { display: flex; }
.step h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}
.step .lead {
  color: var(--text-muted);
  font-size: 13px;
}
label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.field { display: flex; flex-direction: column; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.choice.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 600;
}
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.05s;
  font-family: inherit;
  min-height: 44px;
  min-width: 44px;
}
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-strong); }
.button.ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.nav-row { display: flex; gap: 10px; margin-top: 8px; }
.nav-row .button { flex: 1; }
.room-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.room-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.room-card h3 { font-size: 15px; font-weight: 600; }
.room-card .meta { font-size: 12px; color: var(--text-muted); }
.room-card .badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge.lidar { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.badge.photo { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.badge.manual { background: rgba(155, 149, 138, 0.15); color: var(--text-muted); }
.add-room-btn {
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  font-weight: 500;
}
.add-room-btn:hover { border-color: var(--accent); color: var(--accent); }
.results-hero {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 12px;
}
.results-hero .number {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent-strong);
}
.results-hero .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.confidence-banner {
  background: rgba(74, 222, 128, 0.1);
  border-left: 3px solid var(--success);
  padding: 10px 12px;
  font-size: 12px;
  border-radius: 4px;
  color: var(--success);
}
.confidence-banner.warn { background: rgba(251, 191, 36, 0.1); border-left-color: var(--warn); color: var(--warn); }
.confidence-banner.error { background: rgba(248, 113, 113, 0.1); border-left-color: var(--error); color: var(--error); }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { font-size: 18px; }
.tier-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tier-option {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.tier-option:hover { border-color: var(--accent); }
.tier-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.tier-option .name { font-size: 14px; font-weight: 600; }
.tier-option .desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-empty {
  text-align: center;
  color: var(--text-subtle);
  font-size: 13px;
  padding: 14px;
}
@media (max-width: 360px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Wave 7 cross-cutting tokens — shared across header, toasts, palette,
   keyboard help. Append-only; do not touch any rule above this line. */
:root {
  --toast-bg: rgba(35, 34, 32, 0.95);
  --badge-red: #ef4444;
  --badge-bg: rgba(239, 68, 68, 0.15);
  --shortcut-key-bg: rgba(155, 149, 138, 0.15);
}
@media (max-width: 768px) {
  .mobile-hidden { display: none !important; }
}
