/* My Life Story: one stylesheet for every page.
   Look: a well-made paper journal. Large type, strong contrast, calm colours. */

:root {
  --paper: #fbf6ea;
  --paper-deep: #f1e8d4;
  --sheet: #fffdf8;
  --ink: #1d1a15;
  --ink-soft: #453e33;
  --line: #8a7d68;
  --line-soft: #d9cdb5;
  --green: #17473f;
  --green-dark: #0e332d;
  --green-tint: #e3efe9;
  --you-tint: #fff3d6;
  --red: #8f1d1d;
  --red-tint: #fbe9e4;
  --gold: #7a5200;
  --focus: #1d1a15; /* the ink colour: strong against paper, and ringed in white against green */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --radius: 0.7rem;
  --maxw: 46rem;
}

html { font-size: 20px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.size-2 { font-size: 24px; }
html.size-3 { font-size: 28px; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-wrap: break-word;
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.25; margin: 0 0 0.6rem; font-weight: 700; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.9rem; }
a { color: var(--green); text-decoration-thickness: 0.1em; text-underline-offset: 0.18em; }
a:hover { color: var(--green-dark); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

:focus-visible {
  /* Two tones, so the ring shows on paper and on the green buttons alike. */
  outline: 4px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 10px #fff;
  border-radius: 0.3rem;
}

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

.skip-link {
  position: absolute; left: 0.5rem; top: -6rem; z-index: 20;
  background: var(--ink); color: #fff; padding: 0.8rem 1.1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 0.5rem; color: #fff; }

.wrap, main, .site-header-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
main { padding-top: 1.2rem; padding-bottom: 3rem; display: block; }
main.wide { max-width: 70rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 60px; min-width: 60px;
  padding: 0.6rem 1.3rem;
  font: inherit; font-weight: 700; line-height: 1.25; text-align: center; text-decoration: none;
  color: var(--green-dark);
  background: var(--sheet);
  border: 3px solid var(--green);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover { background: var(--green-tint); color: var(--green-dark); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-quiet { border-width: 2px; border-color: var(--line); color: var(--ink); font-weight: 600; }
.btn-quiet:hover { background: var(--paper-deep); color: var(--ink); }
.btn-small { min-height: 48px; padding: 0.3rem 0.9rem; font-size: 0.9rem; border-width: 2px; border-color: var(--line); color: var(--ink); font-weight: 600; }
.btn-small:hover { background: var(--paper-deep); color: var(--ink); }
.btn-block { display: flex; width: 100%; }
.btn-big { min-height: 76px; font-size: 1.15rem; }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.55; cursor: default; }
.btn[aria-disabled="true"]:hover { background: var(--sheet); }
.btn-primary[aria-disabled="true"]:hover { background: var(--green); }

.icon { display: inline-flex; flex: none; width: 1.5em; height: 1.5em; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1rem 0; }
.btn-row .btn { flex: 1 1 14rem; }
.btn-stack { display: grid; gap: 0.9rem; margin: 1.2rem 0; }

/* ---------- Header and tabs ---------- */

.site-header { background: var(--paper-deep); border-bottom: 2px solid var(--line); }
.site-header-inner { padding-top: 0.6rem; }
.header-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.brand { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; margin: 0; }
.header-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.7rem; }
.tab {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 64px; padding: 0.5rem 0.6rem;
  font-weight: 700; font-size: 1.1rem; line-height: 1.2; text-align: center; text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.tab:hover { background: var(--sheet); color: var(--ink); }
.tab[aria-current="page"] {
  background: var(--green); color: #fff; border-color: var(--green);
  text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.3em;
}

.header-tools a.btn-small { text-decoration: none; }
.header-tools .btn-small[aria-current="page"] { background: var(--green); color: #fff; border-color: var(--green); }

.confirm-bar {
  margin-top: 0.7rem; padding: 0.9rem 1rem;
  background: var(--sheet); border: 2px solid var(--line); border-radius: var(--radius);
}
.confirm-bar p { margin-bottom: 0.6rem; }

.banner {
  background: #fff1c2; color: #3d2c00; border-bottom: 2px solid var(--gold);
  padding: 0.6rem 1rem; text-align: center; font-weight: 600;
}

/* ---------- Messages for the person ---------- */

.notice {
  padding: 0.9rem 1.1rem; margin: 1rem 0;
  border-radius: var(--radius); border: 2px solid var(--line);
  background: var(--sheet);
}
.notice:empty { display: none; }
.notice-error { border-color: var(--red); background: var(--red-tint); color: #4a0d0d; }
.notice-good { border-color: var(--green); background: var(--green-tint); color: var(--green-dark); }
.notice p:last-child { margin-bottom: 0; }

.status-line { min-height: 1.8em; margin: 0.6rem 0; color: var(--ink-soft); font-style: italic; }
.status-line.working::before {
  content: ""; display: inline-block; width: 0.7em; height: 0.7em; margin-right: 0.5em;
  border-radius: 50%; background: var(--green); animation: breathe 1.4s ease-in-out infinite;
}

.help { color: var(--ink-soft); font-size: 1rem; margin: 0.3rem 0 0; }
.lead { font-size: 1.15rem; }

/* ---------- Forms ---------- */

.card {
  background: var(--sheet); border: 2px solid var(--line-soft); border-radius: var(--radius);
  padding: 1.3rem 1.2rem; margin: 1.2rem 0;
  box-shadow: 0 2px 0 rgba(60, 45, 20, 0.08);
}
.field { margin: 0 0 1.4rem; }
.field label, .field .label, legend { display: block; font-weight: 700; margin-bottom: 0.35rem; padding: 0; }
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  display: block; width: 100%;
  font: inherit; color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink-soft); border-radius: 0.5rem;
  padding: 0.7rem 0.8rem; min-height: 60px;
}
textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }

.check {
  display: flex; align-items: center; gap: 0.8rem;
  min-height: 60px; padding: 0.3rem 0; font-weight: 600; cursor: pointer;
}
.check input { width: 1.7rem; height: 1.7rem; flex: none; accent-color: var(--green); margin: 0; }

.choice {
  display: flex; align-items: center; gap: 0.9rem;
  min-height: 68px; padding: 0.7rem 1rem; margin-bottom: 0.7rem;
  background: #fff; border: 3px solid var(--line); border-radius: var(--radius);
  font-weight: 700; cursor: pointer;
}
.choice input { width: 1.7rem; height: 1.7rem; flex: none; accent-color: var(--green); margin: 0; }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-tint); }

.keep-card { border: 3px dashed var(--ink-soft); }
.keep-item { margin: 0 0 1.1rem; }
.keep-item .keep-label { font-weight: 700; display: block; }
.keep-value {
  display: block; font-family: "Courier New", Courier, monospace; font-weight: 700;
  font-size: 1.8rem; line-height: 1.3; letter-spacing: 0.04em; word-break: break-all;
  background: #fff; border: 2px solid var(--line); border-radius: 0.5rem; padding: 0.4rem 0.7rem;
}

/* ---------- Conversation ---------- */

.conversation { list-style: none; margin: 0; padding: 0; }
.msg { margin: 0 0 1.3rem; }
.bubble { padding: 1rem 1.1rem; border-radius: var(--radius); border: 2px solid var(--line-soft); }
.msg-helper .bubble, .msg-draft > .bubble { background: var(--sheet); border-left: 0.5rem solid var(--green); font-size: 1.15rem; }
.msg-you .bubble { background: var(--you-tint); border-color: #d9bd7a; margin-left: 1.2rem; }
.msg-pending .bubble { border-style: dashed; border-color: var(--ink-soft); }
.who { font-size: 1rem; font-weight: 700; color: var(--ink-soft); margin: 0 0 0.3rem; letter-spacing: 0.02em; }
.msg-you .who { margin-left: 1.2rem; }
.bubble p:last-child { margin-bottom: 0; }
.bubble .btn { margin-top: 0.8rem; }
.msg-text p { white-space: pre-wrap; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem; }
.photo-strip img {
  display: block; max-height: 16rem; width: auto; max-width: 100%;
  border: 0.4rem solid #fff; border-radius: 0.2rem; box-shadow: 0 1px 5px rgba(40, 30, 10, 0.35);
  background: var(--paper-deep);
}

/* ---------- The written-up page ---------- */

.sheet-wrap { display: grid; gap: 1rem; margin: 0.6rem 0 1rem; }
.sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  padding: 1.6rem 1.3rem;
  box-shadow: 0 0.2rem 0.9rem rgba(60, 45, 20, 0.22);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.7;
}
.sheet h2, .sheet h3.sheet-title { font-size: 1.6rem; text-align: center; margin-bottom: 1.1rem; }
.sheet p { margin-bottom: 1em; white-space: pre-wrap; }
.sheet p:last-child { margin-bottom: 0; }
.sheet-kind { font-family: var(--sans); font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.6rem; }
.original { background: var(--you-tint); border: 2px solid #d9bd7a; border-radius: var(--radius); padding: 1.1rem; }
.original-item { margin-bottom: 1rem; }
.original-item p { white-space: pre-wrap; margin-bottom: 0.3rem; }
.original-item img { max-height: 10rem; }
@media (min-width: 60rem) {
  .msg-draft.showing-original { width: min(94vw, 76rem); margin-left: 50%; transform: translateX(-50%); }
  .showing-original .sheet-wrap { grid-template-columns: 1fr 1fr; align-items: start; }
}

.honest { margin: 1rem 0; padding: 1rem 1.1rem; background: var(--paper-deep); border-radius: var(--radius); }
.honest h4 { font-size: 1rem; margin: 0.9rem 0 0.2rem; }
.honest ul { margin: 0; padding-left: 1.3rem; }
.honest li { margin-bottom: 0.35rem; }
.honest q, .quoted { font-family: var(--serif); font-weight: 700; }

.draft-actions { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); margin: 1rem 0; }
.draft-actions [data-role="keep"] { grid-column: 1 / -1; }
.more-choices { background: var(--paper-deep); border-radius: var(--radius); padding: 0.8rem 1rem 0.2rem; margin: 0 0 1rem; }
.more-choices > p { margin-bottom: 0; font-weight: 600; }
.more-choices .draft-actions { margin-top: 0.6rem; }
details.earlier { border: 2px solid var(--line-soft); border-radius: var(--radius); background: var(--sheet); }
details.earlier > summary { min-height: 60px; padding: 0.9rem 1.1rem; cursor: pointer; font-weight: 600; }
details.earlier .sheet { box-shadow: none; border: 0; border-top: 1px solid var(--line-soft); }

/* ---------- Talk, Type, Add a photo ---------- */

.composer {
  background: var(--paper);
  border-top: 2px solid var(--line);
  padding: 0.8rem 0 0.9rem;
  margin-top: 0.5rem;
}
@media (min-height: 720px) {
  .composer.is-resting { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -0.6rem 0.8rem -0.6rem rgba(60, 45, 20, 0.3); }
}
.composer-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.composer-buttons .btn { flex-direction: column; gap: 0.2rem; min-height: 84px; padding: 0.5rem 0.3rem; font-size: 1.05rem; }
.composer-buttons .icon { width: 1.9em; height: 1.9em; }
@media (max-width: 26rem) {
  html.size-2 .tab .icon, html.size-3 .tab .icon { display: none; }
  html.size-3 .tab { font-size: 1rem; padding: 0.4rem 0.2rem; }
  html.size-2 .composer-buttons, html.size-3 .composer-buttons { grid-template-columns: 1fr; }
  html.size-2 .composer-buttons .btn, html.size-3 .composer-buttons .btn { flex-direction: row; gap: 0.6rem; min-height: 64px; }
}
.panel { background: var(--sheet); border: 3px solid var(--green); border-radius: var(--radius); padding: 1.1rem; }
.panel h2 { font-size: 1.3rem; }
.revise-note { background: var(--green-tint); border: 2px solid var(--green); border-radius: var(--radius); padding: 0.8rem 1rem; margin-bottom: 0.7rem; }
/* Leave room for the bar at the bottom of the screen when these are scrolled into view. */
.revise-note, #composer-error, .status-line, #pending { scroll-margin-bottom: 11rem; }
#composer-error .btn { margin-top: 0.8rem; }
.revise-note p { margin-bottom: 0.5rem; font-weight: 600; }

.listening { text-align: center; }
.mic-ring {
  width: 7rem; height: 7rem; margin: 0.4rem auto 0.9rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: var(--red); border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(143, 29, 29, 0.5);
  animation: pulse 1.8s ease-out infinite;
}
.mic-ring .icon { width: 3.4rem; height: 3.4rem; }
.live-words {
  min-height: 7rem; max-height: 40vh; overflow-y: auto;
  text-align: left; font-size: 1.2rem;
  background: #fff; border: 2px solid var(--line); border-radius: 0.5rem;
  padding: 0.8rem 0.9rem; margin: 0.8rem 0 1rem;
}
.live-words .interim { color: #5c5547; }
.live-words .placeholder { color: var(--ink-soft); font-style: italic; }
.photo-preview { margin: 0.8rem 0; text-align: center; }
.photo-preview img { max-height: 45vh; border: 0.4rem solid #fff; box-shadow: 0 1px 5px rgba(40, 30, 10, 0.35); }
.file-pick { position: relative; }
.file-pick input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-pick:focus-within { outline: 4px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px #fff, 0 0 0 10px #fff; }

.more { margin-top: 2rem; padding-top: 1.2rem; border-top: 2px solid var(--line-soft); }
.more section { margin-bottom: 1.8rem; }
.memory-list { list-style: none; margin: 0; padding: 0; }
.memory-list li { margin-bottom: 0.6rem; }
.memory-link {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.2rem 1rem;
  min-height: 64px; padding: 0.7rem 1rem;
  background: var(--sheet); border: 2px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
}
.memory-link:hover { background: var(--green-tint); color: var(--ink); }
.memory-link .memory-name { font-weight: 700; text-decoration: underline; }
.memory-link .memory-meta { font-size: 1rem; color: var(--ink-soft); }
.memory-link[aria-current="true"] { border-color: var(--green); border-width: 3px; }

/* ---------- My story (the book) ---------- */

.book-title { text-align: center; font-size: 2.1rem; margin: 1rem 0 0.3rem; }
.book-sub { text-align: center; color: var(--ink-soft); margin-bottom: 1.4rem; }
.chapter {
  background: var(--sheet); border: 1px solid var(--line); border-radius: 0.2rem;
  padding: 1.6rem 1.3rem; margin: 0 0 1.8rem;
  box-shadow: 0 0.2rem 0.9rem rgba(60, 45, 20, 0.18);
}
.chapter-number { font-size: 1rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; text-align: center; margin-bottom: 0.3rem; }
.chapter h2 { text-align: center; font-size: 1.7rem; margin-bottom: 1.1rem; }
.chapter-body { font-family: var(--serif); font-size: 1.2rem; line-height: 1.7; }
.chapter-body p { margin-bottom: 1em; white-space: pre-wrap; }
.chapter-photos { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin: 0 0 1.2rem; }
.chapter-photos img { max-height: 22rem; border: 0.4rem solid #fff; box-shadow: 0 1px 5px rgba(40, 30, 10, 0.35); }
.chapter-tools { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.chapter-edit textarea { min-height: 18rem; font-family: var(--serif); font-size: 1.15rem; }

/* ---------- Admin ---------- */

.table-scroll { overflow-x: auto; margin: 0.5rem 0 2rem; border: 2px solid var(--line-soft); border-radius: var(--radius); background: var(--sheet); }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
caption { text-align: left; font-weight: 700; padding: 0.6rem 0.7rem; font-size: 1rem; }
th, td { padding: 0.5rem 0.7rem; text-align: left; border-top: 1px solid var(--line-soft); white-space: nowrap; }
th { background: var(--paper-deep); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td, tfoot th { font-weight: 700; border-top: 2px solid var(--line); }

/* ---------- Motion ---------- */

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(143, 29, 29, 0.55); }
  70% { box-shadow: 0 0 0 1.6rem rgba(143, 29, 29, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 29, 29, 0); }
}
@keyframes breathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .mic-ring { box-shadow: 0 0 0 0.5rem rgba(143, 29, 29, 0.3); }
  .btn:active { transform: none; }
}

@media (max-width: 22rem) {
  .wrap, main, .site-header-inner { padding-left: 0.7rem; padding-right: 0.7rem; }
  .msg-you .bubble, .msg-you .who { margin-left: 0.5rem; }
  .sheet, .chapter { padding: 1.1rem 0.8rem; }
  .keep-value { font-size: 1.4rem; }
}

/* ---------- Pass 2: time order, the family link, bringing in earlier writing ----------
   One block per feature, so each can be filled in without touching the others. */

.more-section { margin: 2rem 0; padding-top: 1.2rem; border-top: 2px solid var(--line-soft); }
.more-section > h2 { display: flex; align-items: center; gap: 0.5rem; }

/* -- Time order on "My story" (story.js): spans, "Not sure when", pinned chapters -- */

.chapter-when { text-align: center; font-family: var(--serif); font-size: 1.15rem; color: var(--ink-soft); margin: -0.7rem 0 1.2rem; }
.chapter-pinned { display: flex; align-items: center; justify-content: center; gap: 0.4rem; color: var(--ink-soft); font-size: 1rem; margin: 1.2rem 0 0; }
.chapter-pinned .icon { flex: none; }
.order-note { margin: 0 0 1.2rem; text-align: center; color: var(--ink-soft); }
.order-note p { margin: 0 0 0.6rem; }
.when-unsure { margin: 2.4rem 0 1.2rem; padding-top: 1.4rem; border-top: 2px solid var(--line-soft); text-align: center; }
.when-unsure h2 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.when-unsure p { color: var(--ink-soft); margin: 0 auto; max-width: 34rem; }
.when-form { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.when-form .btn-row { margin-bottom: 0; }
.born-card { margin-top: 2.4rem; }
.born-card input[type="text"] { max-width: 9rem; }
#birth-year { max-width: 9rem; }

/* -- The family link, storyteller's side (familyOwner.js; "Questions from your family") -- */

.family-nudge { font-weight: 600; }
.family-requests, .family-list { list-style: none; padding: 0; margin: 0; }
.family-request { border-color: var(--green); border-width: 3px; }
.family-who { font-size: 1.25rem; margin-bottom: 0.5rem; }
.family-question { margin: 0 0 0.9rem; padding: 0.2rem 0 0.2rem 1rem; border-left: 0.35rem solid var(--green); }
.family-question p { font-family: var(--serif); font-size: 1.35rem; line-height: 1.45; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.family-photo { display: block; max-width: 100%; max-height: 50vh; margin: 0.6rem 0 0.9rem; border: 0.4rem solid #fff; box-shadow: 0 1px 5px rgba(40, 30, 10, 0.35); }
.family-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.family-note-who { font-weight: 700; }
/* What a relative typed, at the top of the memory that answers it: framed and headed as
   THEIRS, apart from the story helper's own speech bubbles above and below it. */
.family-said {
  margin: 0.8rem 0; padding: 1rem 1.1rem; border: 3px dashed var(--line); border-radius: var(--radius);
  background: var(--paper-deep); overflow-wrap: anywhere;
}
.family-said-from { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.4rem; }
.family-said .family-who { font-weight: 700; margin: 0 0 0.5rem; }
.family-said .btn { margin-top: 0.6rem; }
.family-remove { margin-top: 0.6rem; }
.family-link-card h4 { margin: 1.4rem 0 0; font-size: 1rem; }
.family-link-url {
  font-family: "Courier New", Courier, monospace; font-weight: 700; font-size: 1.2rem; line-height: 1.5;
  background: var(--green-tint); border: 3px solid var(--green); border-radius: 0.5rem;
  padding: 0.8rem; margin: 0.8rem 0 0; overflow-wrap: anywhere; word-break: break-all; user-select: all; -webkit-user-select: all;
}
.family-answered { padding: 0.9rem 0; border-top: 2px solid var(--line-soft); overflow-wrap: anywhere; }
.family-answered p { margin: 0 0 0.4rem; }
.family-answered-mark { font-weight: 700; color: var(--green-dark); display: flex; align-items: center; gap: 0.4rem; }
.family-print-card { display: none; }
@media print {
  body.print-family-card main > *:not(#family-section),
  body.print-family-card #family-section > h2,
  body.print-family-card #family-root > *:not(.family-body),
  body.print-family-card .family-body > *:not(.family-link-card),
  body.print-family-card .family-link-card > *:not(.family-print-card) { display: none !important; }
  body.print-family-card #family-section, body.print-family-card .family-link-card { border: 0; margin: 0; padding: 0; background: #fff; }
  body.print-family-card .family-print-card { display: block !important; border: 2pt dashed #000; padding: 1.2cm; font-size: 15pt; line-height: 1.5; }
  body.print-family-card .family-print-card h2 { font-size: 22pt; }
  body.print-family-card .family-print-card li { margin-bottom: 0.4cm; }
  body.print-family-card .family-print-url { font-family: "Courier New", Courier, monospace; font-weight: 700; font-size: 13pt; border: 1pt solid #000; padding: 0.4cm; overflow-wrap: anywhere; word-break: break-all; }
}

/* -- The page a relative sees (family.html, family.js; body.family-page) -- */

.family-page main { max-width: 40rem; }
.family-page h1 { font-size: 2rem; margin-top: 0.6rem; }
.family-lead { font-size: 1.25rem; margin-bottom: 1.2rem; }
.family-form .btn-big { margin-top: 0.4rem; }
.family-private { margin-top: 1rem; text-align: center; }
.family-thanks { text-align: center; }
.family-thanks-mark { margin: 0 0 0.4rem; color: var(--green); }
.family-thanks-mark .icon { width: 3.2rem; height: 3.2rem; }

/* -- Bringing in earlier writing (import.js) -- */
.import-body h3 { margin-top: 1.4rem; }
.import-body h4 { font-size: 1.25rem; margin: 1.6rem 0 0.5rem; }
.import-body .btn-stack > div > .help, .import-level > .help { margin: 0.4rem 0.2rem 0; }
.import-list, .import-parts { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 1rem; }
.import-row.card, .import-part.card { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* On a narrow phone with the biggest text, each button takes the full width and wraps its words. */
.import-part .btn-row .btn { flex: 1 1 100%; min-width: 0; white-space: normal; }
.import-paragraphs { list-style: none; margin: 0.8rem 0; padding: 0; display: grid; gap: 0.8rem; }
.import-paragraphs li { border-top: 2px solid var(--line-soft); padding-top: 0.8rem; min-width: 0; }
.import-paragraphs p { font-family: var(--serif); margin: 0 0 0.5rem; overflow-wrap: anywhere; }
.import-name, .import-part-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.import-part-number { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 0.2rem; }
.import-preview {
  font-family: var(--serif); margin: 0.7rem 0; padding-left: 0.9rem; border-left: 4px solid var(--line-soft);
  color: var(--ink-soft); overflow-wrap: anywhere;
}
.import-sample { margin: 1rem 0; }
.import-sample p { overflow-wrap: anywhere; }
.import-levels { display: grid; gap: 1rem; margin: 1rem 0 1.4rem; }
@media (min-width: 52rem) { .import-levels { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.import-part.import-kept { border-color: var(--green); background: var(--green-tint); }
.import-part.import-ready { border-color: var(--ink); }
.import-kept .icon { color: var(--green); vertical-align: -0.2em; }
p.import-kept { font-weight: 700; color: var(--green-dark); margin: 0.4rem 0; }
.import-steps { padding-left: 1.6rem; margin: 0.6rem 0 1.4rem; }
.import-steps li { margin-bottom: 0.6rem; }
.import-done { margin-top: 1.6rem; }
.import-done .import-list { padding: 0 1rem 1rem; }
.import-foot { margin-top: 2rem; padding-top: 1rem; border-top: 2px solid var(--line-soft); }
.import-body [aria-disabled="true"] { opacity: 0.55; cursor: default; }
/* Their brought-in writing, folded away above its write-up on the "Tell a story" page. */
details.earlier > .msg-text { padding: 0.4rem 1.1rem 1rem; border-top: 1px solid var(--line-soft); font-family: var(--serif); }
details.earlier > .msg-text p { white-space: pre-wrap; }

/* ---------- Printing ---------- */

@media print {
  html, html.size-2, html.size-3 { font-size: 13pt; }
  body { background: #fff; color: #000; }
  .site-header, .banner, .skip-link, .no-print, .chapter-tools, .btn, .status-line, .notice { display: none !important; }
  main { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  .book-title { font-size: 28pt; margin-top: 30vh; }
  .book-sub { page-break-after: always; break-after: page; }
  .chapter { border: 0; box-shadow: none; padding: 0; margin: 0; background: #fff; page-break-before: always; break-before: page; }
  .chapter:first-of-type { page-break-before: auto; break-before: auto; }
  .chapter-body { font-size: 14pt; line-height: 1.6; }
  .chapter-body p { orphans: 3; widows: 3; }
  .chapter-photos img { max-height: 9cm; box-shadow: none; border: 1px solid #999; page-break-inside: avoid; break-inside: avoid; }
  .chapter h2 { page-break-after: avoid; break-after: avoid; }
  .chapter-when { color: #333; font-size: 13pt; page-break-after: avoid; break-after: avoid; }
  .when-unsure, .chapter-pinned, .when-form { display: none !important; }
  .card { box-shadow: none; }
  .keep-card { border: 2pt dashed #000; display: block !important; }
  .keep-value { font-size: 24pt; border: 1pt solid #000; }
  body.print-card-only main > *:not(.keep-card) { display: none !important; }
}

/* Keep newly shown things clear of the Talk / Type / Add a photo bar. */
.msg, #pending, #streaming, .status-line, .notice { scroll-margin: 1rem 0 11rem; }
