.bio-editor { min-width: 0; width: 100%; }
.bio-editor-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 9px; border: 1px solid #dce1ef; border-radius: 12px 12px 0 0; background: linear-gradient(120deg, #fff1f8, #f0f3ff 65%, #eafffa); }
.bio-editor-toolbar button { min-width: 34px; min-height: 34px; padding: 5px 9px; border: 1px solid #d8dbea; border-radius: 7px; background: #fff; color: #17224e; font: 700 15px/1.2 "Barlow Semi Condensed", sans-serif; cursor: pointer; box-shadow: 0 2px 0 #dce0ee; }
.bio-editor-toolbar button:hover:not(:disabled) { border-color: #eb8cb7; background: #fff3f9; }
.bio-editor-toolbar button:focus-visible { outline: 2px solid #22a995; outline-offset: 2px; }
.bio-editor-toolbar button:disabled { opacity: .4; cursor: default; }
.bio-editor-toolbar [data-bio-format="bold"] { font-weight: 900; }
.bio-editor-toolbar [data-bio-format="italic"] { font-style: italic; }
.bio-editor-toolbar [data-bio-format="underline"] { text-decoration: underline; }
.bio-editor-toolbar [data-bio-format="strike"] { text-decoration: line-through; }
.bio-editor-toolbar .bio-preview-toggle { margin-left: auto; background: #e7faf6; color: #236a61; }
.bio-editor textarea { width: 100%; box-sizing: border-box; border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.bio-editor [hidden] { display: none !important; }
.bio-editor .bio-editor-preview { box-sizing: border-box; min-height: 180px; padding: 14px 16px; border: 1px solid #dce1ef; border-top: 0; border-radius: 0 0 10px 10px; background: #fff; color: #17224e; font: 400 1.06rem/1.38 "Barlow Semi Condensed", sans-serif; }
.bio-editor .bio-editor-hint, .bio-editor .bio-editor-status { margin: 6px 0 0; font: 400 13px/1.4 "Barlow Semi Condensed", sans-serif; color: #637094; }
.bio-editor .bio-editor-status { color: #a13660; }
.bio-editor .bio-editor-status:empty { display: none; }
.bio-content { overflow-wrap: anywhere; white-space: pre-wrap; }
.bio-content h2, .bio-content h3 { margin: .35em 0; padding: 0; color: inherit; font-family: inherit; font-weight: 800; line-height: 1.2; letter-spacing: normal; text-transform: none; background: none; border: 0; }
.bio-content h2 { font-size: 1.55em; }
.bio-content h3 { font-size: 1.25em; }
.bio-content ul, .bio-content ol { margin: .3em 0; padding-inline-start: 1.6em; list-style-position: outside; }
.bio-content ul { list-style-type: disc; }
.bio-content ol { list-style-type: decimal; }
.bio-content[data-profile-bio-align="center"] ul, .bio-content[data-profile-bio-align="center"] ol,
.bio-content[data-profile-bio-align="right"] ul, .bio-content[data-profile-bio-align="right"] ol { list-style-position: inside; padding-inline-start: 0; }
.bio-content li { display: list-item; margin: .12em 0; }
.bio-content blockquote { margin: .3em 0; padding: .25em .75em; border-left: 3px solid #6ccfc0; background: #edf9f7; color: inherit; }
.bio-content u { text-underline-offset: .15em; }
.bio-content strong { font-weight: 800; }
.bio-content em { font-style: italic; }
@media (max-width: 480px) { .bio-editor-toolbar { gap: 4px; padding: 7px; } .bio-editor-toolbar button { min-height: 36px; padding-inline: 8px; } }

/* Fit image pairs to the bio width, including the editor preview on mobile. */
.bio-content .profile-bio-image-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; align-items: flex-start; white-space: normal; }
.bio-content .profile-bio-image-row > .profile-bio-image { min-width: 0; max-width: calc(50% - 5px); margin: 0; }
.bio-content .profile-bio-image-row img { box-sizing: border-box; width: auto; height: auto; max-width: 100%; max-height: 220px; }
.bio-content[data-profile-bio-align="center"] .profile-bio-image-row { justify-content: center; }
.bio-content[data-profile-bio-align="right"] .profile-bio-image-row { justify-content: flex-end; }

.bio-content .bio-alignment[data-bio-align="left"] { text-align: left; --bio-section-justify: flex-start; --bio-section-start: 0; --bio-section-end: auto; --bio-section-list: outside; --bio-section-indent: 1.6em; }
.bio-content .bio-alignment[data-bio-align="center"] { text-align: center; --bio-section-justify: center; --bio-section-start: auto; --bio-section-end: auto; --bio-section-list: inside; --bio-section-indent: 0; }
.bio-content .bio-alignment[data-bio-align="right"] { text-align: right; --bio-section-justify: flex-end; --bio-section-start: auto; --bio-section-end: 0; --bio-section-list: inside; --bio-section-indent: 0; }
.bio-content .bio-alignment[data-bio-align] .profile-bio-image-row { justify-content: var(--bio-section-justify); }
.bio-content .bio-alignment[data-bio-align] .profile-bio-image img { margin-inline: var(--bio-section-start) var(--bio-section-end); }
.bio-content .bio-alignment[data-bio-align] ul,
.bio-content .bio-alignment[data-bio-align] ol { list-style-position: var(--bio-section-list); padding-inline-start: var(--bio-section-indent); }

/* Give long bios room to breathe while keeping very long drafts scrollable. */
.bio-editor textarea { min-height: 420px; max-height: min(900px, max(480px, 80dvh)); overflow-y: auto; resize: vertical !important; line-height: 1.5; }
.bio-editor .bio-editor-preview { min-height: 420px; }
@media (max-width: 520px) {
  .bio-editor textarea, .bio-editor .bio-editor-preview { min-height: 320px; }
}
