/* app.css — mobile-first, no external deps */
:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --ink: #1c1917;
  --ink-soft: #44403c;
  --ink-muted: #78716c;
  --line: #e7e5e4;
  --line-soft: #f5f5f4;
  --accent: #FFB454;
  --accent-soft: #fff1d6;
  --accent-ink: #6b3a08;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 18px rgba(0,0,0,.06);
  --max: 720px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 12px; z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }

.site-header {
  padding: 28px 20px 8px;
  text-align: center;
  max-width: var(--max);
  margin: 0 auto;
}
.site-title {
  font-size: 22px; margin: 0 0 4px; letter-spacing: 0.02em;
}
.site-subtitle { color: var(--ink-muted); margin: 0; font-size: 14px; }

.site-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
}
.fact {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #fff);
  border-radius: 999px;
  padding: 4px 12px;
}

/* ---------- how it works ---------- */
.how { max-width: var(--max); margin: 20px auto 0; padding: 0 16px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.how-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.how-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.how-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.how-desc { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

.hero-banner {
  max-width: var(--max);
  margin: 12px 16px 0;
}
.hero-banner-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface-2);
}

main { padding: 8px 16px 32px; max-width: var(--max); margin: 0 auto; }

.screen { display: block; }
.screen[hidden] { display: none; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px;
  margin-top: 16px;
}
.card h2 { margin: 0 0 8px; font-size: 18px; }
.check-list { padding-left: 1.2em; margin: 0 0 12px; }
.check-list li { margin: 2px 0; }

.disclaimer {
  background: var(--line-soft);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 12px 0 18px;
}
.disclaimer strong { color: var(--accent-ink); }

.btn-primary, .btn-secondary {
  display: inline-block;
  font: inherit;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(.95); }
.btn-primary:disabled { background: #d6d3d1; border-color: #d6d3d1; cursor: not-allowed; color: var(--ink-muted); }
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-secondary:disabled { color: var(--ink-muted); cursor: not-allowed; }

/* ---------- progress ---------- */
.progress { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.progress-bar { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.progress-text { font-size: 13px; color: var(--ink-muted); white-space: nowrap; }

/* ---------- quiz ---------- */
.q-kind { font-size: 12px; color: var(--ink-muted); margin: 0 0 6px; letter-spacing: .04em; }
.q-text { font-size: 18px; line-height: 1.6; margin: 0 0 16px; color: var(--ink); }

.likert { border: 0; padding: 0; margin: 0; }
.likert .likert-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: var(--surface);
  transition: background .12s ease, border-color .12s ease;
}
.likert .likert-opt:hover { background: var(--accent-soft); border-color: var(--accent); }
.likert input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--line);
  border-radius: 50%;
  margin: 0;
  display: inline-block;
  flex-shrink: 0;
}
.likert input[type="radio"]:checked {
  border-color: var(--accent);
  background: radial-gradient(var(--accent) 0 35%, #fff 38% 100%);
}
.likert .opt-num {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: var(--surface-2);
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.likert input[type="radio"]:checked + .opt-num {
  background: var(--accent);
  color: #fff;
}
.likert .opt-text { font-size: 15px; }

.nav-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

/* ---------- result ---------- */
.result-root { background: transparent; }

.hero {
  background: var(--type-color, var(--accent));
  background-image: linear-gradient(135deg, var(--type-color, var(--accent)) 0%, color-mix(in srgb, var(--type-color, var(--accent)) 70%, white) 100%);
  color: #fff;
  padding: 26px 20px;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
}
.hero-img {
  width: 96px; height: 96px;
  background: rgba(255,255,255,.15);
  border-radius: 12px;
  object-fit: cover;
  display: block;
}
.hero-meta { min-width: 0; }
.hero-code { display: inline-block; padding: 2px 8px; background: rgba(255,255,255,.22); border-radius: 6px; font-size: 12px; letter-spacing: .08em; }
.hero-name { font-size: 28px; line-height: 1.2; margin: 6px 0 4px; font-weight: 700; }
.hero-catch { font-size: 14px; margin: 0; opacity: .95; }

.hero-judgment {
  grid-column: 1 / -1;
  font-size: 13px;
  background: rgba(0,0,0,.15);
  padding: 8px 10px;
  border-radius: 8px;
  margin: 6px 0 0;
}

.section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}
.section h2 {
  margin: 0 0 10px;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section h2 .icon { font-size: 18px; }
.section p { margin: 0 0 10px; color: var(--ink-soft); }
.section ul { margin: 0; padding-left: 1.2em; color: var(--ink-soft); }
.section ul li { margin: 4px 0; }

/* axis bars */
.axis-bars { display: grid; gap: 14px; }
.axis-bar-row { }
.axis-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--ink-muted);
  margin-bottom: 4px;
}
.axis-bar {
  height: 10px; background: var(--line); border-radius: 999px; position: relative;
}
.axis-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
}
.axis-bar-marker {
  position: absolute; left: 50%; top: -3px; bottom: -3px;
  width: 1px; background: var(--ink-muted); opacity: .5;
}
.axis-bar.modifier .axis-bar-fill { background: #94a3b8; }
.axis-bar.high .axis-bar-fill { background: var(--type-color, var(--accent)); }
.axis-bar-note {
  font-size: 11px; color: var(--ink-muted); margin-top: 4px;
}

/* neuro medals */
.medal-list { display: grid; gap: 12px; }
.medal {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
}
.medal-emoji { font-size: 26px; line-height: 1; }
.medal-label { font-weight: 600; }
.medal-stars { color: var(--accent); font-size: 14px; letter-spacing: 1px; }
.medal-desc { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

.others-list {
  display: grid; gap: 8px; margin-top: 12px;
  font-size: 13px; color: var(--ink-soft);
}
.others-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 6px 10px; background: var(--surface-2); border-radius: 8px;
}
.others-stars { color: var(--accent); }

/* share card */
.share-card {
  border: 2px dashed var(--type-color, var(--accent));
  border-radius: 14px;
  padding: 18px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  background: var(--surface);
}
.share-card-img { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; background: var(--accent-soft); }
.share-card-title { font-weight: 700; font-size: 18px; margin: 0 0 2px; }
.share-card-code { font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.share-card-catch { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.share-card ul { font-size: 13px; margin: 0 0 8px; }
.share-card .share-medals { font-size: 12px; color: var(--ink-muted); }
.share-card .share-note { font-size: 11px; color: var(--ink-muted); margin-top: 10px; }

.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
}
.site-footer .small { font-size: 11px; opacity: .7; margin-top: 6px; }


/* ---------- site nav (common) ---------- */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- types list page ---------- */
.types-group { margin: 24px 0 8px; }
.types-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  padding: 0 4px;
}
.types-group-bar {
  width: 6px;
  height: 18px;
  border-radius: 3px;
  background: var(--group-color, var(--accent));
}
.types-group-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.types-group-sub {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}
.types-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.type-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--type-color, var(--accent));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.type-card:hover,
.type-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
  outline: none;
}
.type-card.is-current,
.type-card[aria-current="page"] {
  border-color: var(--type-color, var(--accent));
  border-left-color: var(--type-color, var(--accent));
  box-shadow: 0 0 0 2px var(--type-color, var(--accent)) inset, 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.10);
  background: linear-gradient(180deg, color-mix(in srgb, var(--type-color, var(--accent)) 8%, #fff) 0%, var(--surface) 100%);
}
.type-card.is-current .type-card-name {
  color: var(--type-color, var(--accent));
}
.type-card-img {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--line-soft);
  display: block;
}
.type-card-meta { min-width: 0; }
.type-card-neural {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--type-color, var(--ink-muted));
  font-weight: 700;
  margin: 0 0 2px;
}
.type-card-name {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}
.type-card-code {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.type-card-catch {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}
.types-cta { margin-top: 24px; text-align: center; }

/* ---------- type detail page ---------- */
.type-hero {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: center;
  background: var(--type-color, var(--accent));
  background-image: linear-gradient(135deg, var(--type-color, var(--accent)) 0%, color-mix(in srgb, var(--type-color, var(--accent)) 70%, white) 100%);
  color: #fff;
  padding: 24px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 16px;
}
.type-hero-img {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,.15);
  display: block;
}
.type-hero-name {
  font-size: 28px;
  line-height: 1.2;
  margin: 6px 0 4px;
  font-weight: 700;
}
.type-hero-neural {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: .92;
  margin: 8px 0 0;
}
.type-hero-catch { font-size: 14px; margin: 0; opacity: .95; }
.type-hero-code {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255,255,255,.22);
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: .08em;
}
.type-hero-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 4px 10px 4px 8px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.type-hero-group-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--group-color, rgba(255,255,255,.7));
  box-shadow: 0 0 0 2px rgba(255,255,255,.45);
}

.type-axis-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.type-axis-row {
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}
.type-axis-row .type-axis-key {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
}
.type-axis-row .type-axis-val {
  font-size: 14px;
  color: var(--ink);
}

.type-related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.type-related a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
}
.type-related a:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---- type prev/next nav ---- */
.type-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.type-prevnext-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--type-color, var(--accent));
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  min-width: 0;
}
.type-prevnext-link:hover,
.type-prevnext-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
  outline: none;
}
.type-prevnext-prev { justify-content: flex-start; }
.type-prevnext-next { justify-content: flex-end; text-align: right; }
.type-prevnext-arrow { font-size: 20px; color: var(--ink-soft); flex-shrink: 0; }
.type-prevnext-text { display: grid; gap: 2px; min-width: 0; }
.type-prevnext-eyebrow { font-size: 11px; color: var(--ink-muted); letter-spacing: .04em; }
.type-prevnext-name { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-prevnext-code { font-size: 11px; color: var(--ink-muted); letter-spacing: .08em; }

@media (max-width: 520px) {
  .type-prevnext { grid-template-columns: 1fr; }
  .type-prevnext-next { justify-content: flex-start; text-align: left; flex-direction: row; }
  .type-prevnext-next .type-prevnext-arrow { order: 2; }
  .type-prevnext-next .type-prevnext-text { order: 1; }
}

/* ----- responsive: tablet & up ----- */
@media (min-width: 720px) {
  .hero { grid-template-columns: 140px 1fr; padding: 32px 28px; }
  .hero-img { width: 140px; height: 140px; }
  .hero-name { font-size: 34px; }
  .card { padding: 28px 26px; }
  .section { padding: 26px 24px; }
  .q-text { font-size: 20px; }
  .types-grid { grid-template-columns: 1fr 1fr; }
  .type-hero { grid-template-columns: 160px 1fr; padding: 32px 28px; }
  .type-hero-img { width: 160px; height: 160px; }
  .type-hero-name { font-size: 34px; }

}
