:root {
  color-scheme: light;
  --paper: #f0eee9;
  --surface: #fefdfa;
  --ink: #2b2622;
  --muted: #66746f;
  --line: #ddd7c9;
  --green: #1f5f4d;
  --green-2: #dfece4;
  --rose: #f0ded9;
  --blue: #dce8ef;
  --gold: #efe4c6;
  --clay: #c4674a;
  --clay-2: #f3ddd2;
  --focus: #184f97;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button[disabled] { opacity: .55; cursor: not-allowed; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(14px, 4vw, 34px);
  background: rgba(247, 245, 238, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  min-width: 0;
  text-align: center;
  font-weight: 720;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.save-state {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
}

.shell {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 30px) 70px;
}

body[data-home="true"] .shell {
  width: min(640px, 100%);
}

body[data-home="true"] .topbar {
  grid-template-columns: 1fr;
  width: min(640px, 100%);
  margin: 0 auto;
}

body[data-home="true"] #backBtn,
body[data-home="true"] .save-state {
  display: none;
}

body[data-home="true"] .brand {
  text-align: left;
  font-size: 13px;
}

body[data-home="true"] .hero,
body[data-home="true"] .progress {
  display: none;
}

.hero {
  padding: clamp(18px, 4vw, 34px) 0 16px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 8vw, 64px);
  font-weight: 500;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 5vw, 38px);
  font-weight: 500;
}

h3 { font-size: 17px; }

.lead {
  max-width: 690px;
  margin: 18px 0 0;
  color: #4f5f59;
  font-size: 18px;
}

.panel, .summary-block, dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: clamp(16px, 4vw, 28px);
  box-shadow: 3px 4px 0 rgba(43, 38, 34, .08);
}

.stage {
  display: none;
  animation: enter .22s ease-out;
}

.stage.active { display: block; }

.progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 6px;
  margin: 20px 0;
}

.dot {
  min-width: 0;
  padding: 10px 5px;
  border-bottom: 3px solid #cfc8b8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.dot.done, .dot.current {
  color: var(--green);
  border-color: var(--green);
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: block;
  margin-top: 18px;
  font-weight: 700;
}

label small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 450;
}

input, textarea, select {
  width: 100%;
  margin-top: 8px;
  padding: 12px 13px;
  border: 1px solid #cfc8b8;
  border-radius: 7px;
  background: #fffefa;
  color: var(--ink);
}

textarea {
  min-height: 106px;
  resize: vertical;
}

.long textarea { min-height: 170px; }

/* Exemplos discretos: fechados por padrão, sem competir com o campo da pessoa */
.campo { display: block; }

.exemplo {
  margin-top: 6px;
}

.exemplo > summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
  padding: 2px 0;
  border-bottom: 1px dotted #c4bcaa;
}

.exemplo > summary::-webkit-details-marker { display: none; }

.exemplo > summary:hover,
.exemplo > summary:focus-visible {
  color: var(--ink);
}

.exemplo-corpo {
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 2px solid #ded6c4;
  background: #fbf9f2;
  border-radius: 0 7px 7px 0;
}

.exemplo-corpo p {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 450;
  color: #5f5a4e;
  line-height: 1.45;
}

.exemplo-corpo p:last-child { margin-bottom: 0; }

.exemplo-nota {
  margin-top: 8px !important;
  font-size: 0.82rem !important;
  font-style: italic;
  color: var(--muted) !important;
}

.choices, .card-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.journey-grid {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.journey-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 88px;
  padding: 18px;
  text-align: left;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(43, 38, 34, .05);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.journey-card:active {
  transform: scale(.985);
}

.journey-glyph {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--green-2);
  border-radius: 50%;
  background: #edf5ef;
  color: var(--green);
}

.journey-glyph svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.journey-card.consult .journey-glyph {
  border-color: #e5d2a7;
  background: #f8f0da;
  color: #9b7626;
}

.journey-card.resume .journey-glyph {
  border-color: #ccdde5;
  background: #edf3f6;
  color: #46708a;
}

.journey-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.journey-arrow {
  flex: none;
  width: 19px;
  height: 19px;
  margin-left: auto;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .55;
  transition: transform .18s ease, opacity .18s ease, stroke .18s ease;
}

.journey-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
}

.journey-copy > span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.journey-card:hover,
.journey-card:focus-visible {
  border-color: var(--green);
  background: #eef4ef;
  box-shadow: 0 5px 18px rgba(31, 95, 77, .08);
}

.journey-card:hover .journey-arrow,
.journey-card:focus-visible .journey-arrow {
  opacity: 1;
  stroke: var(--green);
  transform: translateX(3px);
}

.start-top,
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.stage-progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.step-count {
  color: var(--green);
}

.start-panel {
  padding: clamp(18px, 4vw, 30px);
}

.greeting {
  margin: clamp(28px, 7vh, 54px) 0 0;
}

.greeting h2 {
  font-size: clamp(28px, 6vw, 38px);
}

.greeting p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-style: italic;
}

.saved-link {
  padding: 8px 4px;
  border-radius: 0;
  border-bottom: 1px dotted var(--green);
}

.tutorial-invite {
  margin-top: 24px;
  padding: 14px 12px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}

.tutorial-invite p {
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-style: italic;
}

.tutorial-invite button {
  margin-top: 10px;
}

.tutorial-invite small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.source-note {
  max-width: 540px;
  margin: 22px auto 0;
  padding: 12px 14px;
  border-left: 3px solid #d5c291;
  background: #fffaf0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.privacy-note {
  max-width: 520px;
  margin: 30px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.privacy-note strong {
  color: var(--ink);
  font-weight: 650;
}

.curator-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.curator-note a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dotted var(--green);
}

.clinical-note {
  max-width: 520px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
  text-align: center;
}

.mini-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.mini-dots span {
  width: 8px;
  height: 8px;
  border: 1.2px solid rgba(43, 38, 34, .5);
  border-radius: 50%;
}

.mini-dots span.on {
  background: var(--clay);
  border-color: var(--clay);
}

.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefa;
}

.choice input { width: auto; margin: 4px 0 0; }

.choice strong { display: block; }

.choice span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
}

.choice:has(input:checked) {
  border-color: var(--clay);
  background: var(--clay-2);
}

.choice.secondary-choice {
  margin-top: 18px;
  background: #fffefa;
  border-style: dashed;
}

.choice.secondary-choice:has(input:checked) {
  border-color: var(--green);
  background: #eef4ef;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
}

.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
  font-weight: 750;
  padding: 0 16px;
}

.quiet {
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 720;
}

.secondary {
  background: var(--clay-2);
  border-color: var(--clay);
  color: #7a3a22;
  font-weight: 720;
  padding: 0 14px;
}

.danger {
  border-color: #b9827b;
  color: #8a3128;
}

.muted { color: var(--muted); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.piece-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.piece {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  text-align: left;
  white-space: pre-wrap;
}

.piece.selected {
  border-color: var(--clay);
  background: var(--clay-2);
}

.summary-block {
  margin-top: 14px;
  padding: 15px;
}

.summary-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 12px 0;
  list-style: none;
}

.summary-list li {
  padding: 10px;
  border-left: 4px solid #bfd1c5;
  background: #f6f8f2;
  white-space: pre-wrap;
}

details {
  margin-top: 14px;
  color: var(--muted);
}

summary {
  width: fit-content;
  cursor: pointer;
  color: var(--green);
  font-weight: 750;
}

.notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 4px solid #c9aa58;
  background: #fff8e3;
}

.final-grid {
  display: grid;
  gap: 12px;
}

.discovery-experience {
  margin-top: 18px;
  padding: clamp(14px, 3vw, 20px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf7f0;
}

.discovery-intro {
  text-align: center;
}

.discovery-intro h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 5vw, 30px);
  font-weight: 500;
}

.discovery-intro p {
  margin: 6px auto 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-style: italic;
}

.discovery-map {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 10 / 11;
  margin: 20px auto 0;
}

.discovery-web {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.discovery-map-line {
  stroke: #c9d6cc;
  stroke-width: 1.4;
  stroke-dasharray: 3 5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  animation: fadeIn .7s ease var(--delay) forwards;
}

.discovery-node {
  position: absolute;
  width: min(29%, 148px);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(34, 50, 45, .06);
  opacity: 0;
  transform: translate(-50%, -50%) translateY(10px);
  animation: nodeIn .7s ease var(--delay) forwards;
}

.discovery-node.b {
  background: #edf3f6;
  border-color: #d9e4ea;
}

.discovery-node.o {
  background: #f8f0da;
  border-color: #ecdfb9;
}

.discovery-node.g {
  background: #eef4ef;
  border-color: #d4e2d6;
}

.discovery-node::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b28a2e;
  opacity: .8;
  transform: translateX(-50%);
}

.discovery-node-label {
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .07em;
  line-height: 1.3;
  text-transform: uppercase;
}

.discovery-node.b .discovery-node-label { color: #46708a; }
.discovery-node.o .discovery-node-label { color: #9b7626; }

.discovery-node p {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.38;
}

.discovery-center {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(60%, 300px);
  padding: 18px 18px 15px;
  border: 1px solid #cfe0d2;
  border-radius: 8px;
  background: #eef4ef;
  box-shadow: 0 4px 18px rgba(31, 95, 77, .1);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.94);
  animation: centerIn .9s ease var(--delay) forwards;
}

.discovery-center::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 54px;
  border-top: 2px solid #b28a2e;
  transform: translateX(-50%);
}

.discovery-icon {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  color: var(--green);
}

.discovery-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.discovery-center-label {
  color: var(--green);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.discovery-metaphor {
  margin: 7px 0 0;
  color: #14352b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14.5px;
  line-height: 1.45;
}

.discovery-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-style: italic;
}

.discovery-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.discovery-disclaimer {
  max-width: 500px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
  text-align: center;
}

.discovery-experience.show-all .discovery-map-line,
.discovery-experience.show-all .discovery-node,
.discovery-experience.show-all .discovery-center {
  animation-duration: .001ms;
  animation-delay: 0ms;
}

.discovery-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.saved-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.send-box {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf8;
}

.send-box.open { display: block; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--blue);
  color: #294654;
  font-size: 13px;
  font-weight: 750;
}

.hidden { display: none !important; }

dialog {
  width: min(520px, 92vw);
  padding: 0;
  box-shadow: 0 20px 70px rgba(38, 42, 34, .22);
}

dialog::backdrop { background: rgba(33, 49, 45, .36); }

.dialog-body { padding: 22px; }

.tutorial-dialog {
  width: min(560px, 100vw);
  max-width: none;
  height: min(760px, 100svh);
  max-height: none;
  border: 0;
  border-radius: 0;
  background: var(--paper);
}

.tutorial-dialog::backdrop {
  background: rgba(34, 50, 45, .28);
}

.tutorial-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}

.tutorial-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
}

.tutorial-head span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tutorial-rail {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px 6px;
}

.tutorial-rail span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}

.tutorial-rail span.done {
  background: var(--green-2);
}

.tutorial-rail span.now {
  background: #b28a2e;
  transform: scale(1.35);
}

.tutorial-rail strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 11.5px;
}

.tutorial-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 22px 8px;
}

.tutorial-part {
  min-height: 15px;
  margin: 0;
  color: #b28a2e;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.tutorial-body h2 {
  margin-top: 6px;
  font-size: clamp(21px, 5.6vw, 27px);
}

.tutorial-text {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
}

.tutorial-micro {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13.5px;
  font-style: italic;
}

.tutorial-stage {
  position: relative;
  min-height: 238px;
  margin: 16px 0 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tutorial-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tutorial-lines line {
  stroke: #c9d6cc;
  stroke-width: 1.4;
  stroke-dasharray: 3 5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity .7s ease;
}

.tutorial-card {
  position: absolute;
  width: 138px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(34, 50, 45, .06);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .7s ease, transform .7s ease;
}

.tutorial-card.p1 { left: 8%; top: 8%; }
.tutorial-card.p2 { right: 8%; top: 8%; }
.tutorial-card.p3 { left: 8%; bottom: 8%; }
.tutorial-card.p4 { right: 8%; bottom: 8%; }

.tutorial-card.center {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(8px);
}

.tutorial-card.wide {
  width: min(78%, 320px);
}

.tutorial-card.g {
  background: #eef4ef;
  border-color: #d4e2d6;
}

.tutorial-card.b {
  background: #edf3f6;
  border-color: #d9e4ea;
}

.tutorial-card.o {
  background: #f8f0da;
  border-color: #ecdfb9;
}

.tutorial-card strong {
  display: block;
  color: var(--green);
  font-size: 8.8px;
  font-weight: 750;
  letter-spacing: .08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.tutorial-card.b strong { color: #46708a; }
.tutorial-card.o strong { color: #9b7626; }

.tutorial-card p {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11.4px;
  font-style: italic;
  line-height: 1.35;
}

.tutorial-card.in,
.tutorial-lines line.in,
.tutorial-sheet i.in,
.tutorial-trail span.in,
.tutorial-pdf.in {
  opacity: 1;
}

.tutorial-card.in.center {
  transform: translate(-50%, -50%);
}

.tutorial-card.in:not(.center) {
  transform: translateY(0);
}

.tutorial-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(34, 50, 45, .08);
  transform: translate(-50%, -50%);
}

.tutorial-sheet > span {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 4px;
  border-radius: 2px;
  background: var(--green-2);
}

.tutorial-sheet > span:nth-child(1) { top: 26px; }
.tutorial-sheet > span:nth-child(2) { top: 42px; }
.tutorial-sheet > span:nth-child(3) { top: 58px; }

.tutorial-sheet i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b28a2e;
  opacity: 0;
}

.tutorial-sheet i:nth-of-type(1) { left: 26px; top: 88px; }
.tutorial-sheet i:nth-of-type(2) { left: 68px; top: 42px; }
.tutorial-sheet i:nth-of-type(3) { left: 46px; top: 106px; }
.tutorial-sheet i:nth-of-type(4) { left: 84px; top: 118px; }
.tutorial-sheet i:nth-of-type(5) { left: 34px; top: 130px; }

.tutorial-trail {
  position: absolute;
  left: 50%;
  top: 65%;
  width: 120px;
  height: 70px;
}

.tutorial-trail span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b28a2e;
  opacity: 0;
}

.tutorial-trail span:nth-child(1) { left: 14px; top: 8px; }
.tutorial-trail span:nth-child(2) { left: 52px; top: 32px; }
.tutorial-trail span:nth-child(3) { right: 10px; bottom: 6px; }

.tutorial-pdf {
  position: absolute;
  left: 18%;
  bottom: 12%;
  width: 92px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(34, 50, 45, .08);
  opacity: 0;
  transform: rotate(-2deg);
}

.tutorial-pdf span {
  position: absolute;
  inset: auto 8px 12px;
  color: var(--green);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.tutorial-card.typing p::after {
  content: "|";
  color: #b28a2e;
  font-style: normal;
  animation: blink 1s steps(1) infinite;
}

.tutorial-foot {
  padding: 10px 18px 16px;
  border-top: 1px solid var(--line);
}

.tutorial-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tutorial-nav button {
  flex: 1 1 120px;
  padding-inline: 14px;
}

.tutorial-legal,
.tutorial-curator {
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
  text-align: center;
}

.tutorial-curator {
  margin-top: 4px;
  font-size: 9px;
  opacity: .8;
}

@keyframes blink {
  50% { opacity: 0; }
}

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

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes nodeIn {
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes centerIn {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .save-state {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .card-grid, .row, .split, .piece-board, .journey-grid {
    grid-template-columns: 1fr;
  }

  .dot {
    font-size: 0;
    min-height: 18px;
    padding: 0;
  }

  .discovery-experience {
    padding-inline: 10px;
  }

  .discovery-map {
    aspect-ratio: 10 / 13;
  }

  .discovery-node {
    width: min(31%, 138px);
    padding: 8px;
  }

  .discovery-node-label {
    font-size: 8.8px;
  }

  .discovery-node p {
    font-size: 11.2px;
  }

  .discovery-center {
    width: min(61%, 280px);
    padding: 15px 14px 13px;
  }

  .discovery-metaphor {
    font-size: 13.4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-delay: 0ms !important;
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

.crisis-note {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 6px clamp(16px, 4vw, 32px) 30px;
  color: var(--muted, #66746f);
  font-size: 13px;
}
.crisis-note p { margin: 0; }
.crisis-note a { color: var(--green, #1f5f4d); }

.later-box, .danger-box {
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line, #ded8ca);
  border-radius: 8px;
  background: rgba(255, 253, 250, .7);
}
.later-box > summary, .danger-box > summary {
  cursor: pointer;
  font-weight: 750;
}
.danger-box > summary { color: #8a2f22; }
.later-box > p, .danger-box > p { margin: 8px 0 4px; }

/* o mapa encolhe quando há poucas peças, para não sobrar espaço vazio */
.discovery-map[data-nos="1"] { aspect-ratio: 10 / 5.5; }
.discovery-map[data-nos="2"] { aspect-ratio: 10 / 7; }
.discovery-map[data-nos="3"] { aspect-ratio: 10 / 8.5; }
.discovery-map[data-nos="4"] { aspect-ratio: 10 / 10; }

/* centro do mapa: a frase do paciente ocupa o lugar principal */
.discovery-center .discovery-frase {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.35;
  color: #14352b;
}
.discovery-center .discovery-metaphor.editorial {
  margin: 6px 0 0;
  font-style: italic;
  color: #4f5f59;
}
.discovery-sugestao {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px 10px;
  align-items: start;
  max-width: 560px;
  margin: 14px auto 0;
  padding: 10px 12px;
  border: 1px dashed var(--line, #ded8ca);
  border-radius: 8px;
  background: rgba(255, 253, 250, .6);
}
.discovery-sugestao p { margin: 0; font-size: 13px; color: #4f5f59; }
.discovery-sugestao .discovery-hint { grid-column: 2; font-size: 12px; color: var(--muted, #66746f); }
.discovery-sugestao .discovery-icon { grid-row: span 2; color: var(--green, #1f5f4d); }

.guardadas-box {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line, #ded8ca);
  border-radius: 8px;
  background: rgba(255, 253, 250, .7);
}
.guardadas-box > summary { cursor: pointer; font-weight: 750; }
.guardadas-box > p { margin: 8px 0 0; }

/* ---------------------------------------------------------------------------
   Mapa da descoberta em telas estreitas.
   O mapa é posicionado em porcentagens sobre uma área com proporção fixa, mas
   os cartões têm altura própria em pixels. Abaixo de ~560px a área encolhe e os
   cartões não: em homologação, no iPhone SE, os cinco nós caíram todos por cima
   da caixa central — justamente a que guarda a frase do paciente.
   Aqui o mapa passa a empilhar: mesma ordem, mesmos rótulos, mesmas cores,
   com a frase do paciente em primeiro lugar. As linhas de ligação sai de cena
   porque não há mais o que ligar.
   --------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .discovery-map,
  .discovery-map[data-nos] {
    display: flex;
    flex-direction: column;
    gap: 10px;
    aspect-ratio: auto;
    margin-top: 16px;
  }

  .discovery-web { display: none; }

  .discovery-node,
  .discovery-center {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    max-width: none;
    transform: none;
    opacity: 1;
  }

  /* as animações originais deslocam com translate(-50%,-50%); empilhado, só o fade faz sentido */
  .discovery-node { animation-name: surgirEmpilhado; }
  .discovery-center { animation-name: surgirEmpilhado; order: -1; }

  .discovery-node::after { display: none; }

  .discovery-node p { font-size: 13px; }
  .discovery-node-label { font-size: 9.5px; }

  .discovery-center { padding: 16px 16px 14px; }
}

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

/* Alvos de toque: os links do rodapé de crise precisam ser fáceis de acertar */
.crisis-note a {
  display: inline-block;
  padding: 6px 4px;
  min-height: 24px;
}

/* Só os recolhíveis do fluxo do paciente: alvo maior sem mexer no tutorial */
.exemplo > summary,
.guardadas-box > summary,
.later-box > summary,
.danger-box > summary,
.panel > details > summary {
  padding-block: 8px;
}

/* Em textos longos um nó lateral pode encostar na caixa central. A frase do
   paciente nunca fica atrás de um nó: o centro é sempre a camada de cima. */
.discovery-node { z-index: 1; }
.discovery-center { z-index: 2; }

/* ===== Visualização autoral da descoberta (Fase 1) ===== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.visual-opcao {
  text-align: left;
  cursor: pointer;
}

.visual-preview {
  margin-top: 16px;
}

.visual-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.visual-lado {
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.visual-rotulo {
  margin-bottom: 4px;
  color: #8a6d1f;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.visual-texto {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.visual-simbolo {
  color: var(--green);
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}

.visual-nota {
  margin-top: 12px;
  padding: 10px 14px;
  border-left: 4px solid #d8cfba;
  background: #f9f6ee;
}

.visual-nota .visual-texto { font-size: 14.5px; }
.visual-nota:has(.visual-texto:empty) { display: none; }

.visual-insight {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-style: italic;
  margin: 8px 0 2px;
}

.visual-autoria { font-size: 12.5px; }

.visual-final h3 { margin-top: 14px; }
.visual-final h3:first-child { margin-top: 0; }

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

  .visual-preview.comparison .visual-simbolo {
    transform: rotate(90deg);
  }
}

/* ===== Página para levar (v20) ===== */

.takeaway-fecho {
  margin-top: 18px;
  padding: 14px 18px;
  border-left: 4px solid var(--green);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}

.takeaway-frase {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 4vw, 24px);
  line-height: 1.45;
}

.takeaway-frase.editorial {
  font-style: italic;
  font-size: clamp(16px, 3.4vw, 19px);
  color: #4f5f59;
}

.takeaway-confirm {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.takeaway-confirm h3 { margin: 0 0 4px; }

.takeaway-confirm.confirmada {
  border-color: #b9d0c2;
  background: var(--green-2);
}

.takeaway-ok {
  margin: 0;
  color: var(--green);
  font-weight: 750;
  font-size: 17px;
}

.takeaway-nota { margin: 10px 0 0; }

/* ============================================================
   v21 — Linguagem consolidada (handoff 01-tokens)
   Tokens novos convivem com os antigos; as telas migram por etapa.
   ============================================================ */

:root {
  --papel-fundo: #f0eee9;
  --papel-moldura: #f4f1ea;
  --papel-cartao: #fefdfa;
  --borda: #ddd7c9;
  --borda-moldura: #d5cfc0;
  --borda-suave: #e7e2d4;
  --borda-botao: #ccc5b4;
  --tinta: #2b2622;
  --tinta-suave: #5a544a;
  --tinta-meta: #66746f;
  --tinta-inativa: #8f887a;
  --verde-area: #dfece4;
  --terracota: #c4674a;
  --terracota-fundo: #f3ddd2;
  --terracota-texto: #7c3a24;
  --foco: #184f97;
}

/* ===== v21.1 — Fechamento: página para levar ===== */

.panel.pagina-levar {
  max-width: 820px;
  margin-inline: auto;
}

/* T6 — a folha entra inteira, como página já composta */
@keyframes folha-entra {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.pagina-levar.chegando { animation: folha-entra 450ms ease; }

/* T3/T6 — revelações e morph de autoria */
@keyframes rev-a {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes morph-autoria {
  from { opacity: .35; transform: scale(.985); }
  to { opacity: 1; transform: none; }
}

.rev-a { animation: rev-a 600ms ease; }

/* C9 — a folha da prévia de PDF */
.folha {
  margin-top: 18px;
  padding: clamp(22px, 5vw, 44px);
  background: var(--papel-cartao);
  border: 1px solid var(--borda);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(43, 38, 34, .08);
}

.folha-cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--borda);
}

.folha-cabecalho strong {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 17px;
}

.folha-rotulo {
  color: var(--tinta-meta);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.folha section { margin-top: 20px; }
.folha section:first-of-type { margin-top: 0; }

.folha h3 {
  margin: 0 0 6px;
  color: var(--tinta-meta);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.folha p, .folha li {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.folha .autoria {
  margin-top: 4px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--tinta-meta);
  font-size: 12px;
}

.folha .summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.folha .summary-list li {
  padding-left: 12px;
  border-left: 3px solid var(--borda-suave);
  background: none;
  white-space: pre-wrap;
}

/* Fecho em destaque dentro da folha */
.folha .takeaway-fecho {
  margin: 0;
  padding: 10px 0 10px 16px;
  border-left: 4px solid var(--green);
  background: none;
  border-radius: 0;
}

.folha .takeaway-frase {
  font-style: italic;
  font-size: clamp(19px, 4.5vw, 23px);
  line-height: 1.5;
}

/* C6 — chip de escolha do paciente */
.chip-escolha {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--terracota-fundo);
  color: var(--terracota-texto);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.chip-linha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.chip-linha .autoria { margin-top: 0; }

/* C4 — gesto no estado marcado: chip terracota */
.takeaway-confirm.confirmada {
  border-color: var(--terracota);
  background: var(--terracota-fundo);
  animation: morph-autoria 350ms ease;
}

.takeaway-confirm.confirmada .takeaway-ok {
  color: var(--terracota-texto);
}

/* C10 — primário de avanço no fechamento (Gerar PDF) */
.btn-avanco {
  background: var(--tinta);
  border-color: var(--tinta);
  color: var(--papel-cartao);
  font-weight: 700;
  padding: 0 18px;
}

@media (prefers-reduced-motion: reduce) {
  .pagina-levar.chegando,
  .rev-a,
  .takeaway-confirm.confirmada { animation: none !important; }
}

/* ===== v21.2–v21.6 — linguagem consolidada nas etapas ===== */

/* Coreografia de chegada (T1): fade puro, nada se desloca */
.coreo .c-convite, .coreo .c-tarde { opacity: 0; }
.coreo.coreo-convite .c-convite { opacity: 1; transition: opacity 600ms ease; }
.coreo.coreo-pronta .c-convite, .coreo.coreo-pronta .c-tarde { opacity: 1; transition: opacity 600ms ease; }
.coreo.coreo-inicio .c-cedo { animation: folha-entra 400ms ease; }

@media (prefers-reduced-motion: reduce) {
  .coreo .c-convite, .coreo .c-tarde { opacity: 1 !important; transition: none !important; }
  .coreo.coreo-inicio .c-cedo { animation: none !important; }
}

.sub-contador {
  margin: 2px 0 10px;
  color: var(--tinta-meta);
  font-size: 12px;
  font-weight: 700;
}

/* Frase em desaceleração + gesto */
.frase-grande {
  margin: 26px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.4;
}

.gesto-pergunta { margin: 22px 0 4px; font-size: 15px; }

.gesto-ajuste.morph { animation: morph-autoria 350ms ease; }

/* C8 — linhas de caderno (acúmulo) */
.caderno-linhas {
  margin-top: 14px;
  padding-left: 16px;
  border-left: 3px solid var(--borda);
  display: grid;
  gap: 10px;
}

.caderno-linha { padding-bottom: 8px; border-bottom: 1px dashed var(--borda-suave); }
.caderno-linha:last-child { border-bottom: 0; }

.caderno-rotulo {
  color: var(--tinta-meta);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.caderno-texto {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* C5 — mesa de Juntar */
.mesa-area {
  margin-top: 16px;
  padding: 14px;
  min-height: 84px;
  background: var(--verde-area);
  border: 1px dashed rgba(31, 95, 77, .4);
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.mesa-vazia { margin: 6px; color: var(--tinta-meta); font-size: 14px; }

.mesa-area .piece {
  background: var(--terracota-fundo);
  border-color: var(--terracota);
  color: var(--terracota-texto);
  box-shadow: 0 1px 3px rgba(43, 38, 34, .12);
  min-width: min(240px, 100%);
  flex: 0 1 auto;
}

.piece.voando { background: var(--papel-cartao); border-color: var(--borda); color: var(--tinta); }
.piece { will-change: transform; }

/* C7 — aspectos tocáveis */
.aspectos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.aspecto {
  min-height: 44px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--borda);
  background: var(--papel-cartao);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.aspecto.aberto { border-color: var(--terracota); }
.aspecto.preenchido { background: var(--terracota-fundo); border-color: var(--terracota); color: var(--terracota-texto); }
.aspecto-campo { margin-top: 6px; }

/* C11 — escala 0–10 */
.escala { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.escala-num {
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--borda);
  background: var(--papel-cartao);
  font-weight: 700;
  font-size: 15px;
}

.escala-num.marcada { background: var(--terracota-fundo); border-color: var(--terracota); color: var(--terracota-texto); }

/* T5 — oferta de encolher (oferta, não alerta) */
.oferta-menor {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--borda);
  border-radius: 12px;
  background: var(--papel-cartao);
  box-shadow: 0 2px 6px rgba(43, 38, 34, .08);
}

.oferta-menor h3 { margin: 0 0 4px; font-size: 16px; }

.bancada {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 4px solid var(--terracota);
  background: var(--papel-cartao);
  border-radius: 0 10px 10px 0;
  display: grid;
  gap: 10px;
}

/* v21.4 — Entrada */
.hero { display: none; }

.manchete { margin-bottom: 18px; }

.manchete-titulo {
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1.15;
}

.manchete-lead {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--tinta-suave);
  font-size: 16px;
  line-height: 1.6;
}

.journey-card.escolhida {
  border-color: var(--terracota);
  background: var(--terracota-fundo);
}

.comecar-bloco { margin: 14px 0 4px; }

/* v21.6 — trilho: futuras esmaecidas */
.dot { color: var(--tinta-inativa); border-color: var(--borda); }
.dot.done, .dot.current { color: var(--green); border-color: var(--green); }

.autoria {
  color: var(--tinta-meta);
  font-size: 12px;
}

/* v21.7 — glifos das jornadas: sem dourado e sem azul.
   No handoff, os três círculos são iguais (lavagem verde + verde profundo):
   cor com semântica fica reservada ao verde (recurso) e à terracota (escolha do paciente). */
.journey-card.consult .journey-glyph,
.journey-card.resume .journey-glyph {
  border-color: var(--green-2);
  background: #edf5ef;
  color: var(--green);
}

/* v21.7 — "Ver como funciona" é convite do recurso, não escolha do paciente:
   contorno neutro, como no protótipo canônico da Entrada. */
.tutorial-invite .secondary {
  background: transparent;
  border-color: #ccc5b4;
  color: var(--ink);
  font-weight: 600;
}

/* v21.7 — semântica de cor nas telas do percurso: azul e dourado saem.
   (O tutorial "Ver como funciona" e o componente de mapa reservado à Fase 2
   não fazem parte das telas do percurso e ficam como estão.) */
.pill {
  background: var(--papel-profundo, #e7e2d4);
  color: var(--ink);
}

.source-note {
  border-left-color: var(--borda, #ddd7c9);
  background: var(--surface);
}

.notice {
  border-left-color: var(--borda, #ddd7c9);
  background: var(--surface);
}
