/* ============================================================
   Journey app — visual reskin only.
   The interactive app (script in journey.html) generates markup
   via JS template strings that reference a small set of CSS custom
   properties by name (--gold, --ink, --line, --muted, --panel,
   --sage, --danger). We alias those names to the shared design
   tokens here so the untouched app logic renders in the new
   AfterLife visual system without any JS being modified.
   ============================================================ */

:root, [data-theme="light"] {
  --gold: var(--color-accent);
  --ink: var(--color-text);
  --line: var(--color-border);
  --muted: var(--color-text-muted);
  --panel: var(--color-surface);
  --sage: var(--color-primary);
  --danger: #A13544;
}
[data-theme="dark"] {
  --danger: #D9707F;
}

/* ============ Layout shell ============ */
.journey-wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: calc(clamp(var(--space-10), 6vw, var(--space-16)) + 2rem) clamp(var(--space-5), 4vw, var(--space-10)) clamp(var(--space-16), 8vw, var(--space-24));
  font-family: var(--font-body);
  color: var(--color-text);
}
.journey-wrap .serif {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}
.journey-wrap em { font-style: italic; color: var(--color-accent); }
.journey-wrap h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  text-align: center;
  margin: var(--space-2) 0 var(--space-1);
}
.journey-wrap .sub {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  max-width: 34rem;
  margin: 0 auto var(--space-5);
}

/* ============ Cards ============ */
.stagecard {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  max-width: 40rem;
  margin: var(--space-3) auto;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.stagecard:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); }
.stagecard h3 { margin: 0.15rem 0 0.3rem; color: var(--color-primary); font-family: var(--font-display); }
.stagecard .price { color: var(--color-accent); font-weight: 700; font-size: var(--text-xs); }
.stagecard .st { font-size: var(--text-xs); color: var(--color-text-muted); }
.stagecard.done { border-color: var(--color-primary); }

.qcard {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  max-width: 40rem;
  margin: var(--space-4) auto;
  box-shadow: var(--shadow-md);
}
.qcard .stg { font-size: var(--text-xs); letter-spacing: 0.09em; color: var(--color-accent); font-weight: 700; text-transform: uppercase; }
.qcard h2 { font-family: var(--font-display); font-size: var(--text-xl); margin: var(--space-2) 0 var(--space-2); color: var(--color-text); font-weight: 600; }
.qcard .why { color: var(--color-text-muted); font-size: var(--text-sm); margin: 0 0 var(--space-4); }

.donebox {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  max-width: 40rem;
  margin: var(--space-4) auto;
  box-shadow: var(--shadow-sm);
}

.offer {
  background: var(--color-accent-highlight);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  max-width: 40rem;
  margin: var(--space-3) auto;
}
.offer h4 { margin: 0 0 var(--space-2); color: var(--color-accent); font-family: var(--font-display); font-weight: 600; }
.offer p { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--color-text); }

.quiet {
  background: var(--color-primary-highlight);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-3) var(--space-4);
  max-width: 40rem;
  margin: var(--space-3) auto;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.quiet b { color: var(--color-primary); }

/* ============ Buttons & inputs ============ */
.btn {
  display: block; width: 100%; flex: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: var(--text-base);
  margin: var(--space-2) 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: border-color var(--transition);
}
.btn:hover { border-color: var(--color-accent); }
.btn.gold {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-onphoto);
  font-weight: 700;
  text-align: center;
}
.btn.gold:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.btn.ghost, .journey-wrap .btn.ghost, .journey-wrap .btn.gold { text-align: center; display: block; }

.b2 {
  display: inline-block;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.8rem;
  font-size: var(--text-xs);
  margin: 0.25rem 0.35rem 0.25rem 0;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color var(--transition);
}
.b2:hover { border-color: var(--color-accent); }
.skip { color: var(--color-text-muted); font-size: var(--text-xs); cursor: pointer; text-decoration: underline dotted; }
.prog { max-width: 40rem; margin: 0 auto var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); text-align: center; }
.txt {
  width: 100%;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.75rem;
  font-size: var(--text-base);
  font-family: var(--font-body);
}
.mut { color: var(--color-text-muted); }
.center { text-align: center; }
.small { font-size: var(--text-xs); color: var(--color-text-muted); max-width: 40rem; margin: var(--space-2) auto; }

/* ============ class-contract completion (engine-emitted classes) ============ */
.journey-wrap .opt {
  display: block; width: 100%; text-align: left;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  font-size: var(--text-base);
  margin: var(--space-2) 0;
  background: var(--color-surface-2);
  color: var(--color-text);
  cursor: pointer;
  font-family: var(--font-body);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), background var(--transition);
}
.journey-wrap .opt:hover { border-color: var(--color-accent); }
.journey-wrap .opt.on { border-color: var(--color-accent); background: var(--color-accent-highlight); font-weight: 600; }
.journey-wrap .laws { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-4) 0 var(--space-1); justify-content: center; }
.journey-wrap .law { border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: 0.4rem 0.75rem; font-size: var(--text-xs); color: var(--color-text-muted); }
.journey-wrap .lead { color: var(--color-text-muted); max-width: 40rem; font-size: var(--text-lg); margin: 0 auto; text-align: center; }
.journey-wrap .map { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: var(--space-6); }
.journey-wrap .stagecard .n { font-size: var(--text-xs); letter-spacing: 0.1em; color: var(--color-accent); font-weight: 700; }
.journey-wrap .price { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-2); border-top: 1px dashed var(--color-border); padding-top: var(--space-2); }
.journey-wrap .price .free { display: block; color: var(--color-primary); font-weight: 700; font-size: var(--text-sm); }
.journey-wrap .price .addon { display: block; color: var(--color-text-muted); font-size: var(--text-xs); margin-top: 0.3rem; }
.journey-wrap .laws .law.headline { border-color: var(--color-primary); color: var(--color-primary); font-weight: 700; background: var(--color-primary-highlight); }
.journey-wrap .why { color: var(--color-text-muted); font-size: var(--text-sm); }
.journey-wrap .head, .journey-wrap .meta, .journey-wrap .foot { color: var(--color-text-muted); font-size: var(--text-xs); }
.journey-wrap .promise { color: var(--color-primary); font-weight: 600; }
.journey-wrap .w { font-weight: 700; color: var(--color-text); }
.journey-wrap .pulled { display: none; }

@media (max-width: 640px) {
  .journey-wrap h1 { font-size: var(--text-xl); }
  .qcard, .donebox { padding: var(--space-5); }
}

/* stage-map symmetry (Daniel-approved) */
/* RULED: the five stages are full-width horizontal bands stacked vertically —
   this supersedes the 3+2 card grid for the stage map only. The glosses stay. */
.journey-wrap .map,.map{display:flex;flex-direction:column;gap:10px;max-width:52rem;margin:0 auto;grid-template-columns:none}
.journey-wrap .map .stagecard,.map .stagecard{
  flex:0 0 auto;width:100%;max-width:none;margin:0;
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;
  gap:var(--space-3) var(--space-5);
  padding:var(--space-5) var(--space-6);
  text-align:left;
}
.journey-wrap .map .stagecard .n,.map .stagecard .n{grid-row:1;grid-column:1;align-self:center;white-space:nowrap}
.journey-wrap .map .stagecard h3,.map .stagecard h3{grid-row:1;grid-column:2;margin:0}
.journey-wrap .map .stagecard .st,.map .stagecard .st{grid-row:1;grid-column:3;justify-self:end;white-space:nowrap}
.journey-wrap .map .stagecard p,.map .stagecard p{grid-row:2;grid-column:2;margin:2px 0 0}
@media(max-width:680px){
  .journey-wrap .map .stagecard,.map .stagecard{grid-template-columns:1fr auto}
  .journey-wrap .map .stagecard .n,.map .stagecard .n{grid-row:1;grid-column:1}
  .journey-wrap .map .stagecard .st,.map .stagecard .st{grid-row:1;grid-column:2}
  .journey-wrap .map .stagecard h3,.map .stagecard h3{grid-row:2;grid-column:1/-1}
  .journey-wrap .map .stagecard p,.map .stagecard p{grid-row:3;grid-column:1/-1}
}

/* ============================================================
   THE FRONT DOOR — porch, warm card and the 60-second example.
   Existing tokens and the journey's own components only; this
   places the new sequence, it does not restyle the app.
   ============================================================ */
.porch-card {
  max-width: 40rem; margin: 0 auto var(--space-10); text-align: center;
}
.porch-card h1 { margin-bottom: var(--space-4); }
.porch-card .btn.gold.big {
  display: inline-block; width: auto; min-width: 16rem;
  margin-top: var(--space-8); padding: var(--space-4) var(--space-8); font-size: var(--text-base);
}
.porch-meta { margin-top: var(--space-5); font-size: var(--text-xs); color: var(--color-text-muted); }
.porch-sub { margin-top: var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); }
.porch-sub a { color: inherit; text-decoration: underline dotted; }
.warm-free { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--color-text-muted);
  max-width: 34rem; margin-inline: auto; }

.porch-sec { max-width: 46rem; margin: 0 auto var(--space-12); text-align: center; }
.porch-sec h2 { font-size: var(--text-xl); margin-bottom: var(--space-4); }

.stageline { display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text); }
.stageline i { color: var(--color-accent); font-style: normal; }
.stageline + .lead { margin-top: var(--space-6); }

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5);
  margin-top: var(--space-6); text-align: left; }
.level { border: 1px solid var(--color-border); border-radius: 14px; padding: var(--space-5); }
.level h4 { color: var(--color-primary); font-family: var(--font-display);
  font-size: var(--text-lg); margin-bottom: var(--space-2); }
/* RULED: comfortable reading weight — up from small/muted to body size and full text colour. */
.level p { font-size: var(--text-base); color: var(--color-text); line-height: 1.6; }

.catrow { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2);
  margin-top: var(--space-5); }
.cat-chip { border: 1px solid var(--color-border); border-radius: 999px;
  padding: 0.3rem 0.85rem; font-size: var(--text-xs); color: var(--color-text-muted); }

.exwrap { margin-top: var(--space-6); }
.exstep { border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface);
  padding: var(--space-6); text-align: left; }
.exmeta { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-text-muted); margin-bottom: var(--space-2); }
.exans { display: inline-block; margin-top: var(--space-3); border: 1px solid var(--color-accent);
  border-radius: 999px; padding: 0.3rem 0.9rem; font-size: var(--text-sm); color: var(--color-text); }
.excap { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--color-text-muted); }
.exurgent { margin-top: var(--space-5); border-left: 3px solid var(--color-accent);
  padding-left: var(--space-4); }
.exurgent b { color: var(--color-primary); font-size: var(--text-sm); }
.exurgent p { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }
.explan { list-style: none; margin-top: var(--space-4); display: flex; flex-direction: column;
  gap: var(--space-2); font-size: var(--text-sm); }
.explan b { color: var(--color-primary); }
.exstep .btn.gold { display: inline-block; width: auto; margin-top: var(--space-5); }

@media (max-width: 780px) {
  .levels { grid-template-columns: 1fr; }
  .porch-card .btn.gold.big { display: block; width: 100%; min-width: 0; }
}
.whyask { margin: 0 0 var(--space-3); }
.whyask summary { cursor: pointer; font-size: var(--text-xs); color: var(--color-text-muted);
  text-decoration: underline dotted; list-style: none; }
.whyask summary::-webkit-details-marker { display: none; }
.whyask p { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); }
.exstep .btn.ghost.exnext { display: inline-block; width: auto; margin-top: var(--space-5); }
.porch-card .btn.ghost.porch-alt {
  display: inline-block; width: auto; min-width: 16rem;
  margin-top: var(--space-4); padding: var(--space-4) var(--space-8); font-size: var(--text-base);
}
@media (max-width: 780px) { .porch-card .btn.ghost.porch-alt { display: block; width: 100%; min-width: 0; } }

/* Late-entry bands on the porch — the map's bands, quieter, no status pill
   (nothing has been started yet, so five "Not started" chips would be noise). */
.porch-later { margin-top: var(--space-8); }
.journey-wrap .map--porch, .map--porch { margin-top: var(--space-4); text-align: left; }
.map--porch .stagecard { box-shadow: none; }
.map--porch .stagecard .n { color: var(--color-accent); }
/* multi_text — repeatable entries, each stored independently. */
.mtrow { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); flex-wrap: wrap; }
.mtlab { flex: 0 0 100%; font-size: var(--text-xs); color: var(--color-text-muted); }
.mtrow .mtin { flex: 1 1 14rem; }
.mtdel { flex: 0 0 auto; }

/* Stage-close action group — three distinct actions, together, above everything
   secondary. Gold = suppliers, green = next stage, outlined = the five-stage plan. */
.actiongroup { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-4) 0 var(--space-6); }
.actiongroup .btn.act { flex: 1 1 12rem; display: block; width: auto; margin: 0; text-align: center; }
.act--gold  { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.act--green { background: var(--color-primary); border-color: var(--color-primary); color: #F2EADA; }
.act--out   { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
@media (max-width: 640px) { .actiongroup .btn.act { flex: 1 1 100%; } }
/* "Something else" expands here, on the same screen, beneath the list. */
.inlinefollow { margin-top: var(--space-5); padding: var(--space-4) var(--space-5);
  border: 1px dashed var(--color-border); border-radius: 12px; background: var(--color-surface); }
.inlinefollow-q { font-size: var(--text-sm); color: var(--color-text); margin-bottom: var(--space-2); }

/* Funeral & Celebration Builder */
.buildhead { display:flex; justify-content:space-between; align-items:center; gap:var(--space-4);
  max-width:46rem; margin:0 auto var(--space-6); }
.buildtag { font-size:var(--text-xs); letter-spacing:.08em; text-transform:uppercase; color:var(--color-text-muted); }
.buildroutes { display:flex; flex-direction:column; gap:var(--space-3); margin-top:var(--space-6); }
.buildroutes .btn.act { display:block; width:100%; text-align:left; padding:var(--space-4) var(--space-5); }
.buildroutes .btn.act span { display:block; margin-top:4px; font-weight:400; font-size:var(--text-xs); opacity:.85; }
.specform { max-width:46rem; margin:0 auto; text-align:left; }
.speclab { display:block; margin-bottom:var(--space-4); font-size:var(--text-xs);
  letter-spacing:.06em; text-transform:uppercase; color:var(--color-text-muted); }
.speclab .txt { display:block; margin-top:5px; width:100%; text-transform:none; letter-spacing:0;
  font-size:var(--text-base); color:var(--color-text); }

/* Card headings sit centred in their box. They were inheriting the journey's
   centred axis for the text but keeping a left-aligned heading block, so the
   heading drifted off the card's centre. Applied to every equivalent card. */
.offer, .donebox, .quiet { text-align: center; }
.offer h4, .donebox h2, .donebox h4, .quiet b {
  display: block; text-align: center; margin-inline: auto;
}
.offer p, .donebox p, .quiet p { text-align: center; margin-inline: auto; }
/* Cards whose content is genuinely a list stay left-aligned inside. */
.offer ul, .donebox ul, .quiet ul { text-align: left; }

/* Two different kinds of tap, two different controls. The business name is the
   card's heading action and stays inside AfterLife; Website leaves us, so it is
   secondary and outlined with the arrow, matching the marketplace's outbound
   styling. They used to share the .b2 class and read as the same button. */
.sup-name-action {
  display: block; margin: var(--space-2) 0 var(--space-1);
  font-family: var(--font-display); font-size: var(--text-base); font-weight: 600;
  color: var(--color-text); cursor: pointer; line-height: 1.3;
}
.sup-name-action:hover { color: var(--color-primary); }
.sup-name-action.on { color: var(--color-primary); }
.sup-visit {
  display: inline-flex; align-items: center; gap: 0.3rem;
  margin: 0 var(--space-2) var(--space-2) 0; padding: 0.25rem 0.7rem;
  border: 1px solid var(--color-border); border-radius: 999px;
  font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted);
  text-decoration: none; background: transparent;
}
.sup-visit:hover { border-color: var(--color-accent); color: var(--color-accent); }
/* The send action says what it will do, before it is tapped. */
.sendnote { max-width: 46rem; margin: calc(var(--space-2) * -1) auto var(--space-4);
  font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.55; text-align: left; }
