/* Family Table — Canadian fall: spruce, maple red, sugar-maple orange, birch gold, bark brown.
   Layout: one calm phone-first column; quilt "centre diamond" blocks mark sections. */
:root {
  --bg: #f8f5f0;
  --panel: #ffffff;
  --ink: #2b231d;
  --muted: #6a5b4f;
  --rule: #e2d8cb;
  --spruce: #2f5a46;
  --maple: #b3361f;
  --orange: #d0661c;
  --birch: #d9a21b;
  --bark: #7a4a2a;
  --tint: #f1e9de;
  --on-color: #ffffff;
  --display: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1814; --panel: #27211c; --ink: #f3ece4; --muted: #c2b4a6; --rule: #3e342c;
    --spruce: #5f9a7c; --maple: #d8553b; --orange: #e07a35; --birch: #e0b245; --bark: #b98058; --tint: #322a23;
    --on-color: #ffffff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wrap { max-width: 40rem; margin: 0 auto; padding-inline: 18px; padding-block: 24px 56px; display: grid; gap: 36px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 7.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 800; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--maple); text-underline-offset: 3px; }
.eyebrow { font-family: var(--display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
[hidden] { display: none !important; }

/* quilt block */
.block { --a: var(--spruce); --b: var(--birch); --c: var(--maple); position: relative; aspect-ratio: 1; background: var(--a); overflow: hidden; }
.block::before { content: ""; position: absolute; inset: 14.6%; background: var(--b); transform: rotate(45deg); }
.block::after { content: ""; position: absolute; inset: 34%; background: var(--c); }
.quilt { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; background: var(--bark); }
.head { display: flex; align-items: center; gap: 14px; }
.head .block { width: 40px; flex: none; }
.head > div { min-width: 0; }

/* buttons & inputs */
button, .btn {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  border: 0; border-radius: 10px; padding: 14px 18px; cursor: pointer;
  background: var(--spruce); color: var(--on-color); min-height: 52px;
}
button.secondary { background: var(--tint); color: var(--ink); }
button.ghost { background: transparent; color: var(--maple); padding: 8px 4px; min-height: 0; text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--birch); outline-offset: 3px; }
input, textarea {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 2px solid var(--rule); border-radius: 10px; padding: 12px 14px; width: 100%;
}
label { font-family: var(--display); font-weight: 700; }
.field { display: grid; gap: 8px; }
.error { color: var(--maple); font-family: var(--display); font-weight: 700; }

/* login */
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.who button { background: var(--panel); color: var(--ink); border: 3px solid var(--rule); font-size: 1.3rem; min-height: 72px; }
.who button[aria-pressed="true"] { border-color: var(--c); background: var(--tint); }

/* home actions */
.actions { display: grid; gap: 12px; }
.action { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; text-align: left;
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule); padding: 14px 16px; border-radius: 12px; }
.action .block { width: 56px; }
.action .num { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--tint); color: var(--muted); font-family: var(--display); font-weight: 800; font-size: 1.6rem; }
.action.next { border: 3px solid var(--spruce); }
.action.next .num { background: var(--spruce); color: var(--on-color); }
.about > .inner { gap: 28px; padding-top: 8px; }
.action > span { display: grid; gap: 2px; min-width: 0; }
.action small { font-family: var(--body); font-weight: 400; font-size: 0.95rem; color: var(--muted); }

/* guide content */
.study { background: var(--panel); border: 1px solid var(--rule); padding: 20px; display: grid; gap: 14px; }
.big { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.big strong { font-family: var(--display); font-weight: 800; font-size: 3.4rem; line-height: 1; color: var(--maple); }
.big span { flex: 1 1 14rem; min-width: 0; }
.tag { font-family: var(--display); font-weight: 700; font-size: 0.8rem; padding: 4px 10px; background: var(--tint); }
.other { padding-left: 16px; border-left: 4px solid var(--c, var(--spruce)); display: grid; gap: 4px; }
.note { background: var(--tint); padding: 16px 18px; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.stage { background: var(--panel); border: 1px solid var(--rule); display: grid; grid-template-columns: 56px 1fr; }
.stage .num { background: var(--c); color: var(--on-color); font-family: var(--display); font-weight: 800; font-size: 1.6rem; display: grid; place-items: center; }
.stage .txt { padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rules li { display: grid; grid-template-columns: 18px 1fr; gap: 14px; }
.rules li::before { content: ""; width: 13px; height: 13px; margin-top: 8px; background: var(--c); transform: rotate(45deg); }
ul.plain { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
details { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; }
summary { cursor: pointer; padding: 14px 16px; font-family: var(--display); font-weight: 700; }
details .inner { padding: 0 16px 16px; display: grid; gap: 10px; font-size: 1rem; }

/* talk screens */
.talk { display: grid; grid-template-rows: auto 1fr auto; min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); max-width: 40rem; margin: 0 auto; }
.talk header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); background: var(--bg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2; }
.talk header h2 { font-size: 1.15rem; }
.log { padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--rule); }
.msg .who-said { display: block; font-family: var(--display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.msg.claude { align-self: flex-start; background: var(--tint); border-color: transparent; }
.msg.user { align-self: flex-end; }
.msg.evelyn { border-left: 5px solid var(--maple); }
.msg.omaia { border-left: 5px solid var(--spruce); }
.dock { padding: 14px 16px 18px; border-top: 1px solid var(--rule); background: var(--bg); display: grid; gap: 12px; position: sticky; bottom: 0; }
.status { text-align: center; font-family: var(--display); font-weight: 700; color: var(--muted); min-height: 1.6em; }

.mic { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 1rem; background: var(--spruce); }
.mic svg { width: 44px; height: 44px; }
.mic.listening { background: var(--maple); }
.mic.thinking { background: var(--bark); }
.mic.speaking { background: var(--orange); }
@media (prefers-reduced-motion: no-preference) {
  .mic.listening, .speaker.listening { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--maple) 45%, transparent); } 50% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--maple) 0%, transparent); } }
}
.speakers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.speaker { min-height: 96px; font-size: 1.35rem; border-radius: 14px; display: grid; gap: 2px; place-content: center; }
.speaker small { font-family: var(--body); font-weight: 400; font-size: 0.85rem; opacity: 0.95; }
.speaker.evelyn { background: var(--maple); }
.speaker.omaia { background: var(--spruce); }
.pause-btn { background: var(--birch); color: #2b231d; font-size: 1.15rem; }
.typebox { display: grid; gap: 8px; }
.typebox .row button { flex: 1; }
.toggle { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--display); font-size: 0.95rem; color: var(--muted); }
.toggle input { width: 22px; height: 22px; accent-color: var(--spruce); }
.later { display: grid; gap: 8px; }
.later li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); font-family: var(--display); font-weight: 700; padding: 12px 18px; border-radius: 10px; max-width: calc(100% - 32px); z-index: 10; }
