:root {
  --bg: #F8FAF9;
  --navy: #183B45;
  --teal: #278579;
  --action: #1F6C62;
  --action-press: #18574F;
  --sage: #E8F3EE;
  --amber: #D99A43;
  --amber-ink: #6E4A12;
  --amber-bg: #FBF6EC;
  --card: #ffffff;
  --line: rgba(24, 59, 69, 0.12);
  --muted: #4E656C;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, sans-serif;
  --phone-scale: 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: #F3F1EA;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--navy);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 5;
}
.skip:focus { top: 12px; }

.stage-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.stage-home {
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.stage-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stage-title strong { font-size: 15px; letter-spacing: -0.02em; }
.stage-title span { font-size: 13px; color: var(--muted); }
.stage-switch { margin-left: auto; display: flex; gap: 8px; }
.stage-switch button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}
.stage-switch button[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
a:focus-visible,
.stage-switch button:focus-visible,
.back:focus-visible,
.btn:focus-visible,
.btn-quiet:focus-visible,
.switch:focus-visible,
.choice:focus-visible,
button.card:focus-visible,
input:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}
.tab:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--action);
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 36px;
}
.stage-fit { height: calc(844px * var(--phone-scale)); }
.bezel {
  width: 390px;
  height: 844px;
  padding: 12px;
  border-radius: 48px;
  background: #183B45;
  box-shadow: 0 24px 60px rgba(24, 59, 69, 0.16);
  transform: scale(var(--phone-scale));
  transform-origin: top center;
}
.glass {
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}
.stage-note {
  max-width: 36rem;
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  text-wrap: balance;
}

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--navy);
}
.island {
  width: 104px;
  height: 22px;
  margin: 10px auto 0;
  border-radius: 20px;
  background: #10262C;
  flex: none;
}
.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 22px 0;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}
.status-icons { display: flex; gap: 5px; align-items: center; }
.scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 20px 16px;
}
.scroll h1,
.scroll h2,
.card h2,
.btn,
.btn-quiet {
  text-wrap: balance;
}
.scroll p,
.scroll li,
.scroll small,
.scroll label,
.lede,
.fine,
.alert-card small,
.setting-copy p {
  text-wrap: pretty;
}
.scroll h1 {
  margin: 4px 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.scroll h1:focus { outline: none; }
.lede { margin: 0 0 18px; font-size: 17px; color: var(--navy); }
.kicker {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.dock {
  flex: none;
  padding: 8px 20px 14px;
  display: grid;
  gap: 8px;
  background: linear-gradient(to top, var(--bg) 70%, rgba(248, 250, 249, 0));
}
.tabs {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: #fff;
  padding-bottom: 6px;
}
.tab {
  min-height: 62px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.tab.is-on { color: var(--action); }
.tab .ico { width: 24px; height: 24px; }

.btn, .btn-quiet {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 0;
  padding: 0 18px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
button.card {
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.btn { background: var(--action); color: #fff; }
.btn:hover { background: var(--action-press); }
.btn:disabled { background: #E4ECEA; color: var(--muted); cursor: not-allowed; }
.btn-quiet {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--action);
  font-weight: 600;
  font-size: 16px;
}
.back .ico { width: 20px; height: 20px; }

.benefits { display: grid; gap: 14px; margin: 8px 0 0; padding: 0; list-style: none; }
.benefits li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  font-size: 17px;
}
.bubble {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--sage);
  color: var(--action);
  display: grid;
  place-items: center;
}
.bubble .ico { width: 24px; height: 24px; }
.benefit-icon { width: 48px; height: 48px; object-fit: contain; }
.mascot { display: block; height: auto; pointer-events: none; }
.mascot.wave { width: 128px; margin: 2px auto 6px; }
.mascot.smile { width: 96px; margin: 0 auto 4px; }
.mascot.concern { width: 104px; margin: 0 0 8px; }
.mascot.reassure { width: 104px; margin: 4px auto 10px; }
.mascot.mark { width: 32px; height: 32px; margin: 0; object-fit: contain; }
.home-mark { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; }
.home-mark .kicker { margin: 0; }

.field { display: grid; gap: 8px; margin: 8px 0 18px; font-weight: 600; font-size: 15px; }
.field input {
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 500;
}
.steps { display: grid; gap: 10px; margin: 12px 0 0; }
.step {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 16px;
}
.step b { font-weight: 600; }
.step span { color: var(--muted); text-align: right; }
.step.is-done span { color: var(--action); font-weight: 600; }
.step.is-wait span { color: var(--muted); font-weight: 600; }

.check {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  margin: 16px 0;
  font-size: 17px;
}
.check input { width: 28px; height: 28px; accent-color: var(--action); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin: 0 0 12px;
}
.card.sage { background: var(--sage); border-color: transparent; }
.card.warn { background: var(--amber-bg); border-color: rgba(217, 154, 67, 0.45); }
.card h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.02em; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.card.warn p, .card.sage p { color: var(--navy); }
.who { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 24px;
  flex: none;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--action);
  font-size: 14px;
  font-weight: 600;
}
.pill.warn { color: var(--amber-ink); background: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.dot.warn { background: var(--amber); }

.section-label {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.row, .linkish {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px 14px;
  margin: 0 0 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.linkish { cursor: pointer; }
.row strong, .linkish strong { font-size: 16px; font-weight: 600; }
.row small, .linkish small { grid-column: 1; color: var(--muted); font-size: 14px; }
.chev { color: var(--muted); grid-row: 1 / span 2; }

.meta { display: grid; gap: 10px; margin-top: 8px; }
.meta div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; text-align: right; }

.block { margin: 0 0 16px; }
.block h2 { margin: 0 0 6px; font-size: 18px; }
.block p { margin: 0; font-size: 17px; color: var(--navy); }

.alert-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.alert-card > span { flex: 1; min-width: 0; display: grid; gap: 4px; }
.alert-card strong { font-size: 17px; }
.alert-card small { color: var(--navy); font-size: 15px; line-height: 1.35; }
.alert-card > .ico { flex: none; color: var(--muted); width: 22px; height: 22px; }

.setting {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.setting-copy { flex: 1; min-width: 0; }
.setting-copy strong { display: block; font-size: 17px; }
.setting-copy p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--action);
}
.tag.off,
.tag.soon { color: var(--muted); }

.switch {
  width: 64px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  border: 0;
  background: #D5DEDB;
  position: relative;
}
.switch i {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}
.switch.is-on { background: var(--action); }
.switch.is-on i { transform: translateX(20px); }
.switch:disabled { opacity: 0.55; cursor: not-allowed; }

.choice {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
}
.choice input { width: 28px; height: 28px; accent-color: var(--action); }
fieldset.choices { border: 0; margin: 8px 0 0; padding: 0; min-inline-size: 0; }
fieldset.choices legend { padding: 0; }
.choice.is-disabled { color: var(--muted); }

.locked {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.locked div {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #F1F4F3;
  color: var(--muted);
  font-size: 15px;
}
.locked .ico { flex: none; width: 20px; height: 20px; }
.locked div span { flex: 1; min-width: 0; }
.locked div b { flex: none; margin-left: auto; white-space: nowrap; font-weight: 600; color: var(--muted); }
.fine { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.hero-status {
  text-align: center;
  padding: 22px 16px 18px;
}
.hero-status h1 { font-size: 34px; margin: 8px 0; text-wrap: balance; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skel-stack { display: grid; gap: 12px; }
.bone {
  display: block;
  height: 14px;
  border-radius: 8px;
  background: rgba(24, 59, 69, 0.1);
  position: relative;
  overflow: hidden;
}
.bone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0%, rgba(248, 250, 249, 0.85) 46%, transparent 90%);
  transform: translateX(-100%);
  animation: bone-shine 1.3s ease-in-out infinite;
}
.bone.w-30 { width: 34%; }
.bone.w-55 { width: 58%; }
.bone.w-80 { width: 86%; }
.bone.title { height: 36px; width: 78%; border-radius: 10px; }
.bone.cardish { height: 108px; border-radius: 20px; }
.bone.rowish { height: 64px; border-radius: 16px; }
.bone.btnish { height: 56px; border-radius: 16px; }
@keyframes bone-shine { 100% { transform: translateX(100%); } }
.shield {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 24px;
  background: #fff;
  color: var(--action);
  display: grid;
  place-items: center;
}
.shield .ico { width: 36px; height: 36px; }
.ico { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Upgrade additions ---------- */
.stage-scenarios {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
}
.stage-scenarios span { font-size: 14px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.stage-scenarios button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}
.stage-scenarios button:hover { border-color: var(--action); color: var(--action); }
.stage-scenarios button:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

.bubble.warn { background: #fff; color: var(--amber-ink); }
.alert-card .bubble { flex: none; width: 44px; height: 44px; border-radius: 14px; }

.who-card { display: grid; gap: 10px; }
.who-card strong { display: block; font-size: 18px; margin-bottom: 6px; }
.who-card small { color: var(--muted); font-size: 14px; }
.avatar.sm { width: 40px; height: 40px; font-size: 20px; background: var(--sage); }
.who-card .avatar { background: var(--sage); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 4px; }
.stats div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
}
.stats b { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; color: var(--action); }
.stats span { font-size: 14px; color: var(--muted); line-height: 1.3; }

.row.win { background: var(--sage); border-color: transparent; }
.row.win strong::before { content: "★ "; color: var(--action); }

.linkish { grid-template-columns: auto 1fr auto; gap: 12px; }
.linkish .bubble { width: 40px; height: 40px; border-radius: 12px; }
.linkish-copy { display: grid; gap: 2px; min-width: 0; }
.linkish small { grid-column: auto; }
.linkish > .ico { color: var(--muted); }

.big-choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  margin: 0 0 10px;
  padding: 12px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}
.big-choice strong { display: block; font-size: 20px; letter-spacing: -0.01em; }
.big-choice small { display: block; color: var(--muted); font-size: 15px; }
.big-choice .bubble { flex: none; }
.big-choice:hover { border-color: var(--action); }
.big-choice:focus-visible, .linkish:focus-visible, .add-row:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
[data-screen="parent"] .big-choice:first-of-type { background: var(--action); color: #fff; border-color: var(--action); }
[data-screen="parent"] .big-choice:first-of-type small { color: rgba(255, 255, 255, 0.85); }
[data-screen="parent"] .big-choice:first-of-type .bubble { background: rgba(255, 255, 255, 0.16); color: #fff; }

.win-card { display: flex; align-items: center; gap: 12px; }
.win-card strong { display: block; font-size: 18px; }
.win-card small { color: var(--navy); font-size: 15px; }
.mascot.tiny { width: 56px; flex: none; }

.ticks { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.ticks li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 17px; align-items: start; }
.ticks .ico { color: var(--action); margin-top: 2px; }

.person {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 10px 14px;
  margin: 0 0 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.person strong { display: block; font-size: 16px; }
.person small { color: var(--muted); font-size: 14px; }
.person.is-pending { border-style: dashed; background: transparent; }
.add-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin: 0 0 14px;
  padding: 0 14px;
  border: 1px dashed rgba(24, 59, 69, 0.3);
  border-radius: 16px;
  background: transparent;
  color: var(--action);
  font-weight: 600;
}
.log { display: grid; gap: 6px; }
.log p { margin: 0; font-size: 14px; color: var(--muted); padding-left: 12px; border-left: 2px solid var(--line); }

.word-card {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 18px;
  margin: 4px 0 18px;
  border-radius: 20px;
  background: var(--navy);
  color: #fff;
}
.word-card span { font-size: 14px; font-weight: 600; opacity: 0.8; }
.word-card b { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.15; letter-spacing: 0.01em; }
.word-card.big b { font-size: 34px; }
.word-card .btn-quiet { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.btn-quiet.small { width: auto; min-height: 44px; font-size: 15px; padding: 0 16px; margin-top: 4px; }
.btn-quiet .ico, .btn .ico { display: inline-block; vertical-align: -4px; margin-right: 6px; width: 20px; height: 20px; }

.check.big {
  grid-template-columns: 32px 1fr;
  min-height: 72px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 18px;
}
.check.big input { width: 30px; height: 30px; }

.plain { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.plain li { font-size: 16px; color: var(--navy); }

.bubble-msg {
  margin: 4px 0 16px;
  padding: 14px 16px;
  border-radius: 20px 20px 20px 6px;
  background: #E9EDEC;
  max-width: 92%;
}
.bubble-msg small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.bubble-msg p { margin: 0; font-size: 17px; }

.promise {
  margin: 4px 0 18px;
  padding: 18px;
  border-radius: 20px;
  background: var(--sage);
  border-left: 4px solid var(--action);
}
.promise span { font-size: 14px; font-weight: 600; color: var(--muted); }
.promise p { margin: 6px 0; font-family: var(--serif); font-size: 24px; line-height: 1.25; }
.promise small { color: var(--muted); font-size: 14px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

@media (max-width: 560px) {
  .stage-scenarios { padding: 0 12px; margin-top: 12px; }
  .stage-bar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .stage-switch { width: 100%; margin-left: 0; }
  .stage-switch button { flex: 1; }
  .stage { padding: 0; }
  .stage-fit { height: auto; width: 100%; }
  .bezel {
    width: 100%;
    height: calc(100dvh - 118px);
    transform: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .glass { border-radius: 0; }
  .stage-note { padding: 0 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .switch i { transition: none; }
  .bone::after { animation: none; transform: none; opacity: 0.35; }
}
