/* Result screen: branch-map explore flow (hub → dive → why). Loaded last. */

.result-view { display: none; }
.result-view.is-active { display: block; }

/* ---------- MAP (hub) ---------- */
.result-map { animation: reveal-up .4s ease both; }

.map-current {
  padding: 30px 32px;
  border: 1px solid #303632;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #161917;
  color: #fff;
}
.map-current span {
  display: block;
  margin-bottom: 10px;
  color: #8bd0ae;
  font-size: 13px;
  font-weight: 800;
}
.map-current h1 {
  max-width: 900px;
  margin: 0;
  font-size: 32px;
  line-height: 1.32;
  word-break: keep-all;
}

.map-desire {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 32px;
  border: 1px solid #303632;
  border-top: 1px solid #2c322e;
  border-bottom: 0;
  background: #202522;
  color: #edf3ef;
}
.map-desire span {
  flex: 0 0 auto;
  color: #f2cf57;
  font-size: 11px;
  font-weight: 900;
}
.map-desire p {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.5;
  word-break: keep-all;
}

.map-board {
  padding: 30px 32px 34px;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #fff;
}
.map-origin {
  width: 150px;
  margin: 0 auto;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  text-align: center;
}
.map-origin span { display: block; color: var(--muted); font-size: 9px; font-weight: 900; }
.map-origin b { display: block; font-size: 14px; }

.map-lines { position: relative; height: 46px; }
.map-lines::before { content: ""; position: absolute; top: 0; bottom: 22px; left: 50%; width: 2px; background: #c2ccc5; }
.map-lines::after { content: ""; position: absolute; left: 16.66%; right: 16.66%; bottom: 21px; height: 2px; background: #c2ccc5; }
.map-lines i { position: absolute; bottom: 0; width: 2px; height: 22px; background: #c2ccc5; }
.map-lines i:nth-child(1) { left: 16.66%; }
.map-lines i:nth-child(2) { left: 50%; }
.map-lines i:nth-child(3) { left: 83.33%; }

.map-nodes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.map-node {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--line);
  border-radius: 8px;
  background: #f7f9f7;
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.map-node:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(21,32,25,.12); }
.map-node:nth-child(1) { border-top-color: #35795b; background: #eef7f1; }
.map-node:nth-child(2) { border-top-color: #d0614d; background: #fff6f2; }
.map-node:nth-child(3) { border-top-color: #d2a91f; background: #fffbea; }
.map-node.is-strong { box-shadow: 0 0 0 2px #17613f inset; }
.map-node.is-locked { border-style: dashed; }

.map-node-head { display: flex; align-items: center; justify-content: space-between; min-height: 30px; }
.map-node-star { display: inline-flex; width: 22px; height: 22px; color: #d2a91f; }
.map-node-star svg { width: 100%; height: 100%; }
.map-node-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: #35795b;
}
.map-node-icon svg { width: 16px; height: 16px; }
.map-node:nth-child(2) .map-node-icon { color: #d0614d; }
.map-node:nth-child(3) .map-node-icon { color: #b98a17; }
.map-node.is-locked .map-node-icon { color: #98756f; }

.map-node strong { margin: 12px 0 8px; font-size: 15px; line-height: 1.35; word-break: keep-all; }
.map-node p {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.45;
  word-break: keep-all;
}

.map-hint {
  margin: 22px 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--green);
  background: #eef7f1;
  color: #33463c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  word-break: keep-all;
}
.map-closing {
  margin: 26px 0 0;
  padding: 24px 26px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.55;
  text-align: center;
  word-break: keep-all;
}

.why-toggle {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 15px;
  border: 1px dashed #aeb8b2;
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.why-toggle:hover { border-color: var(--green); color: var(--ink); }
.why-toggle span { margin-left: 4px; }

.map-feedback {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.map-feedback:hover { color: var(--green); text-decoration: underline; }

/* ---------- DIVE (inside a future) ---------- */
.dive-back {
  margin: 0 0 16px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}
.dive-back:hover { border-color: var(--green); }

.dive-stage .stage-kicker { margin: 0 0 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
/* Drop the redundant "신호 0X" label and compact the signal cards. */
.result-dive .future-artifacts article::before { display: none; }
.result-dive .future-artifacts article { min-height: 0; padding: 14px 16px; }
.result-dive .evidence-heading { padding-bottom: 10px; }

/* One folded block for turning point + reward/cost, so the dive shows less by default. */
.stage-more { margin: 0 28px 26px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stage-more > summary { padding: 15px 18px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 800; }
.stage-more[open] > summary { color: var(--ink); border-bottom: 1px solid var(--line); }
.stage-more .turning-inner { padding: 20px; background: #211f1e; color: #fff; }
.stage-more .turning-inner > span { color: #f0a18f; font-size: 10px; font-weight: 900; }
.stage-more .turning-inner h4 { margin: 8px 0 14px; font-size: 18px; }
.stage-more .turning-inner p { margin: 8px 0; color: #d5dad6; font-size: 13px; }
.stage-more .turning-inner p strong { display: block; color: #fff; font-size: 11px; }
.stage-more .cost-reward-strip { border-top: 0; }
@media (max-width: 520px) { .stage-more { margin: 0 20px 20px; } }

.dive-whatif {
  margin-top: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--yellow);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(21,32,25,.06);
}
.dive-whatif .what-if-head { display: block; }
.dive-whatif .what-if-head h2 { margin: 0; font-size: 26px; line-height: 1.25; }
.dive-whatif .what-if-head h2 em { color: var(--coral); font-style: normal; }
.dive-whatif .what-if-head > p { margin: 8px 0 0; max-width: 620px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.dive-whatif .what-if-head > p strong { color: var(--ink); }
.result-dive .what-if-form { grid-template-columns: 1fr auto; }
.result-dive .what-if-form .primary-button { width: auto; min-width: 150px; }

/* ---------- WHY panel (evidence, on demand) ---------- */
.why-panel { margin-top: 24px; animation: reveal-up .35s ease both; }
.why-close {
  display: block;
  margin: 0 0 12px auto;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.why-close:hover { color: var(--ink); border-color: var(--ink); }
.why-panel .trust-engine { margin-top: 0; }

@media (max-width: 820px) {
  .map-current { padding: 24px 20px; }
  .map-current h1 { font-size: 26px; }
  .map-desire { padding: 16px 20px; flex-direction: column; gap: 6px; }
  .map-board { padding: 24px 18px; }
  .map-lines { display: none; }
  .map-origin { margin-bottom: 18px; }
  .map-nodes { grid-template-columns: 1fr; gap: 10px; }
  .map-node { min-height: 0; }
  .dive-whatif { padding: 22px 18px; }
  .result-dive .what-if-form { grid-template-columns: 1fr; }
  .result-dive .what-if-form .primary-button { width: 100%; }
}

@media (max-width: 520px) {
  .map-current h1 { font-size: 23px; }
  .map-node p { font-size: 16px; }
  .map-closing { font-size: 16px; padding: 20px; }
}
