:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f5f7;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: #f4f5f7;
}

button { font: inherit; }

.mobile-shell {
  width: min(100% - 32px, 520px);
  margin: 0 auto;
  padding: max(36px, env(safe-area-inset-top)) 0 max(32px, env(safe-area-inset-bottom));
}

.kicker {
  margin: 0 0 8px;
  color: #315f9a;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 10vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.lead {
  margin: 14px 0 24px;
  color: #556071;
  font-size: 1rem;
  line-height: 1.55;
}

.device-message {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 4px solid #3b73bb;
  background: #e8f1fc;
  color: #24476f;
  font-size: .92rem;
  line-height: 1.4;
}

.device-warning {
  border-color: #a56816;
  background: #fff3dc;
  color: #664313;
}

.model-list { display: grid; gap: 10px; }

.model-choice {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 12px 16px;
  border: 1px solid #d6dae1;
  border-radius: 10px;
  color: #172033;
  background: #fff;
  text-align: left;
}

.model-choice strong, .model-choice small { display: block; }
.model-choice strong { margin-bottom: 3px; font-size: 1.05rem; }
.model-choice small { color: #657083; }
.model-icon { font-size: 2rem; text-align: center; }

.test-links {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.test-links a, .test-links button, .ar-action {
  min-height: 42px;
  padding: 10px 8px;
  border: 1px solid #b9c7d8;
  border-radius: 7px;
  color: #244f82;
  background: #f7faff;
  font-size: .82rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.test-links button:disabled { cursor: not-allowed; opacity: .45; }

.viewer-shell { position: relative; width: 100vw; height: 100vh; overflow: hidden; background: #e9edf2; }
.viewer-shell canvas, .viewer-shell model-viewer { position: relative; z-index: 1; width: 100%; height: 100%; display: block; }
.camera-feed { position: absolute; z-index: 0; inset: 0; display: none; width: 100%; height: 100%; background: #111; object-fit: cover; }
.viewer-bar { position: fixed; z-index: 10; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 9px; background: rgba(255,255,255,.94); box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.viewer-title { flex: 1; min-width: 0; }
.viewer-bar a { color: #244f82; font-weight: 700; text-decoration: none; }
.viewer-bar strong, .viewer-bar small { display: block; }
.viewer-bar small { margin-top: 2px; color: #657083; }
.viewer-note { position: fixed; z-index: 10; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; margin: 0; padding: 11px; border-radius: 8px; color: #374256; background: rgba(255,255,255,.94); font-size: .86rem; line-height: 1.4; text-align: center; }
.ar-action+button { display: none; }
.camera-action { flex: none; padding: 8px 10px; border: 1px solid #9fb3ca; border-radius: 6px; color: #244f82; background: #f7faff; font-size: .82rem; font-weight: 700; text-decoration: none; }
.camera-action:disabled { opacity: .65; }
.camera-running .viewer-shell { background: #111; }
.camera-running .camera-feed { display: block; }

.help {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #d6dae1;
  color: #374256;
}

.help p { margin: 6px 0 0; color: #657083; font-size: .92rem; line-height: 1.5; }

.test-plan, .comparison {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid #d6dae1;
  border-radius: 10px;
  background: #fff;
}

.test-plan h2, .comparison h2 { margin: 0 0 12px; font-size: 1.25rem; }
.test-plan ol { margin: 0; padding-left: 22px; color: #374256; }
.test-plan li + li { margin-top: 8px; }
.test-tip { margin: 14px 0 0; color: #657083; font-size: .88rem; line-height: 1.5; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; line-height: 1.4; }
th, td { padding: 9px 8px; border-bottom: 1px solid #e1e4e9; text-align: left; vertical-align: top; }
thead th { color: #526071; background: #f7f8fa; font-size: .75rem; text-transform: uppercase; }
tbody th { color: #244f82; white-space: nowrap; }

@media (min-width: 700px) {
  .mobile-shell { padding-top: 64px; }
}
