/* ============================================
   PSYCHOLOGY LAB SHARED DESIGN SYSTEM
   Circuit Psychology Lab · pure CSS layer
   ============================================ */

:root {
  --lab-bg: #060b12;
  --lab-bg-2: #08111d;
  --lab-card: rgba(12, 21, 32, 0.86);
  --lab-card-solid: #0c1520;
  --lab-card-hover: #111d2c;
  --lab-cyan: #00e5ff;
  --lab-cyan-soft: rgba(0, 229, 255, 0.12);
  --lab-cyan-line: rgba(0, 229, 255, 0.28);
  --lab-amber: #f5a623;
  --lab-amber-soft: rgba(245, 166, 35, 0.13);
  --lab-violet: #a78bfa;
  --lab-green: #4ade80;
  --lab-red: #fb7185;
  --lab-white: #f0f4f8;
  --lab-muted: rgba(240, 244, 248, 0.58);
  --lab-faint: rgba(240, 244, 248, 0.42);
  --lab-border: rgba(240, 244, 248, 0.08);
  --lab-border-strong: rgba(240, 244, 248, 0.16);
  --lab-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --lab-glow: 0 0 32px rgba(0, 229, 255, 0.12);
  --lab-font: 'Segoe UI', 'Microsoft YaHei UI', system-ui, -apple-system, sans-serif;
  --lab-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  /* Shorthand aliases for test pages */
  --bg: #060b12;
  --card: #0c1520;
  --card-hover: #111d2c;
  --cyan: #00e5ff;
  --amber: #f5a623;
  --white: #f0f4f8;
  --dim: rgba(240,244,248,0.5);
  --border: rgba(240,244,248,0.06);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Cascadia Code', 'Fira Code', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 229, 255, 0.08), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(245, 166, 35, 0.06), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(167, 139, 250, 0.055), transparent 35%),
    var(--lab-bg) !important;
  color: var(--lab-white);
  font-family: var(--lab-font);
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(240,244,248,0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(240,244,248,0.055) 1px, transparent 1px) !important;
  background-size: 60px 60px !important;
  mask-image: radial-gradient(ellipse at 50% 28%, black 18%, transparent 68%);
}
body.lab-ready::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(2px 2px at 15% 24%, rgba(0,229,255,.8), transparent),
    radial-gradient(1px 1px at 72% 16%, rgba(245,166,35,.72), transparent),
    radial-gradient(1px 1px at 32% 78%, rgba(0,229,255,.55), transparent),
    radial-gradient(2px 2px at 84% 70%, rgba(167,139,250,.55), transparent),
    linear-gradient(180deg, transparent, rgba(6,11,18,.42));
  opacity: .68;
  animation: labNodePulse 5s ease-in-out infinite alternate;
}
@keyframes labNodePulse { from { opacity: .38; } to { opacity: .78; } }

.app, .lab-app {
  position: relative;
  z-index: 1;
}

/* Shared typography */
.label, .header-label, .section-label, .summary-title, .insight-title, .growth-title,
.pro-section-header, .tier-name, .q-trait, .q-category, .q-num, .q-scenario,
.results-header .label, .title-block .label {
  font-family: var(--lab-mono) !important;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.title-block h1, .header h1, .results-header h2 {
  text-wrap: balance;
}
.subtitle, .card-desc, .trait-desc, .style-desc, .dim-desc, .bias-desc,
.insight-content, .growth-content, .primary-desc, .summary-text, .mode-desc {
  text-wrap: pretty;
}

/* Focus and accessibility */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, .card:focus-visible, .mode-card:focus-visible,
.value-chip:focus-visible, .rank-card:focus-visible {
  outline: 2px solid var(--lab-cyan) !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 6px rgba(0,229,255,0.08) !important;
}
button, .btn, .choice-btn, .scale-btn, .opt-btn, .mode-card, .value-chip, .rank-card {
  min-height: 44px;
}

/* Buttons */
.btn, .btn-back, .lab-home-link {
  border-radius: 999px !important;
  font-family: var(--lab-mono) !important;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.btn::before, .btn-back::before, .lab-home-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translateX(-120%);
  transition: transform .55s ease;
  z-index: -1;
}
.btn:hover::before, .btn-back:hover::before, .lab-home-link:hover::before { transform: translateX(120%); }
.btn.primary {
  box-shadow: 0 0 0 1px rgba(0,229,255,.22), 0 14px 38px rgba(0,229,255,.09) !important;
}
.btn:hover, .btn-back:hover, .lab-home-link:hover {
  transform: translateY(-1px);
}

/* Cards and screens */
.screen.active { animation: labFadeUp .42s ease both !important; }
@keyframes labFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.q-card, .summary-card, .primary-card, .score-card, .trait-card, .style-card,
.dim-card, .bias-card, .insight-card, .insight-block, .growth-card,
.combo-card, .pro-section, .trigger-map, .stage-card, .strategy-card,
.facet-item, .tier-zone, .rank-card, .mode-card, .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent 58%), var(--lab-card) !important;
  border-color: var(--lab-border) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.035) inset;
  backdrop-filter: blur(10px);
}
.q-card, .summary-card, .primary-card, .score-card, .growth-card, .pro-section {
  box-shadow: var(--lab-shadow);
}
.q-card::after, .primary-card::after, .score-card::after, .summary-card::after,
.pro-section::after, .card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,.22), transparent);
  opacity: .8;
  pointer-events: none;
}
.q-card, .primary-card, .score-card, .summary-card, .pro-section, .card { position: relative; overflow: hidden; }

/* Home page */
.lab-home {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px 42px;
}
.lab-hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 44px;
}
.lab-hero-panel {
  border: 1px solid var(--lab-border);
  border-radius: 28px;
  padding: 48px;
  background: linear-gradient(135deg, rgba(0,229,255,.065), transparent 42%), rgba(12,21,32,.62);
  box-shadow: var(--lab-shadow), var(--lab-glow);
  position: relative;
  overflow: hidden;
}
.lab-hero-panel::before {
  content: 'PERSONAL\\PSYCHOLOGY\\LAB';
  position: absolute;
  right: -24px;
  top: 24px;
  font-family: var(--lab-mono);
  font-size: 10px;
  letter-spacing: 5px;
  color: rgba(240,244,248,.12);
  transform: rotate(90deg);
  transform-origin: right top;
}
.lab-kicker, .lab-micro {
  font-family: var(--lab-mono);
  color: var(--lab-amber);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 11px;
}
.lab-title {
  margin: 18px 0 14px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .96;
  font-weight: 200;
  letter-spacing: 2px;
}
.lab-title span { color: var(--lab-cyan); font-weight: 420; }
.lab-lead {
  max-width: 640px;
  color: var(--lab-muted);
  font-size: 17px;
  line-height: 1.8;
  font-weight: 300;
}
.lab-status-row, .lab-route-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.lab-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--lab-border-strong);
  color: var(--lab-muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--lab-mono);
  font-size: 11px;
  text-decoration: none;
  background: rgba(255,255,255,.018);
}
.lab-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lab-cyan);
  box-shadow: 0 0 14px rgba(0,229,255,.55);
}
.lab-orbit {
  aspect-ratio: 1;
  min-height: 260px;
  border: 1px solid var(--lab-border);
  border-radius: 28px;
  position: relative;
  background: radial-gradient(circle at center, rgba(0,229,255,.08), transparent 52%), rgba(12,21,32,.42);
  overflow: hidden;
}
.lab-orbit::before, .lab-orbit::after {
  content: '';
  position: absolute;
  inset: 42px;
  border: 1px solid rgba(0,229,255,.14);
  border-radius: 50%;
}
.lab-orbit::after {
  inset: 88px;
  border-color: rgba(245,166,35,.16);
}
.lab-orbit-core {
  position: absolute;
  inset: 50%;
  width: 88px;
  height: 88px;
  margin: -44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--lab-cyan);
  font-family: var(--lab-mono);
  border: 1px solid var(--lab-cyan-line);
  background: rgba(0,229,255,.06);
  box-shadow: 0 0 38px rgba(0,229,255,.14);
}
.lab-node {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--lab-border-strong);
  background: var(--lab-card);
  font-size: 20px;
}
.lab-node:nth-child(2) { left: 18%; top: 18%; }
.lab-node:nth-child(3) { right: 16%; top: 22%; }
.lab-node:nth-child(4) { left: 12%; bottom: 24%; }
.lab-node:nth-child(5) { right: 18%; bottom: 18%; }
.lab-node:nth-child(6) { left: 45%; top: 8%; }
.lab-node:nth-child(7) { left: 46%; bottom: 8%; }

.lab-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 36px 0 16px;
}
.lab-section-head h2 {
  font-weight: 300;
  font-size: 24px;
  letter-spacing: 1px;
}
.lab-section-head p { color: var(--lab-muted); font-size: 13px; }
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.lab-test-card {
  display: flex;
  flex-direction: column;
  min-height: 284px;
  text-decoration: none;
  color: var(--lab-white);
  border: 1px solid var(--lab-border);
  border-radius: 22px;
  padding: 24px;
  background: var(--lab-card);
  position: relative;
  overflow: hidden;
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}
.lab-test-card:hover {
  transform: translateY(-4px);
  border-color: var(--lab-cyan-line) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,.34), 0 0 34px rgba(0,229,255,.08);
}
.lab-test-card .lab-exp {
  font-family: var(--lab-mono);
  color: var(--lab-amber);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.lab-test-card .lab-icon { font-size: 34px; margin: 18px 0 12px; }
.lab-test-card h3 { font-size: 21px; font-weight: 360; letter-spacing: 1px; margin-bottom: 8px; }
.lab-test-card .lab-meta { color: var(--lab-cyan); font-family: var(--lab-mono); font-size: 10px; margin-bottom: 12px; line-height: 1.6; }
.lab-test-card p { color: var(--lab-muted); font-size: 13px; line-height: 1.65; font-weight: 300; }
.lab-test-card .lab-result { margin-top: auto; padding-top: 18px; color: var(--lab-faint); font-size: 12px; line-height: 1.5; }
.lab-test-card .lab-result strong { color: var(--lab-white); font-weight: 400; }

/* Progress */
.progress-wrap {
  border: 1px solid rgba(240,244,248,.055);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(12,21,32,.42);
}
.progress-info::before {
  content: 'LAB PROGRESS';
  color: var(--lab-amber);
  margin-right: auto;
}
.progress-info { gap: 14px; align-items: center; }
.progress-track { height: 4px !important; background: rgba(240,244,248,.07) !important; }
.progress-fill { background: linear-gradient(90deg, var(--lab-cyan), rgba(167,139,250,.86)) !important; box-shadow: 0 0 18px rgba(0,229,255,.28); }

/* Results */
.results-header { margin-top: 10px; }
.primary-card, .score-card, .summary-card {
  border-left: 2px solid var(--lab-cyan) !important;
}
.primary-score, .score-big, .score-number, .style-score, .trait-score, .dim-score {
  font-family: var(--lab-mono) !important;
  text-shadow: 0 0 24px rgba(0,229,255,.16);
}
.lab-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}
.primary-card .primary-name::after, .score-card .score-label::after, .summary-card .summary-title::after {
  content: ' · REPORT SUMMARY';
  color: var(--lab-faint);
  font-family: var(--lab-mono);
  font-size: 9px;
  letter-spacing: 2px;
}
.lab-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0,229,255,.18);
  color: var(--lab-cyan);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--lab-mono);
  font-size: 10px;
  letter-spacing: 1px;
  background: rgba(0,229,255,.045);
}
.lab-next-card {
  width: 100%;
  border: 1px solid rgba(245,166,35,.16);
  border-radius: 18px;
  padding: 20px 22px;
  margin: 20px 0;
  background: linear-gradient(135deg, rgba(245,166,35,.08), rgba(0,229,255,.035));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lab-next-card div:first-child { color: var(--lab-muted); font-size: 13px; line-height: 1.6; }
.lab-next-card strong { color: var(--lab-white); font-weight: 430; display: block; font-size: 15px; }
.lab-next-card a { white-space: nowrap; }
.lab-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lab-muted) !important;
  border: 1px solid var(--lab-border-strong) !important;
  padding: 8px 16px !important;
  text-decoration: none !important;
  transition: all .25s ease;
  background: rgba(255,255,255,.018);
}
.lab-home-link:hover { color: var(--lab-cyan) !important; border-color: var(--lab-cyan-line) !important; }

/* Toast */
.toast, .lab-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 999;
  border: 1px solid var(--lab-cyan-line) !important;
  border-radius: 999px !important;
  background: rgba(12,21,32,.94) !important;
  color: var(--lab-white) !important;
  padding: 12px 22px !important;
  font-family: var(--lab-mono) !important;
  font-size: 12px !important;
  box-shadow: var(--lab-shadow), 0 0 28px rgba(0,229,255,.12);
  animation: labToastIn .22s ease both, labToastOut .25s ease 2.15s forwards;
  pointer-events: none;
}
@keyframes labToastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes labToastOut { to { opacity: 0; transform: translateX(-50%) translateY(-8px); } }

/* ── Shared Test Page Components ── */
.screen { display: none; flex-direction: column; align-items: center; }
.screen.active { display: flex; animation: labTestFadeIn .4s ease both; }
@keyframes labTestFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 32px; border: 1px solid rgba(240,244,248,0.15);
  border-radius: 999px; background: transparent; color: var(--white);
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px;
  cursor: pointer; transition: all .28s ease; text-decoration: none;
  position: relative; isolation: isolate; overflow: hidden;
}
.btn:hover { border-color: var(--cyan); background: rgba(0,229,255,0.05); transform: translateY(-1px); }
.btn.primary { background: rgba(0,229,255,0.08); border-color: var(--cyan); }
.btn.primary:hover { background: rgba(0,229,255,0.15); box-shadow: 0 0 28px rgba(0,229,255,0.12); }
.btn:disabled { opacity: 0.25; pointer-events: none; }
.btn.back { background: transparent; border: 1px solid rgba(240,244,248,0.15); color: var(--dim); font-size: 12px; padding: 8px 20px; }
.btn.back:hover { border-color: var(--cyan); color: var(--white); }
.btn.secondary { background: transparent; border: 1px solid rgba(240,244,248,0.2); color: var(--white); }
.btn.secondary:hover { border-color: var(--cyan); }

.welcome-icon {
  width: 72px; height: 72px; border: 2px solid var(--cyan); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px; font-size: 32px; line-height: 1; flex-shrink: 0;
}
.title-block { text-align: center; margin-bottom: 12px; }
.title-block .label { color: var(--amber); margin-bottom: 12px; }
.title-block h1 { font-size: 38px; font-weight: 200; letter-spacing: 2px; }
.title-block h1 span { color: var(--cyan); font-weight: 400; }
.subtitle { color: var(--dim); font-size: 15px; font-weight: 300; text-align: center; max-width: 460px; line-height: 1.6; margin-bottom: 20px; }
.info-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(240,244,248,0.1); border-radius: 20px;
  padding: 6px 18px; font-family: var(--mono); font-size: 10px; color: var(--dim); margin-bottom: 32px;
}
.info-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }

.progress-wrap { width: 100%; margin-bottom: 24px; }
.progress-info { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--dim); margin-bottom: 8px; }
.progress-track { width: 100%; height: 2px; background: rgba(240,244,248,0.06); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--cyan); border-radius: 2px; transition: width .3s ease; width: 0%; }

/* App container for test pages */
.app { position: relative; z-index: 1; max-width: 720px; min-height: 100vh; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; justify-content: center; }

.q-card {
  width: 100%; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; transition: all .3s ease;
}
.q-text { font-size: 17px; font-weight: 300; line-height: 1.7; margin-bottom: 24px; }
.q-trait, .q-num, .q-scenario {
  font-family: var(--mono); font-size: 10px; letter-spacing: 3px;
  color: var(--amber); margin-bottom: 14px; text-transform: uppercase;
}

.results-header { text-align: center; margin-bottom: 28px; }
.results-header .label { color: var(--amber); margin-bottom: 6px; }
.results-header h2 { font-size: 28px; font-weight: 200; letter-spacing: 2px; }
.results-header h2 span { color: var(--cyan); font-weight: 400; }
.section-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 3px;
  color: var(--amber); margin: 28px 0 12px; text-transform: uppercase;
}

.action-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; margin-bottom: 8px; }
.footer-note { font-family: var(--mono); font-size: 9px; color: var(--dim); opacity: 0.4; text-align: center; margin-top: 8px; }

.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--cyan); color: var(--cyan);
  padding: 10px 20px; border-radius: 999px; font-family: var(--mono);
  font-size: 12px; z-index: 100; pointer-events: none;
  animation: toastIn .3s ease, toastOut .3s ease 2s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(-8px); } }

/* Screen alignment overrides */
#quiz { align-items: stretch; }
#results { align-items: stretch; }
#modeSelect { align-items: stretch;

}
/* ============================================
   HOMEPAGE: ROUTE PANEL & FOOTER
   ============================================ */
body { min-height: 100vh; }
.route-panel {
  margin-bottom: 30px;
  border: 1px solid var(--lab-border);
  border-radius: 22px;
  padding: 22px;
  background: rgba(12,21,32,.52);
}
.route-title {
  font-family: var(--lab-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--lab-amber);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.route-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.route-card {
  border: 1px solid var(--lab-border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255,255,255,.018);
  transition: all 0.3s ease;
  cursor: default;
}
.route-card strong { display: block; font-size: 15px; font-weight: 420; margin-bottom: 6px; }
.route-card span { color: var(--lab-muted); font-size: 12px; line-height: 1.6; }
.route-card:hover {
  transform: translateY(-4px);
  border-color: var(--lab-cyan-line) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,.34), 0 0 34px rgba(0,229,255,.08);
}
.footer {
  text-align: center;
  margin-top: 48px;
  font-family: var(--lab-mono);
  font-size: 10px;
  color: var(--lab-muted);
  letter-spacing: 1px;
  opacity: .58;
}

/* ============================================
   SHARED: MODE SELECTION
   ============================================ */
.mode-header { text-align: center; margin-bottom: 32px; }
.mode-header .label { font-family: var(--mono); font-size: 10px; letter-spacing: 4px; color: var(--amber); margin-bottom: 8px; }
.mode-header h2 { font-size: 26px; font-weight: 200; margin-bottom: 6px; color: var(--white); }
.mode-header h2 span { color: var(--cyan); font-weight: 400; }
.mode-header p { color: var(--dim); font-size: 13px; margin-top: 8px; font-weight: 300; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.mode-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 32px 24px; cursor: pointer; transition: all 0.3s; text-decoration: none; color: var(--white); }
.mode-card:hover { border-color: rgba(0,229,255,0.2); background: var(--card-hover); transform: translateY(-2px); }
.mode-card.pro:hover { border-color: rgba(245,166,35,0.3); }
.mode-card-header { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; text-align: left; }
.mode-card-title { flex: 1; text-align: left; }
.mode-icon { font-size: 36px; flex-shrink: 0; }
.mode-name { font-size: 18px; font-weight: 400; letter-spacing: 1px; margin-bottom: 4px; }
.mode-stats { font-family: var(--mono); font-size: 10px; color: var(--dim); margin-bottom: 10px; }
.mode-desc { font-size: 12px; color: var(--dim); line-height: 1.5; font-weight: 300; }
.mode-badge { display: inline-block; font-family: var(--mono); font-size: 9px; letter-spacing: 2px; padding: 3px 10px; border-radius: 10px; margin-top: 10px; }
.mode-badge.light { color: var(--cyan); border: 1px solid rgba(0,229,255,0.3); }
.mode-badge.pro { color: var(--amber); border: 1px solid rgba(245,166,35,0.3); }
.mode-features, .pro-features { font-size: 11px; color: var(--dim); margin-top: 10px; line-height: 1.6; text-align: left; }

/* ============================================
   SHARED: CHOICE BUTTONS
   ============================================ */
.choice-btn { width: 100%; padding: 16px 20px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; color: var(--white); font-size: 14px; cursor: pointer; transition: all 0.25s; text-align: left; font-family: var(--font); line-height: 1.5; }
.choice-btn:hover { border-color: var(--cyan); background: var(--card-hover); transform: translateX(4px); }
.choice-btn.selected { background: rgba(0,229,255,0.1); border-color: var(--cyan); }
.choice-marker { width: 10px; height: 10px; border: 2px solid var(--border); border-radius: 50%; flex-shrink: 0; transition: all 0.3s; }
.choice-btn:hover .choice-marker { border-color: var(--cyan); background: rgba(0,229,255,0.15); }

/* ============================================
   SHARED: SCALE BUTTONS
   ============================================ */
.scale { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.scale-btn { flex: 1; padding: 12px 8px; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--dim); font-family: var(--font); font-size: 13px; cursor: pointer; transition: all 0.25s; text-align: center; min-height: 44px; }
.scale-btn:hover { border-color: var(--cyan); color: var(--white); background: rgba(0,229,255,0.05); }
.scale-btn.selected { border-color: var(--cyan); background: rgba(0,229,255,0.1); color: var(--cyan); }

/* ============================================
   SHARED: QUIZ NAVIGATION
   ============================================ */
.q-nav { display: flex; align-items: center; width: 100%; }

/* ============================================
   SHARED: RESULT CARDS
   ============================================ */
.primary-card { width: 100%; background: var(--card); border: 1px solid rgba(0,229,255,0.2); border-radius: 12px; padding: 36px; text-align: center; margin-bottom: 24px; position: relative; overflow: hidden; }
.primary-icon { font-size: 48px; margin-bottom: 16px; }
.primary-name { font-size: 28px; font-weight: 400; color: var(--cyan); letter-spacing: 2px; }
.primary-subtitle { font-size: 14px; color: var(--dim); margin-top: 6px; font-weight: 300; }
.primary-desc { font-size: 14px; color: var(--dim); line-height: 1.7; max-width: 600px; margin: 16px auto 0; font-weight: 300; }
.primary-score { font-family: var(--mono); font-size: 42px; color: var(--cyan); font-weight: 200; margin-top: 12px; }

.score-card { width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin-bottom: 16px; text-align: center; border-left: 2px solid var(--cyan); }
.score-number { font-size: 48px; font-weight: 200; color: var(--cyan); }
.score-label { font-size: 14px; color: var(--dim); margin-top: 4px; }
.score-big { font-family: var(--mono); font-size: 56px; font-weight: 200; color: var(--cyan); }

.growth-card { width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px; margin-bottom: 24px; border-left: 2px solid var(--cyan); font-size: 13px; line-height: 1.8; font-weight: 300; color: var(--dim); }
.growth-card h4 { font-size: 16px; font-weight: 400; color: var(--white); margin-bottom: 12px; }

.insight-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 22px; font-size: 13px; line-height: 1.7; font-weight: 300; color: var(--dim); }
.insight-card h4 { font-size: 15px; font-weight: 400; color: var(--white); margin-bottom: 10px; }

.combo-card { width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px; margin-bottom: 20px; border-left: 2px solid var(--amber); color: var(--dim); font-size: 14px; line-height: 1.8; font-weight: 300; }
.combo-card strong { color: var(--white); font-weight: 400; }

/* ============================================
   SHARED: RESPONSIVE
   ============================================ */


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .lab-hero { grid-template-columns: 1fr; min-height: unset; }
  .lab-orbit { display: none; }
  .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .route-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { align-items: flex-start !important; }
  .app { padding: 16px; }
  .lab-home { padding: 32px 16px; }
  .lab-hero-panel { padding: 32px 22px; border-radius: 22px; }
  .lab-title { font-size: 42px; }
  .lab-grid { grid-template-columns: 1fr; }
  .lab-test-card { min-height: unset; padding: 22px; }
  .title-block h1 { font-size: 28px; }
  .q-card, .primary-card, .score-card, .summary-card, .pro-section, .growth-card { padding: 22px !important; }
  .action-row { width: 100%; }
  .action-row .btn { flex: 1 1 180px; justify-content: center; }
  .lab-next-card { align-items: stretch; flex-direction: column; }
  .lab-next-card a { justify-content: center; }
  .mode-cards { grid-template-columns: 1fr; }
  .scale-btn { padding: 10px 4px; font-size: 11px; }
  .scale { gap: 4px; }
  .primary-score { font-size: 32px; }
  .score-big { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
/* ============================================
   HOMEPAGE: AUTH BAR, MODAL & USER MENU
   ============================================ */
.lab-auth-bar { position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: flex-end; align-items: center;
  gap: 10px; padding: 10px 20px; max-width: 1100px; margin: 0 auto; background: rgba(12,21,32,0.72); border-bottom: 1px solid var(--lab-border);
}
.lab-auth-btn {
  font-family: var(--lab-mono); font-size: 11px; letter-spacing: 2px;
  padding: 6px 16px; border: 1px solid var(--lab-border); border-radius: 999px;
  background: transparent; color: var(--lab-muted); cursor: pointer;
  transition: all 0.2s; text-transform: uppercase;
}
.lab-auth-btn:hover { border-color: var(--lab-cyan); color: var(--lab-cyan); }
.lab-auth-btn.primary { border-color: rgba(0,229,255,0.3); color: var(--lab-cyan); }

.lab-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
}
.lab-modal-overlay.hidden { display: none; }
.lab-modal {
  background: rgba(18,28,42,0.96); border: 1px solid var(--lab-border);
  border-radius: 16px; padding: 32px 28px; width: 380px;
  max-width: 94vw;
}
.lab-modal h3 { font-size: 20px; font-weight: 300; color: var(--lab-white); margin-bottom: 24px; text-align: center; }
.lab-modal h3 span { color: var(--lab-cyan); }
.lab-modal .field { margin-bottom: 16px; }
.lab-modal .field label {
  display: block; font-family: var(--lab-mono); font-size: 10px;
  letter-spacing: 2px; color: var(--lab-muted); margin-bottom: 6px; text-transform: uppercase;
}
.lab-modal .field input {
  width: 100%; padding: 10px 12px; background: rgba(240,244,248,0.05);
  border: 1px solid var(--lab-border); border-radius: 8px;
  color: var(--lab-white); font-size: 14px; font-family: var(--lab-font);
  outline: none; transition: border-color 0.2s;
}
.lab-modal .field input:focus { border-color: var(--lab-cyan); }
.lab-modal .modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.lab-modal .modal-actions button {
  flex: 1; padding: 10px; border-radius: 8px; font-size: 14px;
  cursor: pointer; transition: all 0.2s; font-family: var(--lab-font);
}
.lab-modal .btn-submit { background: rgba(0,229,255,0.12); border: 1px solid rgba(0,229,255,0.3); color: var(--lab-cyan); }
.lab-modal .btn-submit:hover { background: rgba(0,229,255,0.2); }
.lab-modal .btn-cancel { background: transparent; border: 1px solid var(--lab-border); color: var(--lab-muted); }
.lab-modal .btn-cancel:hover { border-color: rgba(240,244,248,0.3); color: var(--lab-white); }
.lab-modal .modal-switch { text-align: center; margin-top: 16px; font-size: 12px; color: var(--lab-muted); }
.lab-modal .modal-switch a { color: var(--lab-cyan); cursor: pointer; text-decoration: none; }
.lab-modal .modal-switch a:hover { text-decoration: underline; }
.lab-modal .modal-error { font-size: 12px; color: #f87171; margin-top: 8px; text-align: center; min-height: 18px; }

.lab-user-menu { position: relative; display: inline-block; }
.lab-user-menu .user-trigger {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--lab-white); cursor: pointer; padding: 6px 12px;
  border: 1px solid var(--lab-border); border-radius: 8px;
  background: rgba(255,255,255,0.03); transition: border-color 0.2s;
}
.lab-user-menu .user-trigger:hover { border-color: var(--lab-cyan); }
.lab-user-menu .user-dropdown {
  display: none; position: absolute; right: 0; top: 100%;
  margin-top: 6px; background: rgba(18,28,42,0.98);
  border: 1px solid var(--lab-border); border-radius: 10px;
  padding: 8px 0; min-width: 170px; z-index: 200;
}
.lab-user-menu.open .user-dropdown { display: block; }
.lab-user-menu .user-dropdown a,
.lab-user-menu .user-dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 18px;
  font-size: 13px; color: var(--lab-muted); background: none; border: none;
  cursor: pointer; font-family: var(--lab-font); text-decoration: none;
}
.lab-user-menu .user-dropdown a:hover,
.lab-user-menu .user-dropdown button:hover { background: rgba(0,229,255,0.08); color: var(--lab-white); }
.lab-user-menu .user-dropdown .sep { height: 1px; background: var(--lab-border); margin: 4px 0; }

/* ============================================
   HOMEPAGE: AUTH BAR, MODAL & USER MENU
   ============================================ */
.lab-auth-bar { position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: flex-end; align-items: center;
  gap: 10px; padding: 10px 20px; max-width: 1100px; margin: 0 auto; background: rgba(12,21,32,0.72); border-bottom: 1px solid var(--lab-border);
}
.lab-auth-btn {
  font-family: var(--lab-mono); font-size: 11px; letter-spacing: 2px;
  padding: 6px 16px; border: 1px solid var(--lab-border); border-radius: 999px;
  background: transparent; color: var(--lab-muted); cursor: pointer;
  transition: all 0.2s; text-transform: uppercase;
}
.lab-auth-btn:hover { border-color: var(--lab-cyan); color: var(--lab-cyan); }
.lab-auth-btn.primary { border-color: rgba(0,229,255,0.3); color: var(--lab-cyan); }

.lab-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
}
.lab-modal-overlay.hidden { display: none; }
.lab-modal {
  background: rgba(18,28,42,0.96); border: 1px solid var(--lab-border);
  border-radius: 16px; padding: 32px 28px; width: 380px;
  max-width: 94vw;
}
.lab-modal h3 { font-size: 20px; font-weight: 300; color: var(--lab-white); margin-bottom: 24px; text-align: center; }
.lab-modal h3 span { color: var(--lab-cyan); }
.lab-modal .field { margin-bottom: 16px; }
.lab-modal .field label {
  display: block; font-family: var(--lab-mono); font-size: 10px;
  letter-spacing: 2px; color: var(--lab-muted); margin-bottom: 6px; text-transform: uppercase;
}
.lab-modal .field input {
  width: 100%; padding: 10px 12px; background: rgba(240,244,248,0.05);
  border: 1px solid var(--lab-border); border-radius: 8px;
  color: var(--lab-white); font-size: 14px; font-family: var(--lab-font);
  outline: none; transition: border-color 0.2s;
}
.lab-modal .field input:focus { border-color: var(--lab-cyan); }
.lab-modal .modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.lab-modal .modal-actions button {
  flex: 1; padding: 10px; border-radius: 8px; font-size: 14px;
  cursor: pointer; transition: all 0.2s; font-family: var(--lab-font);
}
.lab-modal .btn-submit { background: rgba(0,229,255,0.12); border: 1px solid rgba(0,229,255,0.3); color: var(--lab-cyan); }
.lab-modal .btn-submit:hover { background: rgba(0,229,255,0.2); }
.lab-modal .btn-cancel { background: transparent; border: 1px solid var(--lab-border); color: var(--lab-muted); }
.lab-modal .btn-cancel:hover { border-color: rgba(240,244,248,0.3); color: var(--lab-white); }
.lab-modal .modal-switch { text-align: center; margin-top: 16px; font-size: 12px; color: var(--lab-muted); }
.lab-modal .modal-switch a { color: var(--lab-cyan); cursor: pointer; text-decoration: none; }
.lab-modal .modal-switch a:hover { text-decoration: underline; }
.lab-modal .modal-error { font-size: 12px; color: #f87171; margin-top: 8px; text-align: center; min-height: 18px; }

.lab-user-menu { position: relative; display: inline-block; }
.lab-user-menu .user-trigger {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--lab-white); cursor: pointer; padding: 6px 12px;
  border: 1px solid var(--lab-border); border-radius: 8px;
  background: rgba(255,255,255,0.03); transition: border-color 0.2s;
}
.lab-user-menu .user-trigger:hover { border-color: var(--lab-cyan); }
.lab-user-menu .user-dropdown {
  display: none; position: absolute; right: 0; top: 100%;
  margin-top: 6px; background: rgba(18,28,42,0.98);
  border: 1px solid var(--lab-border); border-radius: 10px;
  padding: 8px 0; min-width: 170px; z-index: 200;
}
.lab-user-menu.open .user-dropdown { display: block; }
.lab-user-menu .user-dropdown a,
.lab-user-menu .user-dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 18px;
  font-size: 13px; color: var(--lab-muted); background: none; border: none;
  cursor: pointer; font-family: var(--lab-font); text-decoration: none;
}
.lab-user-menu .user-dropdown a:hover,
.lab-user-menu .user-dropdown button:hover { background: rgba(0,229,255,0.08); color: var(--lab-white); }
.lab-user-menu .user-dropdown .sep { height: 1px; background: var(--lab-border); margin: 4px 0; }