html { color-scheme: dark; }
@media (pointer: fine) { html { overscroll-behavior: none; } }
:root {
  --bg: #0f1220;
  --panel: #171b2e;
  --panel2: #1e2340;
  --text: #e8eaf6;
  --muted: #9aa3c0;
  --accent: #7c6cff;
  --accent2: #4dd0c4;
  --good: #6ee7a0;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #232a52 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px max(16px, env(safe-area-inset-right)) 80px max(16px, env(safe-area-inset-left));
}
#app { width: 100%; max-width: 760px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.2; text-wrap: balance; }
h2 { font-size: 1.15rem; margin-bottom: 6px; text-wrap: balance; }
h3 { text-wrap: balance; }
h1, h2, h3 { scroll-margin-top: 24px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.hero { text-align: center; }
.hero .emoji { font-size: 2.6rem; display: block; margin-bottom: 8px; }
.card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid #2c3358;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .ans:focus-visible, .rev-row:focus-visible, details.drivers summary:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.btn.secondary { background: #2c3358; }
.btn.ghost { background: transparent; border: 1px solid #3a4270; color: var(--muted); }
.btn-ico { margin-right: 6px; }
progress.progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  margin: 14px 0 4px;
  border: none;
  border-radius: 99px;
  background: #262c4d;
  overflow: hidden;
}
progress.progress::-webkit-progress-bar { background: #262c4d; border-radius: 99px; }
progress.progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
}
progress.progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
}
.qtext { font-size: 1.25rem; line-height: 1.45; margin: 18px 0 22px; overflow-wrap: break-word; }
.answers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ans {
  background: var(--panel2);
  border: 1px solid #333b66;
  color: var(--text);
  border-radius: 10px;
  padding: 14px 6px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-size: .8rem;
  text-align: center;
  transition: border-color .12s ease, transform .12s ease, background-color .12s ease;
}
.ans small { display: block; color: var(--muted); font-size: .68rem; margin-top: 4px; }
.ans:hover { border-color: var(--accent); transform: translateY(-2px); }
.ans.selected { background: var(--accent); border-color: var(--accent); }
.navrow { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 10px; flex-wrap: wrap; }
.navrow > * { min-width: 0; }
.navrow-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.models { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.model-chip { background: #141830; border: 1px solid #2c3358; border-radius: 10px; padding: 12px 14px; font-size: .85rem; }
.model-chip b { display: block; margin-bottom: 3px; color: var(--accent2); }
.model-chip .icon { margin-right: 6px; }
.bigtype {
  font-size: 2.6rem; font-weight: 800; letter-spacing: 2px;
  color: var(--accent2);
}
.bar-row {
  display: grid; grid-template-columns: 130px minmax(0, 1fr) 52px; align-items: center; gap: 10px;
  margin: 7px 0; font-size: .88rem; font-variant-numeric: tabular-nums;
}
.bar-row > span:first-child { overflow-wrap: break-word; }
.bar { height: 12px; background: #262c4d; border-radius: 99px; overflow: hidden; }
.bar > div {
  height: 100%; width: 100%;
  transform: scaleX(0); transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: transform .6s ease;
}
.bar.pct > div { background: linear-gradient(90deg, var(--accent2), var(--good)); }
.tag { display: inline-block; background: #2c3358; border-radius: 99px; padding: 4px 12px; font-size: .78rem; margin: 3px 4px 0 0; }
.result-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.drivers { font-size: .78rem; margin-top: 8px; color: var(--muted); }
details.drivers summary { cursor: pointer; }
details.drivers ul { margin: 6px 0 0 18px; }
details.drivers li { margin: 3px 0; }
.rev-list { display: flex; flex-direction: column; gap: 6px; }
.rev-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  width: 100%; text-align: left;
  background: var(--panel2); color: var(--text);
  border: 1px solid #333b66; border-radius: 10px;
  padding: 10px 12px; font-size: .9rem; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: border-color .12s ease;
  content-visibility: auto;
  contain-intrinsic-size: auto 52px;
}
.rev-row:hover { border-color: var(--accent); }
.rev-row.answered { border-color: var(--accent2); background: #1d2344; }
.rev-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.rev-q { min-width: 0; overflow-wrap: break-word; }
.rev-a { color: var(--accent2); font-size: .78rem; white-space: nowrap; }
.kbd { font-size: .72rem; color: var(--muted); margin-top: 14px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.swot-matrix { display: grid; grid-template-columns: 74px 1fr 1fr; gap: 8px; margin-top: 8px; }
.swot-corner, .swot-axis {
  font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.swot { background: #141830; border: 1px solid #2c3358; border-radius: 12px; padding: 12px 14px; }
.swot h3 { font-size: .95rem; margin-bottom: 6px; }
.swot ul { list-style: none; }
.swot li { margin: 7px 0; font-size: .82rem; line-height: 1.35; }
.swot li b { display: block; }
.swot li span { color: var(--muted); }
.swot.s { border-top: 3px solid var(--good); } .swot.s h3 { color: var(--good); }
.swot.w { border-top: 3px solid #ffb86b; } .swot.w h3 { color: #ffb86b; }
.swot.o { border-top: 3px solid var(--accent2); } .swot.o h3 { color: var(--accent2); }
.swot.t { border-top: 3px solid #ff7c7c; } .swot.t h3 { color: #ff7c7c; }
.swot li + li { border-top: 1px solid #262c4d; padding-top: 7px; }
.swot-meter { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.swot-meter .bar { flex: 1; height: 6px; }
.swot-meter-val { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.next-step { display: block; margin-top: 5px; font-size: .76rem; color: var(--accent2); font-style: normal; }
.next-step::before { content: "→ "; }
.ov-balance { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.ov-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.ov-stat { background: var(--panel2); border: 1px solid #2c3358; border-radius: 10px; padding: 10px 12px; min-width: 0; }
.ov-stat-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.ov-stat-value { display: block; font-size: 1.05rem; color: var(--accent2); margin: 3px 0; overflow-wrap: break-word; }
.ov-stat-note { display: block; font-size: .74rem; color: var(--muted); }
.ov-moves { list-style: none; margin: 8px 0 0; }
.ov-moves li { display: flex; gap: 10px; align-items: baseline; margin: 8px 0; font-size: .88rem; line-height: 1.4; }
.move-tag {
  flex: 0 0 auto; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 99px; background: #2c3358; color: var(--text);
}
.move-opportunity { background: rgba(45, 212, 191, .16); color: var(--accent2); }
.move-strength { background: rgba(74, 222, 128, .16); color: var(--good); }
.move-weakness { background: rgba(255, 184, 107, .16); color: #ffb86b; }
.move-threat { background: rgba(255, 124, 124, .16); color: #ff7c7c; }
@media (max-width: 560px) {
  .answers { grid-template-columns: 1fr; }
  .ans { padding: 12px; }
  .bar-row { grid-template-columns: 96px minmax(0, 1fr) 44px; }
  .rev-row { grid-template-columns: 28px minmax(0, 1fr); }
  .rev-a { grid-column: 2; white-space: normal; }
  .swot-matrix { grid-template-columns: 1fr; }
  .swot-corner, .swot-axis { display: none; }
  .ov-stats { grid-template-columns: 1fr 1fr; }
  .ov-moves li { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: env(safe-area-inset-top, 0);
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  z-index: 10;
}
.skip-link:focus-visible { left: env(safe-area-inset-left, 0); }
@media print {
  body { background: #fff; color: #000; padding: 0; }
  .btn, .btnrow, .navrow, .kbd, .skip-link, progress.progress { display: none !important; }
  .card { background: #fff; color: #000; border: 1px solid #ccc; box-shadow: none; }
  .muted, .drivers { color: #444; }
  .bigtype { color: #000; }
  .bar { background: #ddd; }
  .bar > div { background: #888 !important; transform: scaleX(var(--w, .5)) !important; }
  .tag { background: #eee; color: #000; }
  .model-chip { background: #fff; color: #000; border-color: #ccc; }
  details.drivers ul { display: block; }
  .rev-row { background: #fff; color: #000; border-color: #ccc; content-visibility: visible; }
  .rev-num, .rev-a { color: #444; }
  .swot { background: #fff; color: #000; border: 1px solid #ccc; border-top-width: 3px; }
  .swot h3 { color: #000; }
  .swot li span, .swot-axis, .swot-corner { color: #444; }
  .swot li + li { border-top-color: #ddd; }
  .next-step { color: #333; }
  .ov-stat { background: #fff; border-color: #ccc; }
  .ov-stat-value { color: #000; }
  .ov-stat-label, .ov-stat-note, .ov-balance { color: #444; }
  .move-tag { background: #eee; color: #000; }
}
