:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --paper-2: #ebe6dc;
  --surface: #fffdf8;
  --ink: #26332c;
  --muted: #6b756e;
  --moss: #526a5b;
  --moss-dark: #27372f;
  --clay: #b97850;
  --fact: #557160;
  --fact-bg: #dfe9e1;
  --story: #8a6043;
  --story-bg: #efe0d3;
  --image: #655a76;
  --image-bg: #e6e0ec;
  --difficult: #743f36;
  --difficult-bg: #eee0dc;
  --danger: #a6473e;
  --line: rgba(38, 51, 44, .16);
  --shadow: 0 18px 50px rgba(39, 55, 47, .12);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.app-shell { min-height: 100dvh; }
.screen { min-height: 100dvh; padding-bottom: calc(92px + var(--safe-bottom)); }
.screen--auth { display: grid; min-height: 100dvh; padding: 0; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; padding: 18px 20px calc(90px + var(--safe-bottom)); color: var(--muted); font-size: 12px; letter-spacing: .02em; }
.app-footer a { color: var(--moss-dark); font-weight: 700; text-decoration-color: rgba(39,55,47,.35); text-underline-offset: 3px; }
.app-footer a:hover, .app-footer a:focus-visible { color: var(--clay); }
.screen--auth ~ .app-footer { padding-bottom: max(22px, var(--safe-bottom)); }
.splash { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 18px; color: var(--muted); }
.splash img { border-radius: 18px; }

.auth { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--moss-dark); color: #fff; }
.auth__brand { display: flex; align-items: center; gap: 10px; padding: max(22px, env(safe-area-inset-top)) 24px 18px; font-weight: 800; letter-spacing: .13em; }
.auth__mark { width: 30px; height: 30px; display: grid; place-items: center; color: var(--moss-dark); background: #f2eade; }
.auth__body { align-self: end; padding: 48px 24px max(40px, calc(24px + var(--safe-bottom))); background: var(--paper); color: var(--ink); border-radius: 34px 34px 0 0; }
.auth__body h1 { max-width: 560px; margin: 0 0 16px; font: 400 clamp(42px, 13vw, 68px)/.98 var(--serif); letter-spacing: -.045em; }
.auth__body > p { max-width: 560px; margin: 0 0 30px; color: var(--muted); line-height: 1.65; }
.auth__body--welcome { padding-top: 0; }
.auth__vision { margin: 0 -24px 24px; overflow: hidden; border-radius: 34px 34px 0 0; background: #fdfbf4; }
.auth__vision img { display: block; width: 100%; height: 320px; object-fit: contain; }
.auth__body--welcome > .auth__motto { margin: 0 0 16px; color: var(--moss-dark); font: italic 400 clamp(22px, 6vw, 28px)/1.3 var(--serif); }
.auth__body--welcome > .eyebrow { margin-bottom: 14px; }
.auth__body--welcome h1 { font-size: clamp(40px, 11vw, 60px); }
.auth__features { display: grid; gap: 14px; max-width: 560px; margin: 0 0 30px; padding: 0; list-style: none; color: var(--muted); font-size: 14px; line-height: 1.6; }
.auth__features li { padding-left: 14px; border-left: 2px solid var(--clay); }
.auth__features strong { color: var(--ink); }
.auth__setup-title { max-width: 560px; margin: 0 0 12px; font: 400 28px/1.15 var(--serif); letter-spacing: -.025em; }
.auth__form { display: grid; gap: 16px; max-width: 560px; }
.auth__username { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; border: 0; }
.remember-device { display: flex; align-items: start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.remember-device input { flex-shrink: 0; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--moss); }
.remember-device strong, .remember-device small { display: block; }
.remember-device strong { font-size: 14px; }
.remember-device small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.settings-row[role="switch"] .settings-row__arrow { width: 32px; height: 20px; padding: 3px; border-radius: 20px; background: var(--paper-2); }
.settings-row[role="switch"] .settings-row__arrow::after { content: ''; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
.settings-row[aria-checked="true"] .settings-row__arrow { background: var(--moss); }
.settings-row[aria-checked="true"] .settings-row__arrow::after { margin-left: 12px; background: var(--surface); }
.auth__aside { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth__aside span { color: var(--fact); }
.auth__privacy { margin: 18px 0 0; font-size: 13px; text-align: center; }
.auth__privacy a { color: var(--moss); text-underline-offset: 3px; }

.field { display: grid; gap: 7px; }
.field > span, .field label { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .04em; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid var(--line);
  border-radius: 11px; outline: 0; background: var(--surface);
}
.field textarea { min-height: 118px; line-height: 1.55; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(82,106,91,.12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.person-fields { display: grid; gap: 15px; min-width: 0; }
.ai-intro { margin-bottom: 26px; padding: 22px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.ai-intro h2 { margin: 0 0 10px; font: 400 27px/1.2 var(--serif); }
.ai-intro > p:not(.eyebrow), .ai-people-preview p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.ai-actions { display: grid; gap: 9px; margin-top: 18px; }
.ai-action-button { width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid rgba(82,106,91,.34); border-radius: 14px; background: linear-gradient(135deg, var(--surface), #e7ede8); color: var(--moss-dark); box-shadow: 0 7px 18px rgba(39,55,47,.09); text-align: left; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.ai-action-button:hover { border-color: var(--moss); box-shadow: 0 10px 24px rgba(39,55,47,.14); transform: translateY(-1px); }
.ai-action-button:focus-visible { outline: 3px solid rgba(185,152,99,.38); outline-offset: 3px; }
.ai-action-button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.ai-action-button__icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 11px; background: var(--moss-dark); color: #f3d9a9; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.ai-action-button strong { flex: 1; font-size: 13px; line-height: 1.45; }
.ai-action-button > span:last-child:not(.ai-action-button__icon) { color: var(--clay); font-size: 20px; }
.ai-action-button--compact { min-height: 52px; margin-top: 10px; }
.button-row > .ai-action-button--compact { flex: 1 1 100%; }
.ai-choices { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.ai-choices legend, .ai-choices summary { font-weight: 750; font-size: 13px; }
.ai-checklist { max-height: 260px; overflow-y: auto; margin-top: 10px; }
.ai-checklist > label { display: flex; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ai-checklist input, .ai-source > input { flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--moss); }
.ai-checklist span { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.ai-checklist small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.ai-status { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.ai-question { padding: 14px; border-radius: 12px; background: var(--fact-bg); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.ai-people-preview h3 { margin: 0; font: 400 22px var(--serif); }
.ai-source-list { display: grid; gap: 12px; }
.ai-source { display: flex; align-items: start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.ai-source > span { min-width: 0; }
.ai-source strong, .ai-source small, .ai-evidence strong, .ai-evidence small { display: block; margin-bottom: 6px; }
.ai-source small, .ai-evidence small { color: var(--muted); font-size: 11px; }
.ai-source strong, .ai-evidence strong { font-size: 14px; overflow-wrap: anywhere; }
.ai-source__text, .ai-evidence p { font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-result { margin: 20px 0; padding: 18px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ai-result h3 { margin: 0; font: 400 24px/1.2 var(--serif); }
.ai-result > p { line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-result summary, .ai-saved-evidence summary { cursor: pointer; color: var(--moss-dark); font-size: 13px; padding: 12px 0; }
.ai-evidence { padding: 14px 0; border-top: 1px solid var(--line); }
.ai-evidence p { margin: 6px 0 0; }
.ai-result > .button { margin-top: 14px; }
.field-hint { margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.dictation { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 7px; min-height: 32px; margin-top: -1px; }
.dictation__button { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--moss-dark); font-size: 12px; font-weight: 760; }
.dictation__button:hover { border-color: var(--moss); }
.dictation__button--icon { width: 34px; min-width: 34px; height: 32px; padding: 4px; justify-content: center; border-color: transparent; background: transparent; cursor: pointer; }
.dictation__button--icon:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }
.dictation__mouth { display: block; width: 26px; height: 22px; flex: none; }
.dictation__button[aria-pressed="true"] { color: #fff; border-color: var(--danger); background: var(--danger); }
.dictation__status { color: var(--muted); font-size: 10px; line-height: 1.35; }
.dictation__status:empty, .dictation__status[hidden] { display: none; }
.dictation__consent { flex-basis: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.dictation__consent p { margin: 0 0 10px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.dictation[data-state="error"] .dictation__status { color: var(--danger); }
.dictation[data-state="done"] .dictation__status { color: var(--fact); }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid var(--moss-dark); border-radius: 12px; background: var(--moss-dark); color: #fff; font-weight: 760; text-decoration: none; }
.button:hover { background: var(--moss); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button--secondary { color: var(--ink); background: transparent; border-color: var(--line); }
.button--secondary:hover { background: var(--paper-2); }
.button--danger { color: var(--danger); background: transparent; border-color: rgba(166,71,62,.3); }
.button--small { min-height: 38px; padding: 0 13px; border-radius: 9px; font-size: 13px; }
.button--wide { width: 100%; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--moss); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; min-height: 68px; padding: max(10px, env(safe-area-inset-top)) 18px 10px; background: rgba(244,241,233,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.topbar__brand { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 850; letter-spacing: .12em; }
.topbar__brand span:first-child { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; background: var(--moss-dark); }
.topbar__menu { padding: 0; border: 0; background: transparent; color: inherit; }
.topbar__menu { min-width: 36px; min-height: 44px; }
.topbar__home { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; }
.topbar__title { margin: 0 auto; font: 400 20px var(--serif); }
.topbar__action { min-width: 42px; min-height: 42px; display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; }
.topbar__spacer { width: 42px; }

.page { width: min(760px, 100%); margin: 0 auto; padding: 24px 18px 32px; }
.page--wide { width: min(1000px, 100%); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font: 400 clamp(38px, 10vw, 58px)/1 var(--serif); letter-spacing: -.045em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.eyebrow { margin: 0 0 8px; color: var(--clay); font-size: 10px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }

.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 50; height: calc(72px + var(--safe-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 8px var(--safe-bottom); background: rgba(255,253,248,.97); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.bottom-nav button { min-width: 0; display: grid; place-items: center; align-content: center; gap: 3px; padding: 4px 2px; border: 0; background: transparent; color: #7a847e; font-size: 10px; font-weight: 700; }
.bottom-nav button span:first-child { font-size: 20px; line-height: 1; }
.bottom-nav button.active { color: var(--moss-dark); }
.bottom-nav button.active::after { content: ''; width: 20px; height: 2px; background: var(--clay); }

.notice { display: flex; gap: 12px; padding: 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1.55; }
.notice__icon { color: var(--fact); font-weight: 900; }

.fan { position: relative; min-width: max-content; display: grid; gap: 32px; padding: 38px 28px 48px; overflow: hidden; isolation: isolate; }
.fan::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 0, rgba(82,106,91,.14), transparent 38%), linear-gradient(180deg, transparent, rgba(244,241,233,.75)); }
.generation { position: relative; display: grid; grid-template-columns: auto 70px auto; align-items: start; justify-content: center; min-width: max-content; padding: 18px 16px calc(22px + var(--curve-depth, 0px)); }
.generation--self, .generation--parents { display: flex; justify-content: center; }
.generation--self { padding-top: 0; }
.generation:not(:last-child)::after { content: ''; position: absolute; top: 100%; left: 50%; width: 1px; height: 32px; background: linear-gradient(var(--line), transparent); }
.generation__label { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.generation--self > .generation__label { display: none; }
.generation__wing { position: relative; display: flex; gap: 24px; }
.generation__wing::before { content: ''; position: absolute; left: 0; right: 0; top: -18px; height: calc(48px + var(--curve-depth, 0px)); border-top: 1px solid #b8c4b8; border-radius: 50% 50% 0 0; pointer-events: none; }
.generation__wing--left { justify-content: flex-end; }
.generation__wing--right { justify-content: flex-start; }
.generation__axis { width: 70px; }
.generation__pair { position: relative; display: flex; gap: 10px; align-items: stretch; transform: translateY(var(--pair-offset, 0px)); }
.generation__pair::before { content: ''; position: absolute; left: 35px; right: 35px; top: -12px; height: 25px; border: 1px solid #b8c4b8; border-bottom: 0; border-radius: 50% 50% 0 0; pointer-events: none; }
.ancestor-card { position: relative; width: 126px; min-height: 192px; display: grid; justify-items: center; align-content: start; gap: 7px; padding: 14px 9px 12px; border: 1px solid var(--line); border-radius: 22px 22px 14px 14px; background: var(--surface); box-shadow: 0 5px 18px rgba(39,55,47,.04); text-align: center; }
.ancestor-card--self { width: 150px; min-height: 176px; color: #fff; background: var(--moss-dark); }
.ancestor-card--empty { border-style: dashed; color: var(--muted); background: rgba(255,253,248,.46); box-shadow: none; }
.ancestor-card--current { padding-top: 42px; border: 2px solid var(--clay); background: #fff0d6; box-shadow: 0 0 0 4px rgba(185,120,80,.24), 0 8px 24px rgba(39,55,47,.14); }
.ancestor-card__current { position: absolute; top: -2px; right: -2px; left: -2px; display: grid; place-items: center; min-height: 30px; padding: 6px 4px; border-radius: 22px 22px 0 0; background: #8a5431; color: #fff; font-size: 11px; font-weight: 800; line-height: 1.35; }
.ancestor-card--current:focus-visible { outline: 3px solid var(--moss-dark); outline-offset: 6px; }
.ancestor-card__photo { position: relative; width: 58px; height: 64px; display: grid; place-items: center; border-radius: 26px 26px 18px 18px; background: var(--paper-2); color: var(--moss); }
.ancestor-card--male .ancestor-card__photo { background: #e3eae2; color: #476456; }
.ancestor-card--female .ancestor-card__photo { background: #f0e5de; color: #916d5b; }
.ancestor-card--self .ancestor-card__photo { color: var(--moss-dark); background: #ebe3d6; }
.ancestor-card__photo > img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.person-silhouette { width: 32px; height: 54px; }
.ancestor-card__add { position: absolute; right: -4px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--ink); line-height: 20px; font-size: 17px; }
.ancestor-card strong { max-width: 100%; font: 400 16px/1.2 var(--serif); overflow-wrap: anywhere; }
.ancestor-card .ancestor-card__relation { max-width: 100%; overflow-wrap: anywhere; color: var(--ink); font: 750 12px/1.35 var(--sans); }
.ancestor-card--self .ancestor-card__relation { color: #fff; }
.ancestor-card__missing { font-size: 11px; line-height: 1.4; }
.ancestor-card small { max-width: 100%; color: var(--muted); font-size: 10px; line-height: 1.4; }
.ancestor-card--self small { color: rgba(255,255,255,.75); }
.ancestor-card .ancestor-card__branch { font-size: 9px; }
.ancestor-card__candle { position: absolute; top: -13px; right: 6px; z-index: 2; width: 27px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(185,120,80,.3); border-radius: 50% 50% 9px 9px; background: #fff8e9; box-shadow: 0 4px 12px rgba(73,52,38,.14); font-size: 17px; line-height: 1; }
.ancestor-card--current .ancestor-card__candle { top: 36px; right: 4px; width: 22px; height: 27px; }
.ancestor-card__marks { min-height: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; margin-top: auto; padding-top: 3px; }
.ancestor-card__mark { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.75); }
.ancestor-card__mark--fact { background: var(--fact); }
.ancestor-card__mark--story { background: var(--story); }
.ancestor-card__mark--image { background: var(--image); }
.ancestor-card__mark--material { background: var(--clay); }
.ancestor-card__mark--audio { background: var(--moss-dark); }
.ancestor-card--self .ancestor-card__mark { box-shadow: 0 0 0 2px rgba(39,55,47,.75); }
.ancestor-node { display: flex; flex-direction: column; align-items: center; width: 126px; gap: 10px; }
.ancestor-node:has(.ancestor-card--self) { width: 150px; }
.satellites { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; padding-top: 10px; }
.satellites::before { content: ''; position: absolute; left: 50%; top: -10px; height: 18px; border-left: 1px dashed var(--moss); opacity: .6; }
.satellite { display: grid; justify-items: center; align-content: start; gap: 4px; width: 56px; padding: 3px 0; border: 0; background: transparent; color: var(--muted); font-size: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.satellite__photo { display: grid; place-items: center; width: 38px; height: 42px; border: 1px dashed var(--line); border-radius: 16px 16px 10px 10px; color: var(--moss); background: var(--paper); }
.satellite__photo .person-silhouette { width: 22px; height: 34px; }
.satellite__photo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.satellite:hover .satellite__photo { border-color: var(--moss); }
.satellite > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.satellites__more { min-height: 36px; border: 0; background: transparent; color: var(--moss-dark); font: 700 11px/1.4 var(--sans); }
.tree-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 26px; }
.tree-controls p, .tree-breadcrumb > span { margin: 0; color: var(--muted); font-size: 12px; }
.tree-breadcrumb { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.tree-breadcrumb > span { flex-basis: 100%; }
.tree-generation-loader { display: grid; justify-items: center; gap: 9px; margin: 20px 0 34px; text-align: center; }
.tree-generation-loader small, .tree-generation-loader p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.tree-generation-loader p { max-width: 460px; }
.related-list { display: grid; gap: 8px; margin-top: 16px; }
.related-person { display: grid; gap: 5px; width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; overflow-wrap: anywhere; }
.related-person small { color: var(--muted); line-height: 1.5; }
.connection-entry { margin-top: 12px; padding: 12px 15px; border-left: 2px solid var(--line); }
.connection-entry p { margin: 0 0 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.connection-entry__note { color: var(--muted); }
.person-relations > .field-hint { margin-top: 12px; }
.unplaced-people { margin-top: 24px; color: var(--muted); font-size: 13px; }
.unplaced-people summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.unplaced-people p { line-height: 1.6; }
.generation[data-generation="3"] .ancestor-card__photo { opacity: .8; }
.generation[data-generation="4"] .ancestor-card__photo { opacity: .65; }
.generation[data-generation="5"] .ancestor-card__photo { opacity: .55; }
.generation[data-generation="6"] .ancestor-card__photo { opacity: .45; }
.fan-scroll { margin: 0 -18px; padding: 0 18px; overflow-x: auto; scrollbar-width: thin; background: linear-gradient(180deg, rgba(226,224,213,.18), rgba(244,241,233,.72)); }


.empty-state { padding: 42px 24px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; }
.empty-state__mark { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; background: var(--paper-2); font: 400 26px var(--serif); }
.empty-state h2 { margin: 0 0 10px; font: 400 28px var(--serif); }
.empty-state p { max-width: 420px; margin: 0 auto 22px; color: var(--muted); line-height: 1.6; }

.person-hero { margin: -24px -18px 26px; padding: 34px 22px 28px; background: var(--moss-dark); color: #fff; text-align: center; }
.person-photo { width: 108px; height: 108px; display: grid; place-items: center; margin: 0 auto 18px; overflow: hidden; border: 3px solid rgba(255,255,255,.32); border-radius: 50%; background: #d9dfd8; color: var(--moss-dark); font: 400 40px var(--serif); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-photo--editable { position: relative; padding: 0; cursor: pointer; }
.person-photo--editable:focus-visible { outline: 3px solid #f5d699; outline-offset: 5px; }
.person-photo--editable:disabled { cursor: progress; opacity: .65; }
.person-photo__edit { position: absolute; inset: auto 0 0; padding: 5px 0 8px; background: rgba(27,47,39,.88); color: #fff; font: 600 11px/1.3 var(--sans, sans-serif); }
.person-hero h1 { margin: 0; font: 400 38px/1.05 var(--serif); }
.person-hero p { margin: 9px 0 0; color: rgba(255,255,255,.65); font-size: 13px; }
.person-hero .button-row { justify-content: center; margin-top: 22px; }
.person-hero .button--secondary { color: #fff; border-color: rgba(255,255,255,.28); }
.button.person-walk { width: min(420px, 100%); min-height: 78px; justify-content: space-between; gap: 18px; padding: 17px 22px; border-color: #ead4b1; border-radius: 14px; background: #f5e5c7; color: var(--moss-dark); text-align: left; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.button.person-walk:hover { background: #fff4df; }
.button.person-walk:focus-visible { outline: 3px solid #f5e5c7; outline-offset: 4px; }
.person-walk__copy { display: grid; gap: 5px; }
.person-walk__copy strong { font-size: 18px; line-height: 1.3; }
.person-walk__copy small { color: #526a5b; font-size: 12px; font-weight: 500; line-height: 1.45; }
.person-walk__arrow { flex-shrink: 0; font-size: 25px; }

.layer-section { margin: 0 0 28px; }
.layer-section__head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.layer-section__head h2 { margin: 0; font: 400 25px var(--serif); }
.layer-tag { padding: 5px 8px; border-radius: 7px; font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.layer-tag--fact { color: var(--fact); background: var(--fact-bg); }
.layer-tag--story { color: var(--story); background: var(--story-bg); }
.layer-tag--image { color: var(--image); background: var(--image-bg); }
.layer-tag--difficult { color: var(--difficult); background: var(--difficult-bg); }
.entry-list { display: grid; gap: 9px; }
.entry { position: relative; padding: 14px 42px 14px 14px; border-left: 3px solid var(--line); background: rgba(255,255,255,.55); }
.entry--difficult { border-left-color: var(--difficult); }
.entry p { margin: 0; line-height: 1.6; white-space: pre-wrap; }
.entry small { display: block; margin-top: 7px; color: var(--muted); }
.entry__actions { margin-top: 11px; }
.entry__difficult { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 16px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 760; }
.entry__difficult[aria-pressed="true"] { border-color: rgba(116,63,54,.24); color: var(--difficult); background: var(--difficult-bg); }
.entry__delete { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); }
.difficult-section { padding: 22px 18px; border: 1px solid rgba(116,63,54,.24); border-radius: 18px; background: linear-gradient(145deg, rgba(238,224,220,.86), rgba(255,253,248,.72)); }
.difficult-section__intro { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.difficult-list { display: grid; gap: 1px; margin: 0 0 18px; background: rgba(116,63,54,.14); }
.difficult-entry { display: grid; grid-template-columns: minmax(104px, auto) 1fr; align-items: start; gap: 14px; padding: 15px; background: rgba(255,253,248,.9); }
.difficult-entry .layer-tag { justify-self: start; }
.difficult-entry strong { display: block; margin-bottom: 4px; }
.difficult-entry p { margin: 0; line-height: 1.6; white-space: pre-wrap; }
.difficult-entry small { display: block; margin-top: 7px; color: var(--muted); }
.difficult-check { display: flex; align-items: flex-start; gap: 11px; margin-top: 16px; padding: 14px; border: 1px solid rgba(116,63,54,.2); border-radius: 12px; background: var(--difficult-bg); cursor: pointer; }
.difficult-check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--difficult); }
.difficult-check strong, .difficult-check small { display: block; }
.difficult-check small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.difficult-ritual { display: grid; gap: 14px; padding: 10px 2px 24px; }
.difficult-ritual p { margin: 0; color: var(--muted); font: 400 19px/1.5 var(--serif); }
.difficult-ritual__yes { display: grid; gap: 7px; margin: 9px 0; padding: 20px; border-left: 4px solid var(--difficult); background: var(--difficult-bg); }
.difficult-ritual__yes strong { font: 400 25px/1.3 var(--serif); }
.materials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.material { position: relative; min-height: 92px; display: grid; align-content: end; padding: 12px 38px 12px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); text-align: left; }
.material--image { min-height: 150px; color: #fff; background: var(--moss-dark); }
.material__preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .68; }
.material > button[data-action="open-material"] { position: relative; z-index: 1; display: grid; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.material strong, .material small { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.material--image small { color: rgba(255,255,255,.72); }
.material__delete { position: absolute; top: 7px; right: 7px; z-index: 2; width: 28px; height: 28px; border: 0; border-radius: 8px; color: inherit; background: rgba(255,255,255,.72); }
.inline-add { width: 100%; min-height: 42px; margin-top: 9px; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--moss); font-weight: 700; }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.fact-cell { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.46); }
.fact-cell span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.fact-cell strong { font-size: 13px; }

.home-page { padding-top: 28px; }
.home-hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.home-hero__copy { padding: clamp(24px, 4vw, 48px); }
.home-hero__copy .eyebrow { color: var(--moss); line-height: 1.6; }
.home-hero h2 { max-width: 11em; margin: 16px 0 20px; font: 400 clamp(34px, 4.2vw, 52px)/1.12 var(--serif); letter-spacing: -.035em; }
.home-hero h2 > span { display: block; text-wrap: balance; }
.home-hero__text { max-width: 30em; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.7; text-wrap: pretty; }
.home-hero__detail { display: block; margin-top: 20px; color: var(--clay); font: 400 36px/1 var(--serif); }
.home-hero__image { position: relative; display: grid; place-items: center; align-self: stretch; min-width: 0; margin: 0; background: #fdfbf4; }
.home-hero__image img { display: block; width: 100%; height: auto; max-height: 470px; aspect-ratio: 1122 / 1402; object-fit: contain; }
.home-lineage { margin: 36px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.home-lineage img { display: block; width: 100%; height: auto; }
.home-lineage figcaption { padding: 0 20px 20px; color: var(--muted); text-align: center; font: italic 400 17px/1.4 var(--serif); }
.home-content { width: min(724px, 100%); margin: 32px auto 0; }
.home-choice { display: flex; align-items: center; gap: 28px; padding: 28px 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.home-choice__copy { flex: 1; min-width: 0; }
.home-choice h2 { margin: 0; font: 400 32px/1.15 var(--serif); letter-spacing: -.03em; }
.home-choice__copy > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.home-choice__button { flex-shrink: 0; gap: 16px; min-height: 48px; font-size: .875rem; }
.home-content .today-card--chosen { display: grid; grid-template-columns: 180px minmax(0, 1fr); }
.home-content .today-card__image { height: 100%; min-height: 200px; }
.home-content .today-card h2 { overflow-wrap: anywhere; }

@media (max-width: 620px) {
  .home-page { padding-top: 16px; }
  .home-hero { grid-template-columns: 1fr; border-radius: 20px; }
  .home-hero__copy { padding: 24px 22px 16px; }
  .home-hero__copy .eyebrow { font-size: .75rem; letter-spacing: .12em; }
  .home-hero h2 { margin: 12px 0 16px; font-size: clamp(1.75rem, 8.8vw, 2.375rem); }
  .home-hero__text { line-height: 1.65; }
  .home-hero__detail { display: none; }
  .home-hero__image img { height: clamp(220px, 70vw, 290px); max-height: none; }
  .home-content { margin-top: 20px; }
  .home-choice { align-items: stretch; flex-direction: column; gap: 20px; padding: 24px; }
  .home-choice h2 { font-size: 30px; }
  .home-choice__button { justify-content: space-between; }
  .home-content .today-card--chosen { grid-template-columns: 98px minmax(0, 1fr); }
  .home-content .today-card__image { min-height: 170px; }
  .home-content .today-card__image .person-silhouette { width: 72px; height: 120px; }
  .home-content .today-card__body { padding: 20px 16px; }
  .home-content .today-card h2 { font-size: 28px; }
}

@media (max-width: 1199px) {
  .topbar__menu { min-width: 44px; display: grid; place-items: center; }
  .topbar__brand .topbar__menu > span { width: 34px; height: 34px; border-radius: 9px; }
  .bottom-nav button { position: relative; gap: 4px; border-radius: 12px; color: #5c6861; font-size: .75rem; }
  .bottom-nav button.active { background: rgba(82,106,91,.08); }
  .bottom-nav button.active::after { position: absolute; bottom: 2px; border-radius: 2px; }
  .bottom-nav button:focus-visible { outline: 2px solid var(--moss); outline-offset: -2px; }
}

.today-card { overflow: hidden; border-radius: 22px; background: var(--moss-dark); color: #fff; box-shadow: var(--shadow); }
.today-card__image { height: 230px; display: grid; place-items: center; background: #dbe0da; color: var(--moss-dark); font: 400 70px var(--serif); }
.today-card__image img { width: 100%; height: 100%; object-fit: cover; }
.today-card__image .person-silhouette { width: 118px; height: 194px; opacity: .88; }
.today-card__body { padding: 24px; }
.today-card h2 { margin: 0; font: 400 38px var(--serif); }
.today-card p { color: rgba(255,255,255,.66); }
.today-card__open { margin-top: 16px; padding: 0; border: 0; border-bottom: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; font-size: 13px; font-weight: 750; }
.today-card__body .button-row { align-items: center; margin-top: 16px; }
.today-card__body .today-card__open { margin-top: 0; }
.today-card__body .button--secondary { color: #fff; border-color: rgba(255,255,255,.5); }
.today-card__body .button--secondary:hover { background: rgba(255,255,255,.12); }
.today-reflection { margin-top: 36px; }
.today-facts { display: grid; gap: 7px; padding: 0; list-style: none; font-size: 13px; }
.today-facts li { padding-left: 16px; position: relative; }
.today-facts li::before { content: '—'; position: absolute; left: 0; color: #d1a37f; }
.ritual { display: grid; gap: 18px; padding: 32px 0 12px; text-align: center; }
.ritual__step { margin: 0; font: 400 24px/1.45 var(--serif); }
.breath { width: 90px; height: 90px; margin: 8px auto; border: 1px solid var(--moss); border-radius: 50%; animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(.72); opacity: .45; } 50% { transform: scale(1); opacity: 1; } }

.journal-card, .thread-card { display: block; width: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: left; }
.journal-card + .journal-card, .thread-card + .thread-card { margin-top: 10px; }
.journal-card__head, .thread-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.journal-card h3, .thread-card h3 { margin: 0; font: 400 23px var(--serif); }
.journal-card time, .thread-card time { color: var(--muted); font-size: 11px; }
.journal-card p, .thread-card p { display: -webkit-box; margin: 10px 0 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.thread-chip { display: inline-flex; margin-top: 10px; padding: 5px 8px; border-radius: 8px; color: var(--image); background: var(--image-bg); font-size: 10px; font-weight: 800; }

.settings-group { margin-bottom: 28px; }
.settings-group > h2 { margin: 0 0 10px; color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.settings-list { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.settings-row { width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.settings-row:last-child { border-bottom: 0; }
.settings-row__icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--paper-2); }
.settings-row__copy { display: grid; gap: 2px; flex: 1; }
.settings-row__copy strong { font-size: 14px; }
.settings-row__copy small { color: var(--muted); font-size: 11px; }
.settings-row__arrow { color: var(--muted); }
.settings-list > .settings-row:has(+ [data-ai-exchanges]) { border-bottom: 0; }
.settings-list > [data-ai-exchanges] { min-height: 34px; max-width: calc(100% - 74px); margin: 0 14px 14px 60px; padding: 7px 11px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 1.35; text-align: left; }
.settings-list > [data-ai-exchanges] + .settings-row { border-top: 1px solid var(--line); }
.storage-meter { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 5px; background: var(--paper-2); }
.storage-meter span { display: block; height: 100%; background: var(--moss); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; padding-top: 30px; background: rgba(20,29,24,.6); backdrop-filter: blur(5px); }
.modal { width: min(620px, 100%); max-height: calc(100dvh - 30px); margin: 0 auto; overflow-y: auto; padding: 20px 18px calc(24px + var(--safe-bottom)); border-radius: 24px 24px 0 0; background: var(--paper); box-shadow: var(--shadow); }
.modal__head { position: sticky; top: -20px; z-index: 2; display: flex; align-items: center; gap: 12px; margin: -20px -18px 20px; padding: 17px 18px; background: rgba(244,241,233,.97); border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font: 400 27px var(--serif); }
.modal__close { width: 40px; height: 40px; margin-left: auto; border: 1px solid var(--line); border-radius: 10px; background: transparent; }
.modal form { display: grid; gap: 15px; }
.modal__actions { position: sticky; bottom: calc(-24px - var(--safe-bottom)); display: flex; gap: 9px; margin: 8px -18px calc(-24px - var(--safe-bottom)); padding: 14px 18px calc(18px + var(--safe-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.modal__actions .button { flex: 1; }

.photo-picker { display: flex; align-items: center; gap: 14px; }
.photo-picker__preview { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--paper-2); color: var(--muted); }
.photo-picker__preview img { width: 100%; height: 100%; object-fit: cover; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.gedcom-people { max-height: 48dvh; display: grid; gap: 7px; overflow-y: auto; }
.gedcom-file-summary { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-2); font-size: 13px; }
.gedcom-file-summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gedcom-file-summary span { flex: 0 0 auto; color: var(--muted); }
.gedcom-search { margin-bottom: 12px; }
.gedcom-person { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.gedcom-person input { width: 19px; height: 19px; }
.gedcom-person span { display: grid; }
.gedcom-person small { color: var(--muted); }

.toast { position: fixed; right: 16px; bottom: calc(88px + var(--safe-bottom)); left: 16px; z-index: 200; max-width: 520px; margin: auto; padding: 13px 16px; border-radius: 12px; background: var(--moss-dark); color: #fff; box-shadow: var(--shadow); font-size: 13px; text-align: center; }
.toast--error { background: #762f2a; }

.install-tip { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--fact-bg); }
.install-tip h3 { margin: 0 0 6px; font: 400 21px var(--serif); }
.install-tip p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.main-menu__intro { margin: -4px 0 18px; color: var(--muted); line-height: 1.6; }
.main-menu { display: grid; border-top: 1px solid var(--line); }
.main-menu button { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.main-menu button span { font: 400 23px/1.2 var(--serif); }
.main-menu button b { color: var(--clay); font-size: 24px; font-weight: 400; }
.main-menu button[aria-current="page"] span { color: var(--moss); font-weight: 700; }

.info-page > h1 { margin: 0; font: 400 clamp(42px, 11vw, 62px)/1 var(--serif); letter-spacing: -.045em; }
.info-page__lead { margin: 24px 0 30px; color: var(--muted); font: 400 21px/1.55 var(--serif); }
.walk-guide-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; border: 0; background: none; color: var(--moss); font: inherit; font-size: 13px; line-height: 1.5; text-align: left; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.person-hero .walk-guide-link { color: inherit; }
.home-choice__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.walk-guide { max-width: 820px; padding-bottom: 64px; }
.walk-guide__intro { position: relative; padding: 26px 0 44px; }
.walk-guide__intro::after { content: ''; display: block; width: 72px; height: 2px; margin-top: 34px; background: var(--clay); }
.walk-guide h1 { max-width: 680px; margin: 0 0 38px; font: 400 clamp(46px, 10vw, 76px)/.98 var(--serif); letter-spacing: -.048em; }
.walk-guide__intro-copy { max-width: 650px; }
.walk-guide .eyebrow { margin-bottom: 11px; color: var(--clay); }
.walk-guide__intro-copy > p:not(.eyebrow) { font-size: 16px; line-height: 1.8; }
.walk-guide__lead { margin: 0 0 18px; color: var(--moss-dark); font: 400 25px/1.48 var(--serif) !important; }
.walk-guide__invitation { margin: 24px 0 0; color: var(--moss); font-weight: 760; }
.walk-guide__art { position: relative; margin: 0 0 58px; overflow: hidden; border: 1px solid rgba(82,106,91,.18); border-radius: 26px 8px 26px 8px; background: #eee8da; box-shadow: 0 18px 48px rgba(39,55,47,.09); }
.walk-guide__art::after { content: ''; position: absolute; inset: 0; border: 8px solid rgba(255,253,248,.25); pointer-events: none; }
.walk-guide__art img { display: block; width: 100%; aspect-ratio: 2.4 / 1; object-fit: cover; }
.walk-guide section { margin: 54px 0; }
.walk-guide h2 { margin: 0 0 22px; font: 400 clamp(32px, 6vw, 42px)/1.13 var(--serif); letter-spacing: -.03em; }
.walk-guide section p { font-size: 16px; line-height: 1.8; }
.walk-guide__distinction { max-width: 690px; }
.walk-guide__thought { margin: 32px 0; padding: 28px 30px; border: 0; border-left: 4px solid var(--clay); border-radius: 0 18px 18px 0; background: var(--surface); box-shadow: 0 10px 34px rgba(39,55,47,.06); }
.walk-guide__thought p { margin: 0; color: var(--moss-dark); font: 400 clamp(25px, 5vw, 33px)/1.45 var(--serif) !important; }
.walk-guide__practice { scroll-margin-top: 90px; padding-top: 42px; border-top: 1px solid var(--line); }
.walk-guide ol { display: grid; gap: 16px; margin: 28px 0 0; padding: 0; list-style: none; counter-reset: walk-step; }
.walk-guide li { position: relative; margin: 0; padding: 26px 26px 26px 78px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.72); counter-increment: walk-step; }
.walk-guide li::before { content: counter(walk-step); position: absolute; top: 23px; left: 24px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(185,120,80,.55); border-radius: 50%; color: var(--clay); font: 400 21px var(--serif); }
.walk-guide h3 { margin: 0 0 10px; color: var(--moss-dark); font: 400 25px/1.25 var(--serif); }
.walk-guide li p { margin: 10px 0 0; }
.walk-guide__words { margin: 18px 0; padding: 18px 20px; border-left: 2px solid var(--moss); background: var(--fact-bg); }
.walk-guide__words p { margin: 0; color: var(--moss-dark); font: italic 400 20px/1.65 var(--serif) !important; }
.walk-guide__noticing { color: var(--clay); font: 400 21px/1.6 var(--serif) !important; }
.walk-guide__note { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.walk-guide__note p { margin: 0 0 8px; font-size: 14px !important; }
.walk-guide__note p:last-child { margin-bottom: 0; color: var(--ink); font-weight: 750; }
.walk-guide__wingbeat { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 24px; margin-right: -20px !important; margin-left: -20px !important; padding: 42px 38px; border-radius: 28px 8px 28px 8px; background: var(--moss-dark); color: #f8f5ed; box-shadow: var(--shadow); }
.walk-guide__wingbeat .eyebrow { color: #d4a47f; }
.walk-guide__wingbeat h2 { color: #fff; }
.walk-guide__wingbeat p { color: rgba(255,255,255,.78); }
.walk-guide__wingbeat-mark { display: grid; width: 68px; height: 68px; place-items: center; border: 1px solid rgba(255,255,255,.24); color: #d4a47f; font: 400 42px var(--serif); }
.walk-guide__wingbeat-line { color: #fff !important; font: 400 22px/1.6 var(--serif) !important; }
.walk-guide__takeaway { max-width: 690px; }
.walk-guide__closing { margin-top: 30px; padding: 24px 0 0; border-top: 1px solid var(--line); color: var(--moss-dark); font: 400 clamp(25px, 5vw, 32px)/1.5 var(--serif) !important; }
.walk-guide__actions { justify-content: space-between; padding-top: 26px; border-top: 1px solid var(--line); }
@media (max-width: 620px) {
  .home-choice__actions, .home-choice__actions > .button { width: 100%; }
  .walk-guide { padding-right: 18px; padding-left: 18px; }
  .walk-guide__intro { padding-top: 18px; }
  .walk-guide h1 { margin-bottom: 30px; }
  .walk-guide__art { margin-right: -18px; margin-left: -18px; border-right: 0; border-left: 0; border-radius: 0; }
  .walk-guide__art::after { border-right: 0; border-left: 0; }
  .walk-guide__thought { padding: 22px 20px; }
  .walk-guide li { padding: 68px 20px 22px; }
  .walk-guide li::before { top: 20px; left: 20px; }
  .walk-guide__wingbeat { grid-template-columns: 1fr; gap: 18px; margin-right: -18px !important; margin-left: -18px !important; padding: 32px 24px; border-radius: 0; }
  .walk-guide__wingbeat-mark { width: 56px; height: 56px; }
  .walk-guide__actions .button { flex: 1; }
}
.info-card { margin: 16px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.info-card h2 { margin: 0 0 10px; font: 400 25px/1.25 var(--serif); }
.info-card p { margin: 0; color: var(--muted); line-height: 1.7; }
.read-aloud { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; margin: 0 0 22px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--moss-dark); font-size: 13px; font-weight: 720; }
.read-aloud > span { color: var(--clay); font-size: 10px; }
.read-aloud[aria-pressed="true"] { border-color: var(--moss); background: var(--fact-bg); }
.home-hero__image .read-aloud--icon { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; margin: 0; border-radius: 50%; background: rgba(255,253,247,.92); }
.home-content > .today-card + .journey-invitation { margin-top: 24px; }
.reader-unavailable .read-aloud { display: none; }
.reader-bar { position: fixed; right: 14px; bottom: calc(88px + var(--safe-bottom)); left: 14px; z-index: 300; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 9px; max-width: 680px; min-height: 56px; margin: auto; padding: 9px 10px 9px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: var(--moss-dark); color: #fff; box-shadow: 0 18px 48px rgba(20,29,24,.3); }
.reader-bar__mark { color: #d4a47f; font-size: 11px; }
.reader-bar__status { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.reader-bar button { min-height: 36px; padding: 0 11px; border: 1px solid rgba(255,255,255,.26); border-radius: 10px; background: transparent; color: #fff; font-size: 12px; }

.layer-tag--audio { color: #fff; background: var(--moss); }
.audio-section { margin-top: 34px; }
.audio-list { display: grid; gap: 10px; }
.audio-card { position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(180px, 260px); align-items: center; gap: 14px; padding: 15px 48px 15px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.audio-card strong, .audio-card small { display: block; }
.audio-card strong { font-size: 14px; overflow-wrap: anywhere; }
.audio-card small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.audio-card audio, .audio-preview audio { width: 100%; min-height: 40px; }
.audio-card__delete { position: absolute; top: 9px; right: 9px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; }
.audio-recorder { display: grid; justify-items: center; gap: 15px; padding: 24px 0 8px; text-align: center; }
.audio-recorder__pulse { width: 68px; height: 68px; border: 2px solid var(--clay); border-radius: 50%; background: rgba(185,120,80,.1); }
.audio-recorder[data-state="recording"] .audio-recorder__pulse { background: var(--clay); box-shadow: 0 0 0 10px rgba(185,120,80,.12); animation: audio-pulse 1.5s ease-in-out infinite; }
.audio-recorder > strong { font: 400 36px var(--serif); }
.audio-recorder > p { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.6; }
.audio-recorder > small { max-width: 430px; color: var(--muted); line-height: 1.5; }
.audio-preview { margin-bottom: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.audio-preview p { margin: 9px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
@keyframes audio-pulse { 50% { transform: scale(.92); opacity: .8; } }

.open-export { max-width: 820px; padding-bottom: 70px; }
.open-export > .read-aloud { float: right; margin-top: 8px; }
.open-export > h1 { margin: 8px 0 18px; font: 400 clamp(44px, 9vw, 68px)/1 var(--serif); letter-spacing: -.045em; }
.open-export__lead { max-width: 650px; color: var(--moss); font: 400 22px/1.55 var(--serif); }
.open-export__warning { clear: both; margin: 26px 0 34px; }
.export-group { min-width: 0; margin: 0 0 20px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.72); }
.export-group legend { padding: 0 9px; color: var(--moss-dark); font: 400 24px var(--serif); }
.export-tools { display: flex; gap: 8px; margin-bottom: 14px; }
.export-tools button { padding: 5px 0; border: 0; background: none; color: var(--moss); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.export-people { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; max-height: 310px; overflow-y: auto; }
.export-people label, .export-options label, .export-formats label { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.export-people input, .export-options input, .export-formats input { flex: 0 0 auto; width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--moss); }
.export-people span, .export-options span, .export-formats span, .export-people strong, .export-options strong, .export-formats strong, .export-people small, .export-options small, .export-formats small { display: block; min-width: 0; }
.export-people strong, .export-options strong, .export-formats strong { font-size: 14px; overflow-wrap: anywhere; }
.export-people small, .export-options small, .export-formats small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.export-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.export-formats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.export-formats label:has(input:checked) { border-color: var(--moss); background: var(--fact-bg); }
.open-export__submit { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.open-export__submit p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.open-export__submit .button { flex: 0 0 auto; }
@media (prefers-reduced-motion: reduce) { .audio-recorder[data-state="recording"] .audio-recorder__pulse { animation: none; } }
@media (max-width: 620px) {
  .reader-bar { grid-template-columns: auto 1fr auto; }
  .reader-bar [data-reader-control="pause"] { display: none; }
  .audio-card { grid-template-columns: 1fr; }
  .open-export > .read-aloud { float: none; }
  .export-people, .export-options, .export-formats { grid-template-columns: 1fr; }
  .open-export__submit { align-items: stretch; flex-direction: column; }
  .open-export__submit .button { width: 100%; }
}
.resource-list { display: grid; margin: 28px 0; border-top: 1px solid var(--line); }
.resource-list a { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.resource-list a span, .resource-list a strong, .resource-list a small { display: block; }
.resource-list a strong { margin-bottom: 5px; font-size: 15px; }
.resource-list a small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.resource-list a b { color: var(--clay); font-size: 20px; }
.library-list, .seminar-list { display: grid; gap: 15px; margin: 26px 0; }
.library-card { overflow: hidden; display: grid; grid-template-columns: 116px minmax(0,1fr); min-height: 150px; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: 0 8px 24px rgba(39,55,47,.06); }
.library-card:not(:has(.library-card__image)), .seminar-card:not(:has(.seminar-card__image)) { grid-template-columns: 1fr; }
.library-card__image { width: 100%; height: 100%; min-height: 150px; object-fit: cover; }
.library-card__body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 17px; }
.library-card time, .seminar-card time { color: var(--clay); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.library-card strong { margin: 7px 0; font: 400 22px/1.18 var(--serif); }
.library-card small { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.library-card b, .seminar-card b { margin-top: auto; padding-top: 12px; color: var(--moss-dark); font-size: 12px; }
.library-sync-note { margin: 24px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
.library-article > h1 { margin: 12px 0 24px; font: 400 clamp(40px, 11vw, 62px)/1.03 var(--serif); letter-spacing: -.035em; }
.library-article__hero { width: 100%; max-height: 440px; margin-bottom: 22px; border-radius: 20px; object-fit: cover; }
.library-article__lead { color: var(--muted); font: 400 20px/1.55 var(--serif); }
.library-article__content { margin: 30px 0; font-size: 16px; line-height: 1.75; }
.library-article__content h2, .library-article__content h3, .library-article__content h4, .library-article__content h5 { margin: 1.5em 0 .55em; font: 400 30px/1.2 var(--serif); }
.library-article__content h3 { font-size: 25px; }
.library-article__content h4, .library-article__content h5 { font-size: 21px; }
.library-article__content p, .library-article__content ul, .library-article__content ol { margin: 0 0 1.15em; }
.library-article__content ul, .library-article__content ol { padding-left: 1.35em; }
.library-article__content blockquote { margin: 1.3em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--clay); color: var(--muted); font: 400 19px/1.6 var(--serif); }
.library-article__content img { display: block; max-width: 100%; max-height: 520px; margin: 22px auto; border-radius: 16px; object-fit: contain; }
.library-article__content a { color: var(--moss-dark); text-underline-offset: 3px; }
.library-article__content code { padding: 2px 5px; border-radius: 5px; background: var(--paper-2); font-size: .9em; }
.seminar-card { overflow: hidden; display: grid; grid-template-columns: 132px minmax(0,1fr); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: inherit; text-decoration: none; box-shadow: 0 8px 24px rgba(39,55,47,.06); }
.seminar-card__image { width: 100%; height: 100%; min-height: 210px; object-fit: cover; }
.seminar-card > span { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 18px; }
.seminar-card strong { margin: 8px 0; font: 400 24px/1.2 var(--serif); }
.seminar-card small { color: var(--moss-dark); font-size: 13px; line-height: 1.45; }
.seminar-card p { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.help-steps { display: grid; margin: 30px 0; }
.help-steps article { display: flex; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.help-steps article > span { flex: 0 0 34px; color: var(--clay); font: 400 26px var(--serif); }
.help-steps h2 { margin: 0 0 7px; font: 400 23px/1.3 var(--serif); }
.help-steps p { margin: 0; color: var(--muted); line-height: 1.65; }
.author-card { display: grid; grid-template-columns: 74px 1fr; gap: 20px; margin: 30px 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.author-card__mark { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; background: var(--moss-dark); color: #fff; font: 400 25px var(--serif); }
.author-card h2 { margin: 0 0 8px; font: 400 27px/1.2 var(--serif); }
.author-card p { margin: 0; color: var(--muted); line-height: 1.65; }

.period-person { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.period-person > span { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--paper-2); color: var(--moss); font: 400 22px var(--serif); }
.period-person img { width: 100%; height: 100%; object-fit: cover; }
.period-person div { display: grid; gap: 3px; }
.period-person small { color: var(--muted); font-size: 12px; }
.period-person strong { font: 400 24px/1.2 var(--serif); }
.period-choices { display: grid; gap: 10px; }
.period-choices button { min-height: 76px; display: grid; align-content: center; gap: 5px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; }
.period-choices button:hover { border-color: var(--moss); background: var(--fact-bg); }
.period-choices span { font-weight: 800; }
.period-choices small { color: var(--muted); font-size: 12px; line-height: 1.45; }

@media (min-width: 760px) {
  .auth__body { width: min(720px, calc(100% - 48px)); margin: 0 auto; }
  .bottom-nav { right: 50%; left: auto; width: min(620px, 100%); transform: translateX(50%); border-right: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 18px 18px 0 0; }
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { max-height: calc(100dvh - 48px); border-radius: 22px; }
}

@media (max-width: 420px) {
  .field-row, .facts-grid { grid-template-columns: 1fr; }
  .difficult-entry { grid-template-columns: 1fr; gap: 9px; }
  .author-card { grid-template-columns: 1fr; }
  .library-card, .seminar-card { grid-template-columns: 1fr; }
  .library-card__image { height: 170px; min-height: 0; }
  .seminar-card__image { height: 190px; min-height: 0; }
  .ancestor-card { width: 108px; }
  .ancestor-node { width: 108px; }
  .ancestor-node:has(.ancestor-card--self) { width: 108px; }
  .satellite { width: 48px; }
  .page { padding-right: 14px; padding-left: 14px; }
  .person-hero { margin-right: -14px; margin-left: -14px; }
  .fan-scroll { margin-right: -14px; margin-left: -14px; padding-right: 14px; padding-left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
/* Quiet line drawings: wings, a feather and the paths that connect us. */
.line-icon { display: block; width: 24px; height: 24px; flex-shrink: 0; }
.bottom-nav button > span:first-child { display: grid; place-items: center; width: 32px; height: 28px; }
.bottom-nav .line-icon { width: 22px; height: 22px; }
.bottom-nav button.active > span:first-child { border-radius: 14px 14px 7px 7px; background: rgba(185,152,99,.13); }
.page-heading::after { content: ''; flex: 0 0 76px; height: 48px; background: url('../assets/wings-ornament.svg') center / contain no-repeat; opacity: .8; pointer-events: none; }
.home-hero__detail .line-icon { width: 54px; height: 38px; stroke-width: .85; }
.home-choice { background: radial-gradient(ellipse at 100% 0, rgba(185,152,99,.09), transparent 65%), var(--surface); }
.home-choice__mark { display: block; margin-bottom: 16px; color: #967547; }
.home-choice__mark .line-icon { width: 40px; height: 32px; stroke-width: 1; }
.person-hero { position: relative; isolation: isolate; overflow: hidden; }
.person-hero::before { content: ''; position: absolute; z-index: -1; top: 0; left: 50%; width: min(460px, 100%); height: 210px; transform: translateX(-50%); background: url('../assets/wings-ornament.svg') center / contain no-repeat; opacity: .42; pointer-events: none; }
.person-photo { box-shadow: 0 0 0 6px var(--moss-dark), 0 0 0 7px rgba(185,152,99,.45); }
.quiet-illustration { width: 160px; height: 120px; margin: 0 auto 16px; color: var(--moss); }
.quiet-illustration svg { display: block; width: 100%; height: 100%; }
.empty-state:has(.quiet-illustration) { border-style: solid; background: radial-gradient(ellipse at 50% 0, rgba(185,152,99,.07), transparent 65%), var(--surface); }
.journal-page .journal-card { position: relative; border-left: 3px solid #b99863; padding-left: 23px; box-shadow: 0 3px 0 -1px var(--paper-2), 0 4px 0 -1px var(--line); }
.journal-page .journal-card + .journal-card { margin-top: 16px; }
.journal-page > .today-card { position: relative; margin-top: 20px; border-radius: 18px; }
.journal-page .today-card__image { position: absolute; top: 18px; left: 18px; width: 56px; height: 76px; border-radius: 10px; overflow: hidden; }
.journal-page .today-card__image .person-silhouette { width: 42px; height: 66px; }
.journal-page .today-card__body { padding: 18px; }
.journal-page .today-card__body > .eyebrow { margin: 0 0 6px 74px; font-size: 10px; line-height: 1.5; }
.journal-page .today-card h2 { margin-left: 74px; font-size: 27px; line-height: 1.15; overflow-wrap: anywhere; }
.journal-page .today-card__body > p:not(.eyebrow) { margin: 7px 0 0 74px; font-size: 14px; line-height: 1.5; }
.journal-page .today-card__body .button-row { margin-top: 20px; gap: 12px; }
.journal-page .today-card__open { min-height: 36px; font-size: 12px; }
.journal-page > .today-card + .button-row { margin: 20px 0 28px; }
.journal-page > .today-card + .button-row > .button { width: 100%; }
.journal-page > h2 { margin: 0 0 18px; font-size: 22px; line-height: 1.3; }
.home-lineage figcaption::before { content: ''; display: block; width: 32px; height: 1px; margin: 0 auto 14px; background: #b99863; }
@media (min-width: 1200px) {
  .bottom-nav::after { content: ''; position: absolute; right: 16px; bottom: 110px; left: 16px; height: 78px; background: url('../assets/wings-ornament.svg') center / contain no-repeat; opacity: .6; pointer-events: none; }
  .bottom-nav button.active > span:first-child { background: transparent; }
  .desktop-tree-pane .page-heading::after { flex-basis: 56px; }
  .desktop-person-pane .person-hero::before { height: 145px; }
}
@media (max-width: 380px) {
  .page-heading::after { flex-basis: 48px; height: 36px; }
}

/* Device pairing uses the existing modal and button system on phone and desktop. */
.sync-actions, .sync-auth { display: grid; gap: 12px; margin: 20px 0; }
.sync-actions .button, .sync-auth .button { white-space: normal; text-align: center; }
.sync-panel p { overflow-wrap: anywhere; }
.sync-setup { max-width: 560px; margin: 0 auto; }
.sync-setup h1 { font: 400 clamp(30px,5vw,42px)/1.15 var(--serif); }
.sync-setup p, .sync-complete p { line-height: 1.7; }
.sync-complete { display: grid; gap: 12px; }
.sync-complete p { margin: 0; }
.sync-setup > .button { margin-top: 24px; }
.sync-setup form { display: grid; gap: 16px; }
.sync-progress { border: 1px solid #cbd4cb; border-radius: 16px; padding: 18px; background: #f8faf6; scroll-margin: 24px; }
.sync-progress__heading { display: flex; align-items: center; gap: 12px; }
.sync-progress p { margin: 12px 0; }
.sync-progress progress { display: block; width: 100%; height: 8px; accent-color: var(--moss-dark); }
.sync-progress [hidden], .sync-progress[hidden] { display: none; }
.sync-progress ol { padding: 0; margin: 18px 0; list-style: none; display: grid; gap: 9px; font-size: 14px; }
.sync-progress li { display: flex; gap: 9px; align-items: center; color: var(--muted); }
.sync-progress li::before { content: '○'; flex: 0 0 18px; }
.sync-progress li[data-step=done]::before { content: '✓'; }
.sync-progress li[data-step=current] { color: var(--moss-dark); font-weight: 700; }
.sync-progress li[data-step=current]::before { content: '●'; }
.sync-progress small { color: var(--muted); }
.sync-progress[data-failed=true] { border-color: #b77e6b; }
.sync-spinner { width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid #d2dbd1; border-top-color: var(--moss-dark); border-radius: 50%; animation: sync-spin 1s linear infinite; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync-spinner { animation: none; } }
.sync-video[hidden] { display: none; }
.ai-access-panel,.external-ai { padding:20px; margin:24px 0; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.ai-access-panel summary,.external-ai summary { cursor:pointer; font-weight:700; }
.ai-access-panel p,.external-ai p { line-height:1.65; }
.ai-access-request { display:grid; gap:12px; margin:18px 0; padding:17px; border:1px solid rgba(82,106,91,.28); border-radius:13px; background:var(--paper); }
.ai-access-request h3,.ai-access-request p { margin:0; }
.ai-access-request--pending { border-color:rgba(185,120,80,.42); background:#f7eee4; }
.ai-access-code { margin-top:20px; padding-top:18px; border-top:1px solid var(--line); }
.ai-access-panel [data-ai-access-error], [data-exchange-error] { color:#8d392b; overflow-wrap:anywhere; }
.external-ai textarea { width:100%; box-sizing:border-box; }
.ai-lock-icon { display:inline-flex; flex-shrink:0; margin-right:7px; font-size:14px; vertical-align:middle; }
.exchange-list article { padding:20px 0; border-top:1px solid var(--line); }
.exchange-list pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:300px; overflow:auto; font-size:12px; }
.external-ai h3 { margin-top:0; }
.sync-qr { width: min(100%, 300px); margin: 20px auto; background: white; border-radius: 12px; padding: 8px; }
.sync-qr svg { display: block; width: 100%; height: auto; }
.sync-video { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; background: #18241e; }
.sync-panel [data-sync-error]:empty { display: none; }
.sync-panel [data-sync-error] { color: #9e362e; }
.desktop-only { display: none; }
.tree-search { position: relative; z-index: 12; margin: 18px 0; }
.tree-search__results { position: absolute; top: 100%; right: 0; left: 0; max-height: 300px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.tree-search__results button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.tree-search__results button:hover, .tree-search__results button:focus-visible { background: var(--fact-bg); }
.tree-search__results small { color: var(--muted); }
.tree-search__results p { padding: 8px; color: var(--muted); }
.ancestor-card--selected { outline: 3px solid var(--moss); outline-offset: 4px; }
.material-drop { display: grid; justify-items: center; gap: 12px; margin-top: 18px; padding: 24px 18px; border: 1px dashed var(--moss); border-radius: 16px; background: var(--surface); text-align: center; }
.material-drop__mark { font-size: 28px; color: var(--moss); }
.material-drop p { margin: 0; line-height: 1.5; }
.material-drop small { color: var(--muted); line-height: 1.5; }
.material-drop--active { outline: 3px solid var(--moss); background: var(--fact-bg); }
.material-selection { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 1200px) {
  .desktop-only { display: block; }
  .app-shell:has(.bottom-nav:not([hidden])) { padding-left: 168px; }
  .screen { padding-bottom: 32px; }
  .app-footer { padding: 18px 24px 28px; }
  .bottom-nav { top: 0; bottom: 0; left: 0; right: auto; width: 168px; height: 100dvh; transform: none; display: flex; flex-direction: column; gap: 8px; padding: 28px 14px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--moss-dark); }
  .bottom-nav::before { content: 'KŘÍDLA'; margin: 0 0 38px; padding: 10px; color: var(--paper); font-size: 15px; font-weight: 800; letter-spacing: .16em; }
  .bottom-nav button { min-height: 52px; grid-template-columns: 26px 1fr; justify-items: start; align-content: center; gap: 12px; padding: 12px; border-radius: 10px; color: #d1dbd3; font-size: 14px; text-align: left; }
  .bottom-nav button:hover { background: #ffffff0d; }
  .bottom-nav button.active { color: var(--moss-dark); background: var(--paper); }
  .bottom-nav button.active::after { display: none; }
  .bottom-nav button:last-child { margin-top: auto; }
  .topbar { padding-right: 28px; padding-left: 28px; }
  .page { width: min(980px, 100%); padding: 32px 36px 48px; }
  .page--wide { width: 100%; }
  .app-shell:has(.desktop-workspace) { height: 100dvh; min-height: 0; overflow: hidden; }
  .screen:has(> .desktop-workspace) { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; padding: 0; }
  .screen:has(> .desktop-workspace) ~ .app-footer { display: none; }
  .desktop-workspace { display: grid; grid-template-columns: minmax(0, 1fr) clamp(400px, 34vw, 520px); min-height: 0; }
  .desktop-tree-pane, .desktop-person-pane { min-width: 0; min-height: 0; }
  .desktop-tree-pane { display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }
  .desktop-tree-content, .desktop-person-pane { overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .desktop-tree-content { min-height: 0; overflow-x: hidden; }
  .desktop-tree-scrollbar { min-width: 0; height: 20px; overflow-x: scroll; overflow-y: hidden; scrollbar-color: var(--moss) var(--paper-2); background: var(--paper-2); border-top: 1px solid var(--line); }
  .desktop-tree-scrollbar > div { height: 1px; }
  .desktop-tree-scrollbar:focus-visible { outline: 2px solid var(--moss); outline-offset: -2px; }
  .desktop-tree-scrollbar::-webkit-scrollbar { height: 16px; }
  .desktop-tree-scrollbar::-webkit-scrollbar-thumb { background: var(--moss); border: 3px solid var(--paper-2); border-radius: 8px; }
  .desktop-tree-scrollbar::-webkit-scrollbar-track { background: var(--paper-2); }
  .desktop-tree-pane .page { padding: 28px 24px; }
  .desktop-tree-pane .page-heading { margin-bottom: 14px; }
  .desktop-tree-pane .page-heading h1 { font-size: 36px; }
  .desktop-tree-pane .notice { padding: 10px 12px; font-size: 12px; margin-bottom: 12px; }
  .desktop-tree-pane .tree-search { margin: 12px 0; }
  .desktop-tree-pane .fan-scroll { margin-right: -24px; margin-left: -24px; scrollbar-width: none; }
  .desktop-tree-pane .fan-scroll::-webkit-scrollbar { height: 0; }
  .desktop-person-pane { border-left: 1px solid var(--line); background: var(--surface); }
  .desktop-person-pane .page { padding: 24px; }
  .desktop-person-pane .topbar { top: 0; padding: 10px 18px; background: rgba(255,253,248,.96); }
  .desktop-person-pane .person-hero { padding: 26px 22px; }
  .desktop-person-pane .person-hero h1 { font-size: 36px; }
  .desktop-person-pane .person-photo { width: 76px; height: 76px; }
  .desktop-empty { max-width: 400px; margin: 12vh auto 0; padding: 40px; text-align: center; }
  .desktop-empty > span { display: block; margin-bottom: 28px; color: var(--moss); font-size: 62px; }
  .desktop-empty h2 { font: 400 36px/1.15 var(--serif); }
  .desktop-empty > p:last-child { color: var(--muted); font-size: 15px; line-height: 1.8; }
  .modal:has(textarea), .modal:has(#personForm) { width: min(880px, calc(100vw - 80px)); padding: 28px 32px; }
  .modal textarea { min-height: 230px; line-height: 1.75; }
  #journalForm { max-width: none; }
  #journalForm textarea { min-height: 280px; padding: 20px; font-size: 17px; line-height: 1.8; }
  .modal__actions { position: sticky; bottom: -28px; padding-top: 14px; padding-bottom: 14px; background: var(--paper); }
  .toast { left: 184px; bottom: 28px; }
}
.ai-access-panel { scroll-margin-top: 90px; } .ai-access-panel button.text-link, .external-ai button.text-link, .exchange-list button.text-link { border: 0; background: transparent; color: var(--moss-dark); padding: 8px 0; font: inherit; text-decoration: underline; cursor: pointer; }
