:root {
  --navy: #102f73;
  --text: #203064;
  --muted: #4f5a84;
  --purple: #9b72d0;
  --pink: #ef6b9a;
  --orange: #ff862d;
  --yellow: #ffc532;
  --green: #73aa43;
  --blue: #5aa2dd;
  --paper: #fffdfa;
  --soft-bg: #fffaf4;
  --route: #cdb4e7;
  --line: rgba(155, 114, 208, 0.18);
  --shadow: 0 12px 26px rgba(45, 54, 111, 0.12);
  /* Stronger shades with readable white text, for buttons and selected states. */
  --button-purple: #6d4bb0;
  --button-purple-edge: #4e3388;
  --strong-green: #3f7a1f;
  --strong-orange: #b85600;
  --strong-pink: #c2335f;
  --strong-red: #c62828;
  --strong-blue: #2f6fb0;
  --home-bg: #fffaf2;
  --home-line: #eee3d3;
  --review-bg: #f7f3ec;
  --review-line: #e8e1d6;
  color-scheme: light;
  font-family: "Comic Sans MS", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--home-bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none !important;
}

[hidden] {
  display: none !important;
}

h1,
h2,
p {
  margin: 0;
}

/* The export report uses these base styles, so they stay as they were. */

h2 {
  color: var(--navy);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 9px;
  color: var(--purple);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0;
}

.badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--review-color);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.keep {
  background: var(--green);
}

.badge.change {
  background: var(--orange);
}

.badge.stop {
  background: var(--pink);
}

.summary-text {
  display: -webkit-box;
  overflow: hidden;
  color: var(--navy);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-weight: 800;
  line-height: 1.4;
}

.summary-comment {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.4;
}

.empty-state {
  border: 2px dashed var(--route);
  border-radius: 20px;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
  background: #fff;
}

.print-report {
  display: none;
}

/* ---- Shared controls ---- */

.app-shell,
dialog {
  font-size: 18px;
}

:focus-visible {
  outline: 4px solid rgba(109, 75, 176, 0.35);
  outline-offset: 3px;
}

.button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  padding: 8px 22px;
  font-size: 1.02rem;
  font-weight: 900;
  text-decoration: none;
}

.button.primary {
  background: var(--button-purple);
  color: #fff;
  box-shadow: 0 5px 0 var(--button-purple-edge);
}

.button.primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--button-purple-edge);
}

.button.navy {
  background: var(--navy);
  color: #fff;
}

.button.secondary {
  border: 2px solid var(--home-line);
  background: #fff;
  color: var(--navy);
}

.button.danger {
  border: 2px solid #f1c3d2;
  background: #fff;
  color: var(--strong-pink);
}

.link-button {
  justify-self: start;
  border: 0;
  padding: 6px 0;
  background: none;
  color: var(--strong-blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bar,
.mini,
.progress-track {
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: #efe6d8;
}

.bar > span,
.mini > span,
.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--strong-green);
  transition: width 200ms ease;
}

.bar {
  height: 12px;
}

/* ---- Home: picture map ---- */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-shell.is-review {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.home-view {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--home-bg);
}

.home-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 2px solid var(--home-line);
  background: #fff;
}

.header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.is-review .header-main {
  flex-wrap: nowrap;
}

.is-review .brand {
  display: none;
}

.is-review .header-main > button {
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.brand img {
  width: 30px;
  height: 30px;
}

.brand h1 {
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.2;
}

.who-button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  border: 2px solid var(--home-line);
  border-radius: 999px;
  padding: 0 16px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.home {
  display: grid;
  gap: 22px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 24px 40px;
}

.home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.home-title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
}

.home-lead {
  margin-top: 6px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.45;
}

.overall {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-weight: 800;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.tile {
  --tint: #fff;
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 3px solid transparent;
  border-radius: 26px;
  padding: 12px 12px 16px;
  background: var(--tint);
  color: var(--navy);
  text-align: center;
  box-shadow: 0 8px 18px rgba(80, 60, 20, 0.08);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 26px rgba(80, 60, 20, 0.12);
}

.tile img {
  justify-self: center;
  width: auto;
  max-width: 100%;
  height: 128px;
  object-fit: contain;
}

.tile-label {
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.2;
}

.tile-status {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.tile .bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.tile.empty .tile-status {
  color: var(--button-purple);
}

.tile.complete {
  border-color: var(--strong-green);
}

.tile.complete::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--strong-green);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
}

.export-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 22px;
  padding: 18px 22px;
  background: #f3eefb;
}

.export-bar strong {
  display: block;
  color: var(--navy);
  font-size: 1.1rem;
}

#appIntroTitle {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.export-bar p {
  color: var(--muted);
}

.home-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 44px;
  border-top: 2px solid var(--home-line);
  padding-top: 18px;
}

.privacy-line {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.text-link {
  border: 0;
  padding: 4px;
  background: none;
  color: var(--muted);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--navy);
}

.fineprint {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.privacy-emphasis {
  font-weight: 700;
}

/* ---- Review: one paragraph at a time ---- */

.review-view {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  background: var(--review-bg);
}

.topbar {
  display: grid;
  flex: 1;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.outline-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 2px solid var(--review-line);
  border-radius: 14px;
  padding: 0 16px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}

.progress-track {
  width: 160px;
  height: 10px;
  background: #e6dfd2;
}

.strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 22px 14px;
  scrollbar-width: thin;
}

.topbar .strip {
  min-width: 0;
  padding: 0;
  scrollbar-width: none;
}

.topbar .strip::-webkit-scrollbar {
  display: none;
}

.strip-item {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 6px;
  border: 0;
  padding: 4px 4px 0;
  background: none;
}

.strip-item img {
  display: block;
  width: 58px;
  height: 58px;
  border: 3px solid transparent;
  border-radius: 16px;
  object-fit: cover;
}

.strip-item.current img {
  border-color: var(--navy);
}

.strip-item .mini {
  width: 44px;
  height: 5px;
  background: #e6dfd2;
}

.strip-item.complete::after {
  content: "✓";
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid var(--review-bg);
  border-radius: 50%;
  background: var(--strong-green);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
}

.stage {
  min-height: 0;
  overflow: auto;
  padding: 22px 22px 96px;
  scroll-padding-block: 22px 96px;
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
  gap: 22px;
  min-height: 100%;
  height: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.card {
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 1px 0 var(--review-line), 0 14px 30px rgba(60, 45, 20, 0.07);
}

.paragraph-card {
  --sub: var(--strong-blue);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: 360px;
  padding: 26px 30px;
}

.paragraph-scroller {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-gutter: stable both-edges;
}

.paragraph-scroller:focus-visible {
  outline: 3px solid var(--strong-blue);
  outline-offset: 3px;
  border-radius: 8px;
}

.paragraph-card[data-subsection="strengths"] {
  --sub: var(--strong-green);
}

.paragraph-card[data-subsection="needs"] {
  --sub: var(--strong-pink);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.card-section-icon {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
}

.card-heading {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}

.card-title {
  font-size: clamp(1.35rem, 1.8vw, 1.65rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.chip {
  border-radius: 999px;
  padding: 4px 12px;
  background: color-mix(in srgb, var(--sub) 12%, white);
  color: var(--sub);
  font-size: 0.9rem;
  font-weight: 800;
}

.paragraph-text {
  align-self: center;
  flex-shrink: 0;
  width: 100%;
  max-width: 30ch;
  margin-block: auto;
  overflow-wrap: anywhere;
  text-align: center;
  color: var(--navy);
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 800;
  line-height: 1.45;
}

.decide {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  gap: 12px;
  padding: 24px;
}

.decide-title {
  font-size: 1.15rem;
  line-height: 1.2;
}

.choices {
  container-type: size;
  display: grid;
  grid-template-rows: repeat(3, minmax(80px, 1fr));
  min-height: 260px;
  gap: 10px;
}

.review-comments {
  display: grid;
  gap: 12px;
}

.review-comments .comment-box {
  display: block;
}

.choice {
  --tint: #f5f3df;
  --strong: var(--strong-green);
  --choice-image-min: 66px;
  --choice-image-size: clamp(var(--choice-image-min), calc((100cqh - 20px) / 3 - 14px), min(128px, 28cqw));
  display: grid;
  grid-template-columns: var(--choice-image-size) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  border: 3px solid transparent;
  border-radius: 20px;
  padding: 4px 16px 4px 4px;
  background: var(--tint);
  text-align: left;
  transition: transform 120ms ease;
}

.choice.change {
  --tint: #f3e8ef;
  --strong: var(--button-purple);
}

.choice.stop {
  --tint: #fde9e4;
  --strong: var(--strong-red);
}

.choice:hover {
  transform: translateX(3px);
}

.choice img {
  width: var(--choice-image-size);
  height: var(--choice-image-size);
  border-radius: 16px;
  object-fit: cover;
  object-position: center 18%;
}

.choice strong {
  color: var(--navy);
  font-size: 1.3rem;
}

.choice kbd {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid rgba(16, 47, 115, 0.15);
  border-radius: 8px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
}

.choice.selected {
  border-color: var(--strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--strong) 20%, transparent);
}

.choice.selected kbd {
  border-color: var(--strong);
  background: var(--strong);
  color: #fff;
}

.choice.selected kbd::before {
  content: "✓";
}

.choice.selected kbd span {
  display: none;
}

.comment-field {
  display: block;
}

.comment-label {
  display: block;
  margin: 6px 0;
  color: var(--navy);
  font-weight: 800;
}

.comment-label small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.comment-box,
.text-input,
.editor-grid textarea {
  width: 100%;
  border: 2px solid var(--review-line);
  border-radius: 16px;
  background: #fffdf9;
  color: var(--text);
  outline: none;
}

.comment-box {
  min-height: 64px;
  padding: 12px 14px;
  line-height: 1.45;
  resize: none;
  overflow: hidden;
}

.text-input {
  min-height: 56px;
  padding: 0 16px;
  font-size: 1.1rem;
}

.comment-box:focus,
.text-input:focus,
.editor-grid textarea:focus {
  border-color: var(--navy);
  background: #fff;
}

.checkpoint {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 10px 0 20px;
}

.checkpoint-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(760px, 100%);
  padding: 36px;
  text-align: center;
}

.checkpoint-emoji {
  font-size: 3rem;
  line-height: 1;
}

.checkpoint-title {
  font-size: 2rem;
  line-height: 1.15;
}

.checkpoint-text {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.45;
}

.checkpoint-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.checkpoint-actions .button.secondary {
  border-color: var(--review-line);
}

.tally {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.tally-item {
  --tint: #f5f3df;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 130px;
  border-radius: 18px;
  padding: 12px;
  background: var(--tint);
  color: var(--muted);
  font-weight: 800;
}

.tally-item.change {
  --tint: #f3e8ef;
}

.tally-item.stop {
  --tint: #fde9e4;
}

.tally-item img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center 18%;
}

.tally-item strong {
  color: var(--navy);
  font-size: 1.8rem;
  line-height: 1;
}

.review-navigation {
  position: fixed;
  right: 22px;
  bottom: 16px;
  left: 22px;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.review-navigation .button {
  flex-shrink: 0;
  min-height: 58px;
  padding: 10px 28px;
  font-size: 1.1rem;
  pointer-events: auto;
}

.review-navigation .button.secondary {
  border-color: var(--review-line);
  box-shadow: 0 6px 18px rgba(16, 47, 115, 0.14);
}

.review-navigation .next {
  min-width: 200px;
}

.next-control {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  pointer-events: auto;
}

.next-control.is-disabled {
  cursor: not-allowed;
}

.next-control.is-disabled .next {
  pointer-events: none;
}

.next-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(280px, calc(100vw - 28px));
  border-radius: 10px;
  padding: 10px 14px;
  background: #f3eefb;
  color: var(--button-purple-edge);
  box-shadow: 0 6px 18px rgba(109, 75, 176, 0.16);
  font-size: 0.9rem;
  line-height: 1.4;
  visibility: hidden;
}

.next-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 24px;
  border-top: 7px solid #f3eefb;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
}

.next-control.is-disabled:not(.tooltip-dismissed):hover .next-tooltip,
.next-control.is-disabled:not(.tooltip-dismissed):focus-within .next-tooltip {
  visibility: visible;
}

/* ---- Dialogs ---- */

dialog {
  border: 0;
  padding: 0;
  color: var(--text);
}

dialog::backdrop {
  background: rgba(16, 47, 115, 0.35);
}

.dialog-title {
  font-size: 1.5rem;
  line-height: 1.2;
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.dialog-field {
  display: grid;
  gap: 2px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.close-button {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 2px solid var(--review-line);
  border-radius: 14px;
  background: #fff;
  color: var(--navy);
  font-size: 1.2rem;
}

.names-dialog,
.privacy-dialog {
  width: min(620px, calc(100vw - 32px));
  border-radius: 24px;
}

.privacy-dialog-body {
  display: grid;
  gap: 12px;
}

.plan-dialog {
  width: min(1180px, calc(100vw - 24px));
  max-width: none;
  height: min(760px, calc(100vh - 24px));
  max-height: none;
  border-radius: 28px;
  background: var(--review-bg);
}

.editor-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  height: 100%;
  padding: 22px 24px;
}

.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-strip {
  flex: 1;
  min-width: 0;
  padding: 0 0 4px;
}

.editor-section {
  display: flex;
  align-items: center;
  gap: 18px;
}

.editor-section > div {
  min-width: 0;
  overflow-wrap: break-word;
}

.editor-section img {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 20px;
  object-fit: cover;
}

.editor-section h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.8rem;
  line-height: 1.2;
}

.editor-section p {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.45;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
}

.editor-grid label {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.editor-grid textarea {
  height: 100%;
  min-height: 0;
  padding: 12px 14px;
  line-height: 1.45;
  resize: none;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-hint {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.editor-actions .button.secondary {
  border-color: var(--review-line);
}

/* ---- Smaller screens ---- */

@media (max-width: 1400px) {
  .is-review .progress-track {
    display: none;
  }
}

@media (max-width: 1100px) {
  .is-review .header-main {
    flex-wrap: wrap;
  }

  .topbar {
    order: 1;
    flex-basis: 100%;
  }
}

@media (max-width: 980px) {
  .review-grid {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
  }

  .paragraph-card {
    min-height: 0;
    max-height: clamp(260px, 50dvh, 420px);
  }

  .progress-track {
    width: 90px;
  }
}

@media (max-width: 900px) {
  .plan-dialog {
    height: calc(100vh - 24px);
  }

  .editor-grid {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  .editor-grid label {
    display: block;
    flex: none;
  }

  .editor-grid textarea {
    display: block;
    height: 160px;
  }

  .editor-actions {
    flex-wrap: wrap;
  }

  .editor-hint {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell,
  dialog {
    font-size: 17px;
  }

  .home-header {
    padding: 10px 14px;
    gap: 8px;
  }

  .header-main {
    gap: 8px;
  }

  .brand h1 {
    display: none;
  }

  .home-header .who-button,
  .home-header .button {
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .home {
    padding: 18px 14px 28px;
  }

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

  .tile img {
    height: 84px;
  }

  .tile-label {
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .editor-section {
    gap: 14px;
  }

  .editor-section img {
    width: 72px;
    height: 72px;
  }

  .editor-section h3 {
    font-size: 1.5rem;
  }

  .editor-section p {
    font-size: 1.05rem;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }

  .topbar .progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .progress-track {
    display: none;
  }

  .strip {
    padding: 2px 14px 10px;
  }

  .strip-item img {
    width: 48px;
    height: 48px;
  }

  .stage {
    padding: 14px 14px calc(96px + env(safe-area-inset-bottom));
    scroll-padding-block: 14px calc(96px + env(safe-area-inset-bottom));
  }

  .paragraph-card {
    padding: 20px;
  }

  .card-head {
    gap: 14px;
  }

  .card-section-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .decide {
    padding: 18px;
  }

  .choice {
    --choice-image-min: 60px;
    min-height: 68px;
  }

  .choice kbd {
    visibility: hidden;
  }

  .choice.selected kbd {
    visibility: visible;
  }

  .review-navigation {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 14px;
  }

  .review-navigation .button {
    padding: 10px 18px;
  }

  .review-navigation .next {
    min-width: 0;
  }

  .checkpoint-card {
    padding: 22px;
  }

  .tally {
    gap: 8px;
    width: 100%;
  }

  .tally-item {
    flex: 1;
    min-width: 0;
    padding: 10px 6px;
    font-size: 0.85rem;
  }

  .tally-item img {
    width: 48px;
    height: 48px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    min-height: auto;
    background: #fff;
    color: var(--text);
  }

  body::before {
    display: none;
  }

  .app-shell,
  .names-dialog,
  .plan-dialog,
  .privacy-dialog {
    display: none !important;
  }

  .print-report {
    display: block;
    max-width: none;
    padding: 0;
  }

  .print-report > * + * {
    margin-top: 18px;
  }

  .print-report-header,
  .print-review-item {
    break-inside: avoid;
  }

  .print-report-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    border: 3px solid rgba(155, 114, 208, 0.24);
    border-radius: 22px;
    padding: 18px;
    background: #fff;
  }

  .print-report-header h2 {
    margin-top: 6px;
    font-size: 30px;
  }

  .print-report-meta {
    display: grid;
    gap: 6px;
    min-width: 190px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .print-report-meta strong {
    color: var(--navy);
  }

  .print-section {
    display: block;
    border: 3px solid rgba(155, 114, 208, 0.2);
    border-radius: 22px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.92);
  }

  .print-section > * + * {
    margin-top: 14px;
  }

  .print-section-header {
    display: flex;
    align-items: center;
    break-after: avoid;
    break-inside: avoid;
    gap: 14px;
  }

  .print-section-header img {
    width: auto;
    height: 64px;
    border-radius: 18px;
    box-shadow: 0 5px 10px rgba(45, 54, 111, 0.08);
  }

  .print-section-header h3 {
    margin: 0 0 4px;
    color: var(--navy);
    font-size: 22px;
    line-height: 1.1;
  }

  .print-section-header p {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
  }

  .print-subsection {
    display: block;
  }

  .print-subsection > * + * {
    margin-top: 10px;
  }

  .print-subsection h4 {
    margin: 0;
    border-bottom: 2px dashed rgba(155, 114, 208, 0.45);
    break-after: avoid-page;
    page-break-after: avoid;
    padding-bottom: 6px;
    color: var(--purple);
    font-size: 15px;
  }

  .print-review-item {
    display: grid;
    gap: 7px;
    border: 2px solid rgba(32, 48, 100, 0.1);
    border-radius: 16px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(253, 249, 245, 0.9), #fff);
    box-shadow: none;
  }

  .print-review-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
  }

  .print-review-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .print-review-item .summary-text {
    display: block;
    overflow: visible;
    margin: 0;
    color: var(--navy);
    -webkit-line-clamp: unset;
    font-size: 14px;
    line-height: 1.45;
  }

  .print-review-item .summary-comment {
    color: var(--muted);
    font-size: 12px;
  }

  .badge {
    justify-self: end;
    min-height: 26px;
    padding: 0 9px;
    font-size: 10px;
    white-space: nowrap;
  }
}
