/* CCTI 乡创人格指数 — Mobile-first H5 Styles */

:root {
  color-scheme: light;
  --ink: #16231f;
  --muted: #60706b;
  --paper: #fbfcfa;
  --field: #edf3f0;
  --line: #cfdad5;
  --green: #255f50;
  --green-2: #3d7a66;
  --rust: #d65a31;
  --blue: #2d4e8f;
  --gold: #f4b942;
  --white: #ffffff;
  --shadow: 0 4px 24px rgba(22, 35, 31, 0.08);
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--field); -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f7faf8 0%, var(--field) 40%, #e7eee9 100%);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; height: auto; }

.sprite { display: none; }

/* ---------- Shell ---------- */
.app-shell {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px 32px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 12px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.brand img {
  height: 40px;
  width: auto;
  max-width: 176px;
  object-fit: contain;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(22, 35, 31, 0.08));
}

.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-kicker { display: none; }

/* Topbar nav pills */
.nav-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-pill:active { background: var(--field); }

.nav-pill.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.nav-pill:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  font-weight: 700;
  font-size: 15px;
  transition: transform 120ms ease, box-shadow 120ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  border-color: var(--green);
  background: linear-gradient(135deg, var(--green-2), var(--green));
  color: var(--white);
  box-shadow: 0 6px 16px rgba(37, 95, 80, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-block { width: 100%; }

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Cards (shared) ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}

.card-padded { padding: 18px; }

/* ---------- Home ---------- */
.home-page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  min-height: calc(100vh - 106px);
  min-height: calc(100dvh - 106px);
  padding: 10px 20px 12px;
}

.home-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 26px 24px 28px;
  border: 1px solid var(--ink);
  border-radius: 18px;
  background: var(--white);
  text-align: center;
  width: 100%;
  max-width: 400px;
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  margin-top: auto;
}

.home-logo {
  position: relative;
  margin-bottom: 0;
}

.home-logo::before {
  content: "";
  position: absolute;
  inset: -24px -34px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(37, 95, 80, 0.16), transparent 72%);
  pointer-events: none;
}

.home-logo img {
  position: relative;
  z-index: 1;
  height: 80px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  filter: drop-shadow(0 6px 16px rgba(22, 35, 31, 0.14));
}

.home-partners {
  text-align: center;
  width: 100%;
  max-width: 440px;
  margin-bottom: auto;
}

.partners-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}

.partners-label::before,
.partners-label::after {
  content: "";
  flex: 1;
  height: 1px;
}

.partners-label::before {
  background: linear-gradient(90deg, transparent, var(--line));
}

.partners-label::after {
  background: linear-gradient(90deg, var(--line), transparent);
}

.partner-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 12px;
}

.partner-logos img {
  width: auto;
  height: auto;
  object-fit: contain;
  /* 官方矢量 logo（透明背景）：与页面底色自然融合 */
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  filter: drop-shadow(0 1px 2px rgba(22, 35, 31, 0.10));
  opacity: 0.95;
  transition: opacity 160ms ease, transform 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

/* 乡野青创：横幅版式 */
.partner-logos .partner-xy {
  height: 46px;
  max-width: 280px;
}

/* 绘乡计划：方形竖排版式 */
.partner-logos .partner-hx {
  height: 54px;
}

.partner-logos img:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.home-subtitle {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--green);
  text-transform: uppercase;
  /* 480px 宽下一行放下；更小视口若需换行则两行均衡，避免孤立字 */
  text-wrap: balance;
}

.home-hero h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.home-hero h1 .grad {
  background: linear-gradient(120deg, var(--green) 10%, var(--green-2) 50%, #c2512c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-hero > p {
  margin: 0;
  max-width: 320px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  width: 100%;
}

.home-hero .btn {
  width: 100%;
  max-width: 264px;
  min-height: 45px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
}

/* ---------- Test ---------- */
.test-page {
  display: grid;
  gap: 16px;
}

.question-card {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}

.test-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.step-pill {
  display: flex;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  font-weight: 900;
  font-size: 15px;
}

.progress-wrap { flex: 1; min-width: 0; }

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--rust), var(--gold), var(--green));
  transition: width 220ms ease;
}

.question-body { padding: 22px 18px; }

.scene-label {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.question-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.option-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.option-btn {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.option-btn:active { background: var(--field); }

.option-btn.is-selected {
  border-color: var(--green);
  background: #e7f2ee;
  box-shadow: inset 0 0 0 2px var(--green);
}

.option-mark {
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  font-weight: 900;
  font-size: 15px;
}

.option-text strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
  line-height: 1.25;
}

.option-text span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.check-slot {
  display: flex;
  width: 24px;
  height: 24px;
  align-self: center;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.check-slot svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.test-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px 20px;
}

/* ---------- Result ---------- */
.result-page {
  display: grid;
  gap: 16px;
}

.result-card-section {
  text-align: center;
}

#resultCard {
  display: block;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 2 / 3;
  margin: 0 auto;
  border: 1px solid rgba(22, 35, 31, 0.14);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 18px 48px rgba(22, 35, 31, 0.16);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.result-actions .btn-primary {
  box-shadow: 0 8px 20px rgba(37, 95, 80, 0.32);
}

/* ---- 人格主视觉 showcase ---- */
.result-showcase {
  position: relative;
  display: grid;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(110% 80% at 15% -10%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(165deg, #1c463a 0%, #2a6252 52%, #16352b 100%);
  color: #fff;
  box-shadow: 0 16px 40px rgba(22, 35, 31, 0.22);
}

.showcase-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 0;
}

.showcase-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1.6px);
  background-size: 18px 18px;
  pointer-events: none;
}

.showcase-visual img {
  position: relative;
  display: block;
  max-height: 400px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 22px 40px rgba(6, 18, 14, 0.5));
}

.showcase-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #e5a52f);
  color: #2a2110;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  box-shadow: 0 6px 16px rgba(214, 130, 32, 0.35);
}

.showcase-body {
  padding: 18px 20px 24px;
}

.showcase-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.72);
}

.result-name {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.result-tagline {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.tag-green {
  border-color: var(--green);
  color: var(--green);
}

.result-showcase .tag {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.result-showcase .tag-sub {
  border-color: rgba(244, 185, 66, 0.5);
  color: #ffe9ad;
}

/* ---------- Section blocks ---------- */
.section-block {
  padding: 20px;
  border: 1px solid rgba(207, 218, 213, 0.75);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(22, 35, 31, 0.06);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
}

.section-title svg {
  width: 18px;
  height: 18px;
  padding: 6px;
  box-sizing: content-box;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 95, 80, 0.14), rgba(61, 122, 102, 0.05));
  color: var(--green);
  stroke-width: 2.2;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1.5px;
  margin-left: 6px;
  max-width: 90px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(37, 95, 80, 0.30), transparent);
}

.section-block .copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

/* Insights grid */
.insight-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.insight-item {
  position: relative;
  padding: 14px 14px 14px 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdfc, #f4f8f5);
}

.insight-item::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 5px rgba(214, 90, 49, 0.12);
}

.insight-item.accent-gold::before {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(244, 185, 66, 0.15);
}

.insight-item.accent-green::before {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(37, 95, 80, 0.12);
}

.insight-item.accent-blue::before {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(45, 78, 143, 0.12);
}

.insight-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13.5px;
}

.insight-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* Dimension rows */
.dimension-row {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.dimension-row span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.dimension-row span:last-child { text-align: right; }

.dimension-track {
  position: relative;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(90deg, #e8efe9, #f6f9f6);
}

.dimension-dot {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9b0, var(--gold));
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(244, 185, 66, 0.18), 0 2px 8px rgba(22, 35, 31, 0.25);
}

/* Match reason banner */
.match-reason {
  padding: 8px 10px;
  border-left: 3px solid var(--gold);
  background: #fff8e8;
  color: #5b4616;
  font-size: 13px;
  line-height: 1.5;
  margin: 8px 0;
}

/* ---------- Atlas ---------- */
.atlas-page {
  display: grid;
  gap: 16px;
}

.atlas-grid {
  display: grid;
  gap: 10px;
}

.atlas-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.atlas-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  min-height: 180px;
  color: var(--white);
}

.atlas-visual img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 320px;
}

.atlas-visual strong { font-size: 13px; }

.atlas-symbol {
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 22px;
  font-weight: 900;
}

.atlas-body { padding: 14px 16px; }

.atlas-body h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.atlas-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.atlas-body .tag-row { padding: 10px 0 0; }

.atlas-card {
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.atlas-card:active { transform: scale(0.98); }

.atlas-open-hint {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(22, 35, 31, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.atlas-code {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  vertical-align: 1px;
}

/* ---------- Atlas detail modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 19, 0.55);
  overflow-y: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 16px;
  box-shadow: 8px 8px 0 rgba(22, 35, 31, 0.22);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(22, 35, 31, 0.55);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 18px 16px 10px;
  overflow: hidden;
}

.modal-visual img {
  display: block;
  max-height: 220px;
  width: auto;
  object-fit: contain;
}

.modal-body { padding: 14px 18px 24px; }

.modal-code {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--green);
}

.modal-body h2 {
  margin: 6px 0 4px;
  font-size: 26px;
  font-weight: 900;
}

.modal-tagline {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.modal-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.modal-section h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--green);
}

.modal-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}

/* ---------- Villages ---------- */
.villages-page {
  display: grid;
  gap: 16px;
}

.village-grid {
  display: grid;
  gap: 10px;
}

.village-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.village-visual {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  color: var(--white);
}

.village-visual span,
.village-visual strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.village-body {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.village-body h3 {
  margin: 0;
  font-size: 17px;
}

.village-body > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.village-case {
  margin-top: 10px;
  padding: 12px 14px;
  background: #f8f3ea;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.village-case p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink);
}

.village-score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.village-score { display: grid; gap: 4px; }

.village-score span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.needs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.needs-list span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

/* Mini track shared */
.mini-track {
  height: 7px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.mini-fill {
  height: 100%;
  background: var(--rust);
  transition: width 220ms ease;
}

/* ---------- Tasks ---------- */
.tasks-page {
  display: grid;
  gap: 16px;
}

.task-grid {
  display: grid;
  gap: 10px;
}

.task-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.task-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.task-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.task-type {
  flex-shrink: 0;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.task-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

.task-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f2ee;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.task-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.task-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.task-btn:active { background: var(--field); }

.task-btn.is-saved {
  background: var(--ink);
  color: var(--white);
}

.stage-timeline,
.media-grid,
.roadmap-grid { display: grid; gap: 10px; }

.stage-card,
.media-card,
.roadmap-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.stage-card span,
.media-card span,
.roadmap-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.stage-card h3,
.roadmap-card h3 { margin: 4px 0; font-size: 15px; }

.stage-card p,
.stage-card strong,
.media-card p,
.roadmap-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stage-card strong { color: var(--green); }

.media-card strong { display: block; margin-bottom: 4px; }

/* ---------- Profile ---------- */
.profile-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.profile-grid {
  display: grid;
  gap: 10px;
}

.field { display: grid; gap: 4px; }

.field label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  font-size: 14px;
}

.field input:focus-visible,
.field select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Growth ---------- */
.growth-grid,
.team-grid {
  display: grid;
  gap: 10px;
}

.growth-card,
.team-card,
.resident-card > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.growth-card > span,
.team-card > span,
.resident-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 4px;
}

.growth-card strong,
.team-card strong {
  font-size: 17px;
}

.growth-card p,
.team-card p,
.resident-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.badge {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 12px;
  font-weight: 800;
}

.badge small {
  font-size: 10px;
  font-weight: 700;
}

.badge.is-earned {
  border-style: solid;
  border-color: var(--green);
  background: #e7f2ee;
  color: var(--green);
}

.resident-card {
  display: grid;
  gap: 10px;
}

/* ---------- Page heading (Atlas, Villages, Tasks, Dashboard) ---------- */
.page-heading {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
}

.page-heading h1 {
  margin: 0;
  font-size: 24px;
}

.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.empty-note {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 50;
  max-width: 400px;
  margin: 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

/* ---------- Desktop / Tablet ---------- */
@media (min-width: 640px) {
  .app-shell { max-width: 720px; padding: 16px 24px 40px; }

  .brand img { height: 44px; max-width: 200px; }

  .partner-logos .partner-xy { height: 54px; }
  .partner-logos .partner-hx { height: 64px; }

  .brand-title { font-size: 18px; }

  .brand-kicker {
    display: block;
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
  }

  .home-hero { padding: 30px 32px 34px; gap: 10px; }

  .home-page {
    min-height: calc(100vh - 122px);
    min-height: calc(100dvh - 122px);
  }

  .home-logo img { height: 88px; }

  .home-hero h1 { font-size: 32px; }

  .home-hero > p { font-size: 14px; }

  .home-hero .btn { min-height: 48px; font-size: 16px; }

  .question-title { font-size: 26px; }

  .insight-grid { grid-template-columns: repeat(2, 1fr); }

  .atlas-grid { grid-template-columns: repeat(2, 1fr); }

  .village-grid { grid-template-columns: repeat(2, 1fr); }

  .task-grid { grid-template-columns: repeat(2, 1fr); }

  .stage-timeline { grid-template-columns: repeat(2, 1fr); }

  .media-grid { grid-template-columns: repeat(2, 1fr); }

  .roadmap-grid { grid-template-columns: repeat(2, 1fr); }

  .growth-grid { grid-template-columns: repeat(2, 1fr); }

  .team-grid { grid-template-columns: repeat(2, 1fr); }

  .profile-grid { grid-template-columns: repeat(2, 1fr); }

  .test-page { grid-template-columns: 1fr; }

  .result-name { font-size: 32px; }
}

@media (min-width: 768px) {
  .atlas-grid { grid-template-columns: repeat(3, 1fr); }

  .result-showcase {
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 0;
  }

  .showcase-visual {
    padding: 34px 10px 34px 34px;
  }

  .showcase-visual img {
    max-height: 480px;
  }

  .showcase-body {
    padding: 24px 30px 24px 12px;
  }

  .result-name { font-size: 40px; }

  .task-grid { grid-template-columns: repeat(3, 1fr); }

  .stage-timeline { grid-template-columns: repeat(4, 1fr); }

  .media-grid { grid-template-columns: repeat(5, 1fr); }

  .roadmap-grid { grid-template-columns: repeat(3, 1fr); }

  .growth-grid { grid-template-columns: repeat(3, 1fr); }

  .team-grid { grid-template-columns: repeat(3, 1fr); }

  .profile-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .app-shell {
    max-width: 960px;
    padding: 20px 32px 48px;
  }

  .topbar {
    padding: 16px 0 22px;
  }

  .brand img { height: 48px; max-width: 220px; }
  .brand-title { font-size: 20px; }

  .partner-logos .partner-xy { height: 58px; max-width: 360px; }
  .partner-logos .partner-hx { height: 68px; }

  .home-partners { max-width: 540px; }

  .nav-pill { min-height: 38px; padding: 6px 20px; font-size: 14px; }

  .home-hero {
    padding: 34px 48px 38px;
    gap: 12px;
  }

  .home-page {
    min-height: calc(100vh - 158px);
    min-height: calc(100dvh - 158px);
  }

  .home-logo img { height: 92px; }

  .home-hero h1 { font-size: 36px; }
  .home-hero > p { font-size: 15px; max-width: 420px; }
  .home-hero .btn { min-height: 50px; font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
