/* One selected person, one view, and a generous canvas. */
#strom > .chapter-heading { margin: 0 0 1.25rem; }
#strom > .chapter-heading h2 { font-size: clamp(2rem, 3.8vw, 3.4rem); }
#strom > .chapter-heading .chapter-intro { margin-block: .7rem 0; }
#strom > .world-context-banner { padding: .8rem 1.25rem; margin-bottom: 1.25rem; }
#strom > .world-context-banner .world-context-art { max-width: 6rem; }
#strom > .world-context-banner .world-context-copy > strong { font-size: 1.4rem; }
.tree-focus-bar { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: .9rem; background: var(--surface); }
.tree-focus-person { display: inline-flex; align-items: center; gap: .8rem; min-width: 0; margin-right: auto; text-decoration: none; }
.tree-focus-person .compact-portrait { width: 48px; height: 48px; flex: none; }
.tree-focus-person > span:last-child { display: grid; gap: .15rem; min-width: 0; }
.tree-focus-person small { color: var(--muted); font: 500 .76rem/1.4 var(--sans); }
.tree-focus-person strong { color: var(--text); font: 600 1.22rem/1.3 var(--serif); overflow-wrap: anywhere; }
.tree-focus-person:hover strong { text-decoration: underline; text-underline-offset: .2em; }
#strom .tree-focus-bar > button { flex: none; min-height: 46px; font-size: .84rem; }
.tree-mobile-view { display: none; }
.tree-settings-row { position: relative; display: flex; align-items: start; gap: .6rem; margin-block: .7rem; }
.tree-settings { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); }
.tree-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 46px; padding: .7rem 1rem; list-style: none; cursor: pointer; font: 600 .85rem/1.4 var(--sans); }
.tree-settings > summary::-webkit-details-marker { display: none; }
.tree-settings > summary > span { color: var(--accent); font-size: 1.2rem; transition: transform .15s; }
.tree-settings[open] > summary > span { transform: rotate(45deg); }
.tree-settings[open] > summary { border-bottom: 1px solid var(--border); background: var(--panel); border-radius: .7rem .7rem 0 0; }
.tree-settings-content { padding: 1rem; }
#strom .tree-settings .tree-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, .35fr); gap: 1rem; padding: 0; border: 0; background: transparent; }
#strom .tree-settings .field { min-width: 0; font-size: .83rem; }
#strom .tree-settings select { width: 100%; max-width: none; min-height: 46px; font-size: 1rem; border: 1px solid var(--border); border-radius: .6rem; }
#strom .tree-settings .tree-mode-toolbar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; margin-top: 1rem; }
#strom .tree-settings .tree-mode-toolbar > .field:first-child { flex: 1; min-width: 12rem; }
#strom .tree-settings input { min-height: 46px; font-size: 1rem; }
#strom .tree-settings .tree-find-results { margin-block: .75rem 0; max-height: 20rem; padding: .35rem; border: 1px solid var(--border); }
#strom .tree-settings .tree-find-results button { width: 100%; min-height: 54px; padding: .65rem; font-size: .9rem; text-align: start; }
#strom .tree-settings .tree-find-results li { border: 0; padding: 0; }
.tree-search-hint { margin: .8rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.6; }
#tree-toolbar-status:empty { display: none; }
#strom #tree-fullscreen { min-height: 48px; padding-inline: 1rem; background: var(--surface); font-size: .83rem; white-space: nowrap; }
#strom > #tree-mode-picker,
:root[data-child-theme] #strom > #tree-mode-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 1rem; padding: .35rem; gap: .3rem; border-radius: .85rem; }
#strom #tree-mode-picker button,
:root[data-child-theme] #strom #tree-mode-picker button { min-height: 64px; padding: .65rem .7rem; display: flex; flex-direction: row; align-items: center; gap: .6rem; border-radius: .55rem; }
#strom .tree-mode-copy strong { font-size: .85rem; line-height: 1.4; }
#strom .tree-mode-copy small { display: none; }
#strom .tree-view-caption { min-height: 0; margin: 0; padding: .85rem .15rem; font-size: .85rem; line-height: 1.5; }
#strom > .tree-mode-panel { border-radius: 1rem; padding: .85rem; }
#strom .tree-mode-panel > .tree-mode-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .7rem; }
#strom .tree-mode-panel .tree-mode-toolbar button { min-width: 44px; min-height: 46px; font-size: .83rem; }
#strom .tree-mode-panel .tree-mode-toolbar output { min-width: 3.8rem; padding-inline: .2rem; text-align: center; font-size: .86rem; }
#strom :is(#tree-classic-center, #tree-descendants-center) { font-size: 1.3rem; }
#strom :is(#pedigree, #tree-descendants-list, .family-network-viewport, #anulka-fan-stage) { height: min(72svh, 48rem); min-height: 28rem; border-radius: .7rem; scrollbar-color: var(--panel-border) transparent; }
#strom .pedigree-node-copy strong { font-size: 1rem; line-height: 1.25; }
#strom .pedigree-node-copy small { font-size: .72rem; line-height: 1.4; }
#strom .pedigree-node-copy > small:first-child { font-size: .62rem; letter-spacing: .025em; }
#strom .pedigree-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .8rem; }
#strom .tree-network-heading { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; padding: .4rem .2rem 1rem; }
#strom .tree-network-heading > div:first-child { flex: 1; min-width: 12rem; }
#strom .tree-network-heading h3 { font: 500 1.5rem/1.25 var(--serif); }
#strom .tree-network-heading p { margin-block: .4rem 0; color: var(--muted); font-size: .85rem; }
#strom .tree-network-heading select { max-width: 100%; min-height: 46px; font-size: 1rem; }
#strom .tree-side-toggle { min-height: 44px; align-content: center; font-size: .85rem; }
#strom .tree-network-detail { margin-top: 1rem; padding: 1rem; }
#strom .tree-network-identity h4 { font-size: 1.35rem; }
#strom .tree-network-relatives .person-link { min-height: 46px; font-size: .85rem; }
.tree-settings-row:has(#tree-settings[open]) > #tree-fullscreen { position: sticky; top: 6rem; }
@media (max-width: 1080px) {
  #strom > #tree-mode-picker,
  :root[data-child-theme] #strom > #tree-mode-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  #strom > .world-context-banner { display: none; }
  #strom > .chapter-heading { margin-bottom: 1rem; }
  #strom > .chapter-heading h2 { font-size: 2rem; }
  #strom > .chapter-heading .kicker { margin-bottom: .6rem; }
  #strom > .chapter-heading .chapter-intro { font-size: .9rem; line-height: 1.6; margin-top: .5rem; }
  .tree-focus-bar { gap: .6rem; padding: .75rem; }
  .tree-focus-person { gap: .6rem; }
  .tree-focus-person .compact-portrait { width: 40px; height: 40px; }
  .tree-focus-person small { font-size: .72rem; }
  .tree-focus-person strong { font-size: 1.05rem; }
  #strom .tree-focus-bar > button { padding: .6rem .65rem; max-width: 6rem; font-size: .78rem; }
  .tree-mobile-view { display: block; margin-block: .8rem; }
  .tree-mobile-view .field { display: grid; gap: .35rem; font-size: .8rem; }
  .tree-mobile-view select { width: 100%; min-width: 0; min-height: 48px; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--surface); color: var(--text); font-size: 1rem; }
  #strom > #tree-mode-picker,
  :root[data-child-theme] #strom > #tree-mode-picker { display: none; }
  .tree-settings-row { gap: .5rem; margin-block: .65rem 0; }
  .tree-settings > summary { gap: .4rem; min-height: 46px; padding: .7rem .75rem; font-size: .79rem; }
  #strom #tree-fullscreen { padding-inline: .75rem; font-size: .78rem; min-height: 48px; }
  .tree-settings[open] { flex-basis: 100%; }
  .tree-settings-row:has(.tree-settings[open]) { flex-wrap: wrap; }
  .tree-settings-row:has(.tree-settings[open]) #tree-fullscreen { position: static; margin-left: auto; }
  .tree-settings-content { padding: .85rem; }
  #strom .tree-settings .tree-controls { grid-template-columns: minmax(0, 1fr) 5rem; gap: .65rem; }
  #strom .tree-settings .tree-controls select { padding: .6rem .5rem; }
  #strom .tree-settings .tree-mode-toolbar > .field:first-child { min-width: 100%; }
  #strom .tree-view-caption { font-size: .8rem; padding-block: .75rem; }
  #strom > .tree-mode-panel { padding: .5rem; border-radius: .85rem; }
  #strom :is(#pedigree, #tree-descendants-list, .family-network-viewport, #anulka-fan-stage) { min-height: 24rem; height: 65svh; }
  #strom .tree-mode-panel .tree-mode-toolbar button { padding: .6rem .65rem; font-size: .8rem; }
  #strom :is(#tree-classic-center, #tree-descendants-center) { font-size: 1.3rem; }
  #strom .tree-mode-panel .tree-mode-toolbar output { min-width: 2.6rem; }
  #strom .pedigree-legend .pedigree-key { display: none; }
  #strom :is(#pedigree, #tree-descendants-list) { --tree-scale: 1; }
  #strom .tree-mode-help { font-size: .82rem; line-height: 1.6; }
  #strom .tree-network-heading { gap: .75rem; }
  #strom .tree-network-heading > .field { flex: 1; min-width: 100%; }
  #strom .tree-network-detail { padding: .85rem; }
  #strom .tree-network-detail .tree-mode-toolbar { display: grid; }
}
@media (max-width: 360px) {
  #tree-classic .tree-mode-toolbar output { display: none; }
}
