.bio-reader-tools { position: sticky; top: 0; z-index: 2; display: flex; gap: .7rem; align-items: center; padding: .6rem; background: #fff9ef; border-bottom: 1px solid #d7c9b4; }
.bio-selection-tools[hidden] { display: none; }
.bio-action, .bio-passage-edit { font: inherit; cursor: pointer; padding: .55rem .8rem; border: 1px solid #b8a58a; border-radius: 8px; background: #fff9ef; color: #443526; min-height: 44px; }
.bio-action:disabled { opacity: .55; cursor: default; }
.bio-primary { background: #58442e; color: #fff; }
.bio-toc { padding: 1.2rem 0; border-bottom: 1px solid #d7c9b4; scroll-margin-top: 70px; }
.bio-toc li { padding: .35rem 0; }
.bio-toc a { color: #574028; text-decoration: underline; text-underline-offset: 3px; }
.bio-chapter { scroll-margin-top: 80px; margin: 2rem 0; }
.bio-chapter h3 { font-size: 1.4rem; margin: 1.2rem 0; line-height: 1.35; }
.bio-passage { margin-bottom: 1.4rem; }
.bio-passage .bio-paragraph { white-space: pre-wrap; margin-bottom: .35rem; user-select: text; -webkit-user-select: text; }
.bio-passage-edit { font-family: system-ui, sans-serif; font-size: .8rem; padding: .2rem .55rem; background: transparent; }
.bio-chapter-actions, .bio-editor-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.bio-edit-hint, .bio-edit-status { font-family: system-ui, sans-serif; font-size: .9rem; line-height: 1.5; }
.bio-edit-status:empty { display: none; }
.bio-history { margin: 2rem 0; border-top: 1px solid #d7c9b4; padding-top: 1rem; }
.bio-history summary { cursor: pointer; padding: .6rem 0; }
.bio-history blockquote { white-space: pre-wrap; overflow-wrap: anywhere; margin: .5rem 0; padding-left: 1rem; border-left: 2px solid #b8a58a; }
.bio-edit-dialog { color-scheme: light; width: min(640px, calc(100vw - 32px)); max-height: 90dvh; overflow-y: auto; padding: 1.4rem; border: 1px solid #c9b99e; border-radius: 16px; color: #3e3123; background: #fff9ef; font-family: system-ui, sans-serif; }
.bio-edit-dialog::backdrop { background: rgb(10 15 25 / .7); }
.bio-edit-dialog h3 { margin: 0 0 .8rem; }
.bio-edit-dialog p, .bio-edit-dialog blockquote { line-height: 1.5; }
.bio-edit-dialog blockquote { max-height: 150px; overflow: auto; white-space: pre-wrap; margin: .8rem 0; border-left: 3px solid #b8a58a; padding-left: .8rem; }
.bio-edit-dialog textarea { box-sizing: border-box; width: 100%; min-height: 150px; margin: .5rem 0 1rem; padding: .8rem; font: inherit; line-height: 1.5; background: #fff; color: #302619; border: 1px solid #b8a58a; border-radius: 8px; resize: vertical; }
.bio-name-scope { display: flex; align-items: start; gap: .5rem; margin-bottom: 1rem; font-size: .9rem; }
.bio-name-scope[hidden] { display: none; }
.bio-edit-dialog :focus-visible, .bio-action:focus-visible, .bio-toc a:focus-visible, .bio-passage-edit:focus-visible { outline: 3px solid #247bba; outline-offset: 3px; }
/* The book's clipping must not create an inner scroll container for the toolbar. */
#screen-biography .bio-book-page { overflow: clip; }
.bio-reader-tools { flex-wrap: wrap; }
.bio-passage .bio-paragraph::first-letter { float: none; font: inherit; color: inherit; line-height: inherit; margin: 0; }
@media (max-width: 420px) {
  .bio-chapter, .bio-toc { scroll-margin-top: 120px; }
  .bio-edit-dialog { padding: 1rem; }
}
