/* A quieter, readable layer shared by the family themes. */
:root { --reading-width: 66ch; }
.hero { align-items: center; padding: clamp(1.4rem, 3.5vw, 3.4rem); gap: clamp(1.5rem, 3.5vw, 3.5rem); }
.hero h1 { font-size: clamp(2.7rem, 4.6vw, 4.8rem); line-height: 1.06; letter-spacing: -.045em; }
.hero-description { max-width: 44ch; font-size: 1rem; line-height: 1.7; }
.hero .kicker { font-size: .72rem; letter-spacing: .08em; }
.hero-search { display: flex; flex-wrap: nowrap; align-items: stretch; padding: .3rem; border-color: var(--border); background: var(--paper); }
.hero-search input { flex: 1; width: 0; min-height: 46px; font-size: .94rem; background: transparent; }
.hero-search button { width: auto; max-width: none; min-height: 46px; font-size: .85rem; }
.home-hint { font-size: .78rem; line-height: 1.5; }
.hero-links { display: grid; justify-items: start; gap: .9rem; }
.hero-links a { display: inline-flex; align-items: center; gap: .9rem; min-height: 44px; font: 600 .86rem/1.4 var(--sans); text-underline-offset: .3em; }
.hero-links #start-at-root { justify-content: space-between; padding: .9rem 1.15rem; border: 1px solid var(--accent); border-radius: .7rem; background: var(--accent); color: var(--on-accent); text-decoration: none; }
.hero-links #start-at-root:hover { filter: brightness(1.1); }
.hero-links a:last-child { padding-inline: .15rem; }

/* Names and portraits have room to breathe; connections stay in the background. */
.home-family-panel { padding: 1.25rem; }
.home-family-heading .kicker { font-size: .72rem; letter-spacing: .07em; }
.home-family-map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.65rem 1.2rem; aspect-ratio: auto; padding-block: 1.1rem .5rem; }
.home-family-lines { display: none; }
.home-family-map::before { content: ''; position: absolute; left: 50%; top: 4rem; bottom: 3.3rem; width: 1px; background: var(--world-accent, #e3c38f); opacity: .6; }
.home-family-node { position: relative; inset: auto; width: auto; min-height: 5.4rem; padding: .8rem; gap: .65rem; border-radius: .85rem; box-shadow: 0 5px 12px #071a231a; }
.home-family-velvet { grid-column: 1 / -1; justify-self: center; width: min(100%, 17rem); min-height: 5.6rem; }
.home-family-node:not(.home-family-velvet)::before { content: ''; position: absolute; top: 50%; width: .65rem; height: 1px; background: var(--world-accent, #e3c38f); }
.home-family-gothic::before, .home-family-dungeon::before { left: 100%; }
.home-family-kpop::before, .home-family-pets::before { right: 100%; }
.home-family-portrait { width: clamp(36px, 3.5vw, 50px); }
.home-family-node-copy strong { font: 600 1rem/1.3 var(--serif); overflow-wrap: break-word; }
.home-family-node-copy small { font-size: .7rem; line-height: 1.45; }
.home-family-hint { margin-top: .8rem; font-size: .74rem; line-height: 1.5; }
.stats span { font-size: .8rem; }
.preview-badge { font-size: .74rem; }
.chapter-intro { max-width: var(--reading-width); font-size: .98rem; line-height: 1.7; }
.chapter h2 { font-size: clamp(2rem, 3.6vw, 3.3rem); line-height: 1.12; }
.editorial-copy > p:not(.card-label) { font-size: .94rem; line-height: 1.75; }
.editorial-copy h3 { font-size: clamp(1.45rem, 2.2vw, 1.85rem); line-height: 1.2; }
.editorial-copy .profile-research-links a { font-size: .8rem; min-height: 44px; }
.section-link, .home-research-section .section-link { font-size: .88rem; min-height: 44px; display: inline-flex; align-items: center; }
.anniversary-strip h2 { font-size: 1.7rem; }
.anniversary-list .person-link { min-height: 44px; font-size: .83rem; }

.nav-worlds > summary span { white-space: nowrap; }
.nav-world-menu { max-height: min(75svh, 35rem); overflow-y: auto; overscroll-behavior: contain; }
.nav-world-menu > .kicker { font-size: .7rem; }
.nav-world-choice strong { font-size: .94rem; }
.nav-world-choice small { font-size: .76rem; }
.workspace-bar { font-size: .82rem; line-height: 1.5; }
.field { line-height: 1.5; }
#strom .field, #strom .tree-controls .field { font-size: .8rem; }
#strom .tree-controls select { min-height: 44px; }
.tree-mode-copy small { font-size: .7rem; }
.tree-mode-help, .tree-view-caption, #strom .pedigree-legend { font-size: .8rem; line-height: 1.6; }
.filter-bar button, .directory-toolbar button, .story-toolbar button { min-height: 44px; }
.branch-card p:not(.card-label), .timeline-list li span { font-size: .94rem; line-height: 1.7; }
.world-choice-caption strong { font-size: 1rem; line-height: 1.4; }

/* The writing desk: one clear form and a separate history. */
#zpravy { max-width: 78rem; margin-inline: auto; }
#zpravy > .chapter-intro { margin-bottom: 1.75rem; }
.message-tabs { width: fit-content; padding: .35rem; gap: .35rem; border: 1px solid var(--border); border-radius: .8rem; background: var(--surface); }
.message-tabs button { min-height: 46px; padding: .7rem 1rem; border: 0; border-radius: .55rem; background: transparent; color: var(--muted); font: 600 .88rem/1.35 var(--sans); }
.message-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 7px #0001; }
.message-panel:not([hidden]):has(> .message-editor) { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 1.5rem; align-items: start; }
.message-editor, .message-history { min-width: 0; padding: clamp(1.25rem, 2.5vw, 2rem); border: 1px solid var(--border); border-radius: 1.1rem; background: var(--surface); }
.message-editor { border-top: 3px solid var(--accent); }
.message-editor h3, .message-history h3 { margin: 0 0 .8rem; font: 600 1.5rem/1.25 var(--serif); }
.message-editor > p { max-width: 48ch; margin-block: 0 1.5rem; color: var(--muted); font-size: .94rem; line-height: 1.65; }
.message-form { max-width: none; gap: 1.2rem; padding: 1.25rem; border-radius: .85rem; background: var(--surface); }
.message-editor > .message-form { border: 0; padding: 0; background: transparent; }
.message-form .field { gap: .5rem; color: var(--text); font: 600 .85rem/1.5 var(--sans); }
.message-form :is(input:not([type="checkbox"]), select, textarea) { min-width: 0; width: 100%; min-height: 46px; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: .6rem; background: var(--paper); color: var(--text); font: 400 1rem/1.6 var(--sans); }
.message-form textarea { min-height: 11rem; }
.message-form :is(input, select, textarea):focus { border-color: var(--accent); }
.message-actions { gap: .75rem; align-items: center; margin-top: .25rem; }
.message-actions :is(button, a), .message-form > button { min-height: 46px; padding: .8rem 1.1rem; border-radius: .6rem; font-size: .87rem; }
.message-history .message-list { max-width: none; margin: 0; }
.message-entry { margin-block: .7rem; padding: 1rem; border-color: var(--border); border-radius: .75rem; background: var(--paper); }
.message-entry summary { min-height: 44px; padding-block: .6rem; line-height: 1.5; overflow-wrap: anywhere; font-size: .94rem; }
.message-body { font-size: .95rem; line-height: 1.7; }
.message-empty { display: grid; justify-items: center; gap: .6rem; padding: 2.5rem 1rem; border: 1px dashed var(--border); border-radius: .8rem; background: var(--paper); text-align: center; color: var(--muted); }
.message-empty > span { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--panel); color: var(--accent); font-size: 1.5rem; }
.message-empty p { margin: .4rem 0 0; max-width: 30ch; font-size: .9rem; line-height: 1.65; }
.message-status:not(:empty) { padding: .9rem 1rem; border-inline-start: 3px solid var(--accent); border-radius: .35rem; background: var(--panel); font-size: .9rem; line-height: 1.6; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { max-width: 44rem; }
  .hero-description { max-width: 59ch; }
  .hero h1 { font-size: clamp(2.7rem, 5.5vw, 4.5rem); }
  .home-family-panel { width: 100%; }
  .home-family-map { max-width: 40rem; }
  .hero-links { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1.25rem; }
}
@media (max-width: 800px) {
  .message-panel:not([hidden]):has(> .message-editor) { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .message-history { border-radius: .9rem; }
  .hero-description, .chapter-intro { font-size: .98rem; }
}
@media (max-width: 600px) {
  .hero { padding: 1.25rem; gap: 1.5rem; }
  .hero h1 { max-width: 16ch; font-size: clamp(2.5rem, 10vw, 3.6rem); }
  .hero .kicker { font-size: .7rem; line-height: 1.65; }
  .hero-search input { font-size: 1rem; padding-inline: .65rem; }
  .hero-search button { flex: none; font-size: .84rem; padding-inline: .8rem; }
  .hero-links { display: grid; justify-items: stretch; gap: .4rem; }
  .hero-links a { justify-content: space-between; font-size: .85rem; }
  .hero-links a:last-child { padding: .65rem .15rem; }
  .home-family-panel { padding: 1rem; }
  .home-family-node { padding: .75rem; min-height: 5.7rem; }
  .home-family-node-copy strong { font-size: 1rem; }
  .home-family-node-copy small, .home-family-hint { font-size: .75rem; }
  .home-family-portrait { width: 40px; }
  .stats strong { font-size: 1.8rem; }
  .stats span, .preview-badge { font-size: .75rem; }
  .section-heading .section-link { font-size: .87rem; }
  .chapter .kicker { font-size: .7rem; }
  .workspace-bar { font-size: .78rem; }
  .mobile-nav { gap: 0; padding-inline: .2rem; }
  .mobile-nav a { font-size: .68rem; min-height: 50px; gap: .35rem; }
  .nav-worlds > summary span { display: inline; max-width: none; font-size: .74rem; }
  .nav-worlds > summary, .nav-options > summary { min-height: 44px; min-width: 44px; }
  .nav-world-menu { right: -3.2rem; padding: .75rem; }
  .message-tabs { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .message-tabs button { padding-inline: .5rem; font-size: .82rem; }
  .message-editor, .message-history { padding: 1.15rem; }
  .message-actions > .button-link { width: 100%; }
  #strom #tree-mode-picker button { min-height: 70px; }
  .tree-mode-copy strong { font-size: .72rem; }
  .tree-view-caption, .tree-mode-help, #strom .pedigree-legend { font-size: .78rem; }
  .world-context-banner { grid-template-columns: minmax(0, 1fr) 4rem; gap: .7rem; padding: .85rem 1rem; }
  .world-context-copy .kicker { font-size: .65rem; line-height: 1.5; letter-spacing: .035em; }
  .world-context-copy > strong { font-size: 1.2rem; line-height: 1.2; }
  .world-context-copy ul { display: none; }
  .world-context-art { max-width: 4rem; }
  #child-theme-switcher .world-choice-caption strong { font-size: .9rem; }
  #child-theme-switcher .world-choice-caption > span { font-size: .72rem; }
}
@media (max-width: 480px) {
  .home-family-map { grid-template-columns: minmax(0, 1fr); gap: .7rem; padding-left: .9rem; }
  .home-family-map::before { left: .3rem; top: 2.8rem; bottom: 3.2rem; }
  .home-family-velvet { grid-column: auto; width: 100%; }
  .home-family-node, .home-family-velvet { min-height: 4.8rem; }
  .home-family-node::before, .home-family-node:not(.home-family-velvet)::before { content: ''; position: absolute; top: 50%; left: auto; right: 100%; width: .65rem; height: 1px; background: var(--world-accent, #e3c38f); }
  .home-family-portrait { width: 44px; }
  .home-family-hint { text-align: left; }
}
@media (max-width: 360px) {
  .brand { font-size: 1.05rem; gap: .4rem; }
  .brand > span { white-space: nowrap; }
  .brand small { display: none; }
}
@media print {
  .hero-links, .message-tabs { display: none; }
  .message-panel:not([hidden]):has(> .message-editor) { display: block; }
}
