/* Guided Life Discovery: one stylesheet for the participant pages and the organizer page.
   Calm, large and plain: readers include people in their seventies on a phone.

   The look is "Sunrise on the river", from John's logo (chosen 15 November 2026): dawn colours
   at the top of each page, his teal river as the divider, soft rounded cards, and a small sun
   beside the facilitator's lines. His colours: teal #347C89, slate #52636B, pale teals #EAF4F4
   #F2F6F6 #E3F0F1, the cream of his Participant Guide #FFF6E8, the logo's lettering #142E3D and
   its sun #F6D1A4 to #EDC995. One look on every device: a phone or computer set to dark gets
   these same day colours (Brian's ruling, 30 November 2026). Since 3 December 2026 the page
   behind the cards is warm cream and honey instead of his pale teal (the warm look, from Brian's
   plan that day), and his teal stays the accent. The warm dark version that was
   here until then is in the history.

   Fonts are served by the site itself (the bench's rule 4: no CDN font), from public/brand/ with
   their licences: headings are Fraunces 600, body text Nunito Sans 400, 600 and 700. */
@font-face {
  font-family: "Fraunces";
  src: url("/brand/fraunces-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("/brand/nunito-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("/brand/nunito-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("/brand/nunito-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light; /* one look: a device set to dark gets the day colours too */
  --page: #fbf1e2; /* behind the cards: warm cream (3 December 2026, the warm look; his pale teal #eaf4f4 until then) */
  --chat-page: #fff6e8; /* behind the conversation */
  --card: #ffffff;
  --ink: #23343a;
  --deep: #142e3d; /* headings: the logo's lettering */
  --soft: #52636b; /* John's slate */
  --line: #ecdcc4;
  --accent: #347c89; /* John's teal, for fills: buttons, the river, the participant's lines */
  --accent-ink: #ffffff;
  --accent-text: #2c6b77; /* the same teal a shade deeper, for text on the pale colours */
  --tint: #f7e6cc; /* honey */
  --field: #ffffff;
  --field-line: #6f8f96;
  --field-tint: #fcf6ec;
  --warn: #8c2f2f;
  --warn-bg: #fbeceb;
  --ok: #2d6a4f;
  --ok-bg: #e8f3ec;
  --sun: #edc995;
  --sun-hi: #fbe3bf;
  --sun-lo: #e2b57a;
  --dawn-top: #fff3e2;
  --dawn-bottom: #fbdfb8;
  --glow: rgba(246, 209, 164, 0.75);
  --glow-far: rgba(246, 209, 164, 0.25);
  --me: #347c89; /* the participant's lines */
  --me-ink: #ffffff;
  --badge: transparent; /* behind the logo: nothing, the page is light */
  --shadow: 0 4px 14px rgba(120, 78, 24, 0.12);
  --lift: 0 6px 16px rgba(52, 124, 137, 0.3);
  --composer-line: #e7d9c3;
  /* the country at the sides of a wide screen (door.css › a wide screen): the hills from the far,
     warm one down to the bank, their firs, the thin clouds, and the wave lines on the water */
  --hill-far: #f4dcc4;
  --hill-mid: #f1dcbc;
  --hill-near: #e7cc9f;
  --hill-bank: #aed2d4;
  --fir-far: #c3d8cf;
  --fir-near: #9fc6c8;
  --cloud: #fff8ee;
  --wave: #e9d6b6;
  --scene-wash: rgba(251, 241, 226, 0.32); /* over the lake photograph at the sides of a wide screen (door.css) */
  /* the welcome page's four steps (door.css, 3 December 2026): a bold colour for each circle, and a tint of it behind each step */
  --step-1: #c98228; --step-bg-1: #fdecd2; /* honey */
  --step-2: #347c89; --step-bg-2: #e2f0f1; /* John's teal */
  --step-3: #5f8a4e; --step-bg-3: #e8f0dd; /* sage */
  --step-4: #c25f52; --step-bg-4: #fbe4de; /* rose */
  /* and the deeper tint at the top of each step and the light one at its foot */
  --step-top-1: #fbd9a8; --step-end-1: #fff8ec;
  --step-top-2: #c4e2e5; --step-end-2: #f6fbfb;
  --step-top-3: #d3e4c3; --step-end-3: #f8fbf3;
  --step-top-4: #f6c9bf; --step-end-4: #fff6f3;
  --display: "Fraunces", Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 18px/1.6 var(--sans);
}
body.in-chat { --page: var(--chat-page); }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 18px; }
.wide .wrap { max-width: 68rem; }

/* the top of every page: dawn, John's logo with the sun behind it, then the river */
header.site {
  position: relative;
  isolation: isolate; /* the sun's glow sits between the dawn and the logo */
  overflow: hidden; /* and stays inside the header */
  background: linear-gradient(180deg, var(--dawn-top) 0%, var(--dawn-bottom) 100%);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 4px; }
.brand { position: relative; display: flex; align-items: center; gap: 14px; line-height: 1.25; min-width: 0; }
.brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -34px;
  top: 50%;
  width: 200px;
  height: 200px;
  margin-top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, var(--glow-far) 45%, rgba(246, 209, 164, 0) 70%);
  pointer-events: none;
}
.logo-badge { display: block; flex: none; background: var(--badge); border-radius: 14px; }
.logo { display: block; width: 136px; height: auto; mix-blend-mode: multiply; } /* the white of the file disappears */
.program { font: 600 0.95rem/1.25 var(--sans); color: var(--soft); padding-left: 14px; border-left: 1.5px solid var(--sun); }
header.site nav { display: flex; gap: 8px; flex: none; }
header.site nav .btn { white-space: nowrap; }
.river { display: block; width: 100%; height: 24px; margin-top: 2px; }
.river .water { fill: var(--page); }
.river .current { fill: none; stroke: var(--accent); stroke-width: 6px; stroke-linecap: round; }
.river .glint { fill: none; stroke: #ffffff; stroke-opacity: 0.7; stroke-width: 1.4px; }
/* the welcome: the logo larger, in the middle, as on John's own front page */
body.hero header.site .wrap { flex-direction: column; justify-content: center; padding-top: 30px; padding-bottom: 8px; gap: 8px; }
body.hero .brand { flex-direction: column; gap: 10px; text-align: center; }
body.hero .brand::before { left: 50%; top: 40%; width: 320px; height: 320px; margin-left: -160px; margin-top: -160px; }
body.hero .logo { width: 224px; }
body.hero .program { padding-left: 0; border-left: 0; font-size: 1.02rem; }
body.hero header.site nav { position: absolute; top: 10px; right: 12px; }
body.hero .river { height: 34px; }
body.hero .river .current { stroke-width: 10px; }
body.hero .river .glint { stroke-width: 2.2px; }
@media (max-width: 380px) {
  .logo { width: 120px; }
  .brand { gap: 10px; }
  .program { padding-left: 10px; font-size: 0.88rem; }
}
@media (max-width: 480px) {
  /* the organizer page's longer name goes under the logo on a phone */
  body.organizer .brand { flex-direction: column; align-items: flex-start; gap: 6px; }
  body.organizer .program { padding-left: 0; border-left: 0; }
}
@media (min-width: 760px) {
  .logo { width: 168px; }
  .brand::before { left: -26px; width: 220px; height: 220px; margin-top: -110px; }
}

main { flex: 1; padding: 22px 0 40px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--deep); font-synthesis: style; text-wrap: balance; }
h1 { font-size: 1.85rem; line-height: 1.18; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.32rem; line-height: 1.25; margin: 1.6rem 0 0.5rem; }
h3 { font-size: 1.12rem; line-height: 1.3; margin: 1.2rem 0 0.4rem; }
h4, h5, h6 { font-size: 1rem; margin: 1rem 0 0.3rem; font-weight: 700; color: var(--deep); }
p { margin: 0.5rem 0 0.9rem; }
a { color: var(--accent-text); }
.lead { font-size: 1.08rem; color: var(--soft); margin-bottom: 1.2rem; }
.note { font: 0.92rem/1.5 var(--sans); color: var(--soft); }
.from { font: 700 0.74rem/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 0.5rem; }

.card { background: var(--card); border-radius: 20px; padding: 20px 22px; margin: 16px 0; box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.plain { background: transparent; box-shadow: none; border: 1.5px solid var(--line); }
.banner { border-radius: 14px; padding: 12px 16px; margin: 14px 0; font: 1rem/1.5 var(--sans); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1.02rem/1.2 var(--sans); padding: 0.8rem 1.25rem; border-radius: 26px; /* a pill on one line, a soft box on two */
  border: 1.5px solid var(--accent); background: var(--card); color: var(--accent-text); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--tint); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--lift); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent-text); padding-left: 0.5rem; padding-right: 0.5rem; }
.btn.quiet:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn.danger { color: var(--warn); border-color: var(--warn); }
.btn.small { font-size: 0.9rem; padding: 0.5rem 0.9rem; }
.btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 4px; }
.row.end { justify-content: flex-end; }
.spread { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; justify-content: space-between; }

label { font-family: var(--sans); }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; font: 1.05rem/1.5 var(--sans); padding: 0.7rem 0.9rem; border: 1.5px solid var(--field-line);
  border-radius: 14px; background: var(--field); color: var(--ink);
}
textarea { resize: vertical; min-height: 5.5rem; }
input[type="file"] { max-width: 100%; font: 1rem/1.4 var(--sans); color: var(--soft); }
input[type="file"]::file-selector-button {
  font: 700 0.95rem/1.2 var(--sans); padding: 0.55rem 1rem; margin-right: 0.8rem; border-radius: 26px;
  border: 1.5px solid var(--accent); background: var(--card); color: var(--accent-text); cursor: pointer;
}
textarea.source { font: 0.95rem/1.5 ui-monospace, Consolas, "Courier New", monospace; min-height: 18rem; }
.field { margin: 14px 0; }
.field > label, .field > .label { display: block; font: 600 1rem/1.4 var(--sans); margin-bottom: 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; font: 1rem/1.5 var(--sans); margin: 10px 0; cursor: pointer; }
.check input { width: 1.35rem; height: 1.35rem; margin-top: 0.15rem; flex: none; accent-color: var(--accent); }
.check.serif { font-family: var(--serif); font-size: 1.08rem; color: var(--deep); }

/* 0 to 10 */
.rating { padding: 14px 0; border-top: 1px solid var(--line); }
.rating:first-of-type { border-top: 0; }
.rating .q { margin: 0 0 8px; }
.scale { display: flex; flex-wrap: wrap; gap: 6px; }
.scale button {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.5px solid var(--field-line); background: var(--field-tint);
  color: var(--ink); font: 600 1rem var(--sans); cursor: pointer;
}
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px rgba(237, 201, 149, 0.55); }
.scale .skip { width: auto; border-radius: 999px; padding: 0 0.9rem; font-weight: 500; color: var(--soft); }
.ends { display: flex; justify-content: space-between; max-width: 31rem; font: 0.82rem var(--sans); color: var(--soft); margin-top: 4px; }

/* text written in Markdown: John's welcome, notes, the map */
.md h3, .md h4, .md h5, .md h6 { margin-top: 1.1rem; }
.md ul, .md ol { padding-left: 1.3rem; margin: 0.4rem 0 0.9rem; }
.md li { margin: 0.25rem 0; }
.md li::marker { color: var(--accent-text); }
.md li.check { display: list-item; list-style: none; margin-left: -1.3rem; font: inherit; cursor: default; }
.md code { font: 0.88em ui-monospace, Consolas, monospace; background: var(--tint); padding: 0.08em 0.35em; border-radius: 5px; }
.md blockquote { margin: 0.6rem 0; padding: 0.2rem 0 0.2rem 1rem; border-left: 3px solid var(--sun); color: var(--soft); }
.md hr { border: 0; border-top: 1.5px solid var(--line); margin: 1.2rem 0; }
.tablewrap { overflow-x: auto; margin: 0.6rem 0 1rem; }
table { border-collapse: collapse; width: 100%; font: 0.95rem/1.45 var(--sans); }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--tint); font-weight: 700; color: var(--deep); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* a table with many columns (the story map has eight) reads better as one block per row */
.md .tablewrap.wide table, .md .tablewrap.wide tbody, .md .tablewrap.wide tr, .md .tablewrap.wide td { display: block; width: 100%; }
.md .tablewrap.wide thead { display: none; }
.md .tablewrap.wide tr { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 6px 0; }
.md .tablewrap.wide td { border: 0; padding: 5px 14px; font-size: 1rem; }
.md .tablewrap.wide td:empty { display: none; }
.md .tablewrap.wide td::before { content: attr(data-label); display: block; font-weight: 700; color: var(--soft); font-size: 0.82rem; }
@media (max-width: 720px) {
  .md .tablewrap table, .md .tablewrap tbody, .md .tablewrap tr, .md .tablewrap td { display: block; width: 100%; }
  .md .tablewrap thead { display: none; }
  .md .tablewrap tr { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 4px 0; }
  .md .tablewrap td { border: 0; padding: 5px 12px; }
  .md .tablewrap td:empty { display: none; }
  .md .tablewrap td::before { content: attr(data-label); display: block; font-weight: 700; color: var(--soft); font-size: 0.82rem; }
}

/* the conversation: the facilitator's lines on white with a small sun, the participant's in teal */
.chat { display: flex; flex-direction: column; gap: 18px; padding-bottom: 12px; }
/* The facilitator's closing words, above the notes at the end of a session: only in a draft
   made before 23 November 2026, when the page below took their place. */
.chat.closing { margin: 4px 0 18px; padding-bottom: 0; }
details.card > summary { margin: 0; }
/* The page a participant takes away at the end of a session: first on the closing screen, on
   the conversation's warm colour, with a line of the logo's sun along its top. */
.card.takeaway { background: var(--chat-page); border-top: 4px solid var(--sun); }
.card.takeaway .md { font-size: 1.04rem; }
.card.takeaway .byline { margin: 1.1rem 0 0; padding-top: 0.7rem; border-top: 1.5px solid var(--line); }
/* Under it, the record the next session picks up from (notes and map), folded until asked for. */
details.card.fold[open] > summary { margin-bottom: 0.7rem; }
details.card.fold > h2:first-of-type, details.card.fold .spread:first-of-type h2 { margin-top: 0.4rem; }
.msg { max-width: 100%; }
.msg .who { font: 700 0.74rem/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); margin-bottom: 6px; }
.msg.f .who { display: flex; align-items: center; gap: 9px; }
.msg.f .who::before {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, var(--sun-hi) 0%, var(--sun) 60%, var(--sun-lo) 100%);
  box-shadow: 0 0 0 3px rgba(237, 201, 149, 0.3);
}
.msg.f .body { background: var(--card); border-radius: 6px 20px 20px 20px; padding: 14px 18px; box-shadow: var(--shadow); }
.card .msg.f .body { background: var(--field-tint); box-shadow: none; }
.msg.f .body > :first-child, .msg.p .body > :first-child { margin-top: 0; }
.msg.f .body > :last-child, .msg.p .body > :last-child { margin-bottom: 0; }
.msg.p { align-self: flex-end; max-width: 88%; background: var(--me); color: var(--me-ink); border-radius: 20px 6px 20px 20px; padding: 12px 18px; box-shadow: var(--shadow); }
.msg.p .body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--sans); font-size: 1.02rem; }
.msg.site { align-self: center; text-align: center; font: 0.92rem/1.5 var(--sans); color: var(--soft); max-width: 34rem; }
.typing { display: inline-flex; gap: 5px; padding: 6px 0; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: 0.35; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: 0.6; } }
/* The message box stays at the bottom of the screen while the conversation scrolls.
   Nothing else is pinned beneath it (a second pinned bar used to cover the Send button
   on a phone). The crisis numbers come up above it only when called for (#crisis). */
.composer { position: sticky; bottom: 0; background: var(--page); padding: 10px 0 8px; border-top: 1px solid var(--composer-line); margin-top: 8px; }
.composer textarea { min-height: 5.6rem; max-height: 40dvh; background: var(--field); border-color: var(--field-line); border-radius: 20px; resize: none; overflow-y: auto; }
.composer .row { margin-top: 8px; justify-content: space-between; }
.crisis-panel { border: 2px solid var(--warn); background: var(--warn-bg); color: var(--ink); border-radius: 18px; padding: 16px 18px; margin: 4px 0 18px; font-family: var(--sans); }
.crisis-panel strong.big { font-size: 1.25rem; display: block; margin-bottom: 4px; color: var(--warn); }
.crisis-panel a { color: var(--warn); font-weight: 700; }
.crisis-panel .aside { display: block; margin-top: 10px; font-size: 0.92rem; color: var(--soft); }
.crisis-panel .row { margin-top: 10px; }

.steps { font: 700 0.82rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font: 1rem/1.5 var(--sans); margin: 0.4rem 0; }
.kv dt { color: var(--soft); }
.kv dd { margin: 0; }
.list { list-style: none; padding: 0; margin: 8px 0; }
.list li { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); font-family: var(--sans); }
.list li:first-child { border-top: 0; }
.tag { display: inline-block; font: 700 0.74rem/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; padding: 0.35rem 0.65rem; border-radius: 999px; background: var(--tint); color: var(--accent-text); }
.tag.live { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
pre.preview { white-space: pre-wrap; overflow-wrap: anywhere; font: 0.92rem/1.5 var(--sans); background: var(--field-tint); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; max-height: 24rem; overflow: auto; margin: 10px 0; }
.group { font: 700 0.9rem/1.3 var(--sans); color: var(--soft); margin: 14px 0 2px; }
details { margin: 10px 0; }
summary { cursor: pointer; font: 700 1rem/1.4 var(--sans); color: var(--accent-text); }
.streaming { color: var(--soft); max-height: 16rem; overflow: auto; font: 0.95rem/1.5 var(--sans); white-space: pre-wrap; }

body.in-chat main { padding-bottom: 0; }

/* the organizer page: a little larger still */
body.organizer { font-size: 19px; }

@media print {
  header.site, .btn, .row, .composer, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  h1, h2, h3, h4, h5, h6 { color: #000; }
  .card { border: 0; padding: 0; margin: 0; box-shadow: none; }
  main { padding: 0; }
  .tablewrap { overflow: visible; }
}
