/* Shared reading, brand and compact-layout rules. Scene artwork stays intact. */
:root {
  --sans: "Avenir Next", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}
html:lang(zh-Hant) { --serif: "Songti TC", "Noto Serif CJK TC", serif; --sans: "PingFang TC", "Noto Sans CJK TC", system-ui, sans-serif; }
html:lang(ja) { --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif; --display-serif: var(--serif); --sans: "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", system-ui, sans-serif; }
html:lang(ko) { --serif: "AppleMyungjo", "Noto Serif CJK KR", serif; --display-serif: var(--serif); --sans: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", system-ui, sans-serif; word-break: keep-all; }
html:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)) { --display-serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.brand { flex-shrink: 0; }
.brand-mark { aspect-ratio: 1; flex: 0 0 auto; }
.brand-mark .icon { display: block; }
.brand-copy strong { line-height: 1.2; }
.brand-copy small { line-height: 1.45; }
.rail-short { max-width: 100%; font-family: var(--sans); font-size: .72rem; line-height: 1.25; letter-spacing: .03em; text-indent: 0; white-space: normal; overflow-wrap: break-word; hyphens: auto; text-wrap: balance; }
.field, .auth-footnote, .agreement, .auth-switch, .composer-meta,
.history-summary, .history-center-bar, .history-answer, .answer-prose,
.covenant-row p, .membership-note, .membership-status-line,
.share-path-step p, .share-verification p,
.about-manifesto > p, .about-principles p, .legal-paper p {
  font-family: var(--sans);
  line-height: 1.8;
}
.inner-heading > p:last-child { font-family: var(--sans); }
.about-principles { background: rgba(239, 247, 250, .92) !important; border: 1px solid rgba(61, 95, 109, .2); border-radius: 6px; }
.about-principles p { color: #344d59; font-size: .9rem; }
.about-manifesto { background: linear-gradient(145deg, rgba(243, 249, 250, .95), rgba(216, 232, 238, .9)) !important; }
.about-manifesto > p:not(.eyebrow) { color: #344d59; }
.share-path-step p { color: #d9e4ed; font-size: .86rem; text-shadow: 0 1px 3px rgba(4, 20, 34, .5); }
.share-path-step h2 { line-height: 1.45; }
.share-sheet-action { background: rgba(248, 238, 216, .72) !important; border-radius: 3px; }
html[data-view="membership"] .membership-note { color: #46504c; font-size: .8rem; }
.void-copy > p:last-child { font-family: var(--sans); letter-spacing: .025em; }
.composer-paper label { right: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.membership-compact-plans { display: none; }
.has-modal { overflow: hidden; }
.modal-backdrop { overflow-y: auto; overscroll-behavior: contain; }
.modal-paper { max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; border-radius: 8px; }
.modal-close { z-index: 3; }
.public-legal-page .inner-layout { padding-left: max(1rem, calc((100vw - 800px) / 2)); }
.public-legal-page .legal-paper { background: rgba(252, 250, 244, .97); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
@media (min-width: 761px) {
  .share-hero { max-width: calc(100vw - 11rem); }
  .share-path { transform: none; }
}
@media (max-width: 760px) {
  html[data-view="share"] { --ink: #edf3f7; --ink-soft: #d4e1eb; --ink-faint: #bacbd7; --surface-strong: #163047; --surface-soft: rgba(19, 43, 62, .96); --border-soft: rgba(223, 237, 246, .22); }
  html[data-view="share"] .topbar::after { background: linear-gradient(#0c2238, rgba(12, 34, 56, .82) 60%, transparent); }
  html[data-view="share"] .topbar, html[data-view="share"] .ink-logo { color: #edf3f7; }
  html[data-view="share"] .topbar-actions button { color: #e0ecf4; }
  .ink-rail { display: block; position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: auto; z-index: 25; padding: .3rem .3rem max(.35rem, env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--border-soft); background: rgba(251, 249, 243, .98); box-shadow: 0 -6px 24px rgba(24, 36, 33, .07); }
  .ink-rail nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .15rem; margin: 0; }
  .ink-rail .rail-top, .ink-rail::after, .rail-link::before, .rail-label, .rail-glyph i { display: none; }
  .rail-link { width: 100%; min-height: 3.5rem; padding: .3rem .15rem; gap: .25rem; border-radius: 7px; color: #4b5d5b; }
  .rail-short { font-size: .64rem; line-height: 1.22; letter-spacing: 0; overflow-wrap: break-word; hyphens: auto; text-wrap: balance; }
  .rail-glyph { height: 1.1rem; }
  .rail-link.is-active { color: #243b38; background: #e4ebe5; box-shadow: none; }
  html[data-view="share"] .ink-rail { background: #0c2238; }
  html[data-view="share"] .rail-link { color: #cedde7; }
  html[data-view="share"] .rail-link.is-active { background: #244258; color: white; }
  .inner-layout, .history-scene-layout, .membership-scene-layout, .share-scene-layout,
  html[data-view="history"] .inner-layout, html[data-view="membership"] .inner-layout { padding-bottom: calc(6.3rem + env(safe-area-inset-bottom)); }
  .ink-composer { bottom: calc(5rem + env(safe-area-inset-bottom)); }
  .question-stage.has-dialogue { padding-bottom: 5.5rem; }
  .history-drawer { bottom: 5rem; }
  .question-void { padding-top: 13vh; min-height: 0; }
  .void-copy h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .void-copy > p:last-child { font-size: .88rem; max-width: 28rem; }
  .share-hero { padding: 1rem; background: rgba(9, 30, 48, .88); border-radius: 7px; }
  .share-hero > p { color: #dce7ee; }
  html[data-view="share"] .share-hero h1, html[data-view="share"] .share-hero > p { text-shadow: none; }
  .share-talisman { min-height: 0; padding: 1.4rem; border: 1px solid rgba(249, 231, 196, .44); border-radius: 6px; background: rgba(245, 238, 223, .97); }
  .share-talisman-copy { justify-content: space-between; align-items: baseline; }
  .share-path { gap: 1.2rem; transform: none; padding: 1.2rem; background: rgba(9, 30, 48, .91); border: 1px solid rgba(224, 238, 246, .2); border-radius: 7px; }
  .share-path-step { padding: .2rem 0 1rem; }
  .share-path-step p { color: #dce7ee; }
  .share-verification { padding: .8rem 0 0; }
  .history-hero { padding: 1rem; background: rgba(250, 248, 240, .92); border-radius: 6px; }
  .history-ledger { background: rgba(250, 248, 240, .94); border-radius: 6px; }
  .membership-covenant { display: none; }
  .membership-compact-plans { display: grid; gap: 1rem; }
  .membership-compact-plan { padding: 1.3rem; border: 1px solid rgba(46, 61, 55, .23); border-radius: 7px; background: rgba(252, 249, 241, .97); color: #293c35; }
  .membership-compact-plan.is-current { border-color: #506c60; box-shadow: inset 3px 0 #506c60; }
  .membership-compact-plan h2 { margin: 0 0 .3rem; font-family: var(--serif); font-size: 1.65rem; }
  .membership-compact-plan dl { margin: 1rem 0; }
  .membership-compact-plan dl > div { padding: .7rem 0; border-top: 1px solid rgba(46, 61, 55, .16); }
  .membership-compact-plan dt { font-size: .8rem; color: #58665f; }
  .membership-compact-plan dd { margin: .3rem 0 0; font-size: .9rem; line-height: 1.7; }
  .membership-compact-plan button { min-height: 44px; }
  .membership-note { padding: 1rem; background: rgba(252, 249, 241, .94); border-radius: 6px; }
  .about-manifesto, .about-principles { padding: 1.4rem; }
}
@media (max-width: 760px) and (max-height: 680px) {
  html[data-view="app"] .question-stage:not(.has-dialogue) { height: auto; min-height: 100dvh; overflow: visible; padding-bottom: 5.5rem; }
  .question-stage:not(.has-dialogue) .question-void { min-height: 0; padding: 1.5rem 0; }
  .question-stage:not(.has-dialogue) .void-copy { margin: 0; }
  .question-stage:not(.has-dialogue) .void-copy h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin: .5rem 0; }
  .question-stage:not(.has-dialogue) .ink-composer { position: relative; inset: auto; left: auto; transform: none; width: 100%; margin: .5rem auto 0; }
  .auth-intro { min-height: 0; }
}
