:root {
  --bg-dark: #070b14;
  --card-bg: #111827;
  --card-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.25);
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-family);
  max-width: 100%;
  overflow-x: hidden;
  line-height: 1.6;
}

.skip {
  position: absolute;
  top: -999px;
  left: 16px;
  background: var(--accent);
  color: #000;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 700;
  z-index: 1000;
}
.skip:focus {
  top: 16px;
}

/* Header & Nav */
.hero {
  padding: 24px 20px 32px;
  max-width: 840px;
  margin: 0 auto;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  touch-action: manipulation;
}
nav a:hover {
  text-decoration: underline;
}

.lang-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.lang-picker label {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.lang-picker select {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  touch-action: manipulation;
}

.hero-body {
  text-align: center;
}

.kicker {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 2px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}

.lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 16px;
}

.chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main Container */
main {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.card-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Real-Time Dashboard */
.dashboard-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
}

@media (max-width: 540px) {
  .dashboard-bar {
    grid-template-columns: 1fr;
  }
}

.dash-meter {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
}

.dash-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

.dash-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dash-val.ram {
  color: var(--warning);
}
.dash-val.bat {
  color: var(--success);
}

.progress-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

.fill-ram {
  background: linear-gradient(90deg, #38bdf8, #f59e0b, #ef4444);
}

.fill-bat {
  background: linear-gradient(90deg, #10b981, #38bdf8);
}

/* Question List */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.q-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px 16px;
}

.q-box-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.q-num {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.q-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

.q-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 600px) {
  .q-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.opt-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  touch-action: manipulation;
}

.opt-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.opt-btn.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Result Card */
.result-card {
  margin-top: 32px;
  padding: 24px 20px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--accent);
  border-radius: 16px;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.verdict-header {
  text-align: center;
  margin-bottom: 24px;
}

.verdict-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: var(--accent-glow);
  color: var(--accent);
  margin-bottom: 8px;
}

.verdict-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.verdict-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Metrics Details Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

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

.metric-cell {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.metric-title {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-val {
  font-size: 1.2rem;
  font-weight: 800;
}

/* Protocols */
.action-protocol {
  margin-bottom: 28px;
}

.action-protocol h4 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.protocol-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.protocol-list li {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
}

/* Buttons */
.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.primary-btn, .ghost-btn {
  flex: 1;
  min-width: 180px;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.primary-btn {
  background: var(--accent);
  color: #000;
  border: none;
}
.primary-btn:hover {
  background: #7dd3fc;
  box-shadow: 0 0 16px var(--accent-glow);
}

.ghost-btn {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}
.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Cross-Funnel Bridge Cards */
.bridge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}

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

.bridge-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  touch-action: manipulation;
}

.bridge-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.bridge-emoji {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.bridge-card h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.bridge-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Scientific Boundary Disclaimer */
.disclaimer-box {
  margin-top: 32px;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.disclaimer-box strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
}

/* Footer */
footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer a {
  color: var(--text-muted);
  text-decoration: underline;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
