/* The shared family workspace. Content and five personal worlds keep their own identity. */
:root {
  --ui-radius: 1.25rem;
  --ui-radius-small: .7rem;
  --ui-shadow: 0 12px 40px color-mix(in srgb, var(--text) 7%, transparent);
  --ui-line: color-mix(in srgb, var(--border) 78%, transparent);
  --ui-wash: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
body { background: radial-gradient(ellipse at 100% 0, color-mix(in srgb, var(--panel) 48%, transparent), transparent 36rem), var(--paper); }
.shell { width: min(1440px, calc(100% - clamp(2rem, 7vw, 7rem))); }
button, input, select, textarea, .nav-links, .nav-utilities, .mobile-nav { font-family: var(--sans); }
button, a, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, summary, a, input, select, textarea { touch-action: manipulation; }
input[type="search"] { -webkit-appearance: none; }
button:disabled { cursor: default; }
:where(button, a, summary, input, select, textarea):focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
::selection { color: var(--on-accent); background: var(--accent); }

.site-header { z-index: 25; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(18px); border-color: var(--ui-line); }
.site-header-inner { min-height: 5.25rem; gap: clamp(.7rem, 1.5vw, 1.5rem); }
.brand { gap: .7rem; font-size: 1.5rem; letter-spacing: -.035em; }
.brand-mark { width: 38px; height: 38px; }
.brand small { font-size: .52rem; letter-spacing: .13em; }
.site-header .nav-links { gap: .16rem; border: 0; padding: 0; background: transparent; }
.site-header .nav-links a { position: relative; padding: .75rem .8rem; border-radius: .6rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.site-header .nav-links a[aria-current] { color: var(--accent); background: var(--panel); }
.site-header .nav-links a[aria-current]::after { content: ''; position: absolute; height: 2px; inset: auto .8rem 0; background: var(--accent); border-radius: 1rem; }
.nav-utilities { align-items: center; gap: .4rem; }
.nav-utilities > .nav-action, .nav-options > summary, .nav-worlds > summary { min-height: 44px; border: 1px solid var(--ui-line); border-radius: .65rem; background: var(--surface); }
.nav-utilities > .nav-action { padding: .6rem .75rem; font-size: .76rem; }
.nav-utilities svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.nav-worlds { position: relative; }
.nav-worlds > summary { display: flex; align-items: center; gap: .4rem; padding: .6rem .75rem; color: var(--accent); font-size: .76rem; font-weight: 700; cursor: pointer; list-style: none; }
.nav-worlds summary::-webkit-details-marker { display: none; }
.nav-worlds[open] > summary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.nav-world-menu { position: absolute; top: calc(100% + .65rem); right: 0; width: 20rem; max-width: calc(100vw - 2rem); padding: 1rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); box-shadow: 0 20px 65px color-mix(in srgb, var(--text) 19%, transparent); }
.nav-world-menu > .kicker { margin: .1rem .35rem .65rem; font-size: .59rem; }
.nav-world-choice { display: flex; align-items: center; gap: .7rem; min-height: 62px; padding: .55rem .6rem; border-radius: .65rem; color: var(--text); text-decoration: none; }
.nav-world-choice > span:nth-child(2) { display: grid; gap: .12rem; margin-right: auto; }
.nav-world-choice strong { font-size: .88rem; }
.nav-world-choice small { color: var(--muted); font-size: .7rem; }
.nav-world-choice .compact-portrait { width: 40px; height: 40px; flex: none; border: 2px solid var(--border); }
.nav-world-choice:hover, .nav-world-choice[aria-current] { background: var(--panel); }
.world-menu-all { display: block; margin-top: .6rem; padding: .75rem .4rem .1rem; border-top: 1px solid var(--border); color: var(--accent); font-size: .75rem; text-decoration: none; }
.nav-options > div { padding: .65rem; border: 1px solid var(--border); box-shadow: var(--ui-shadow); }
.nav-options > div > :is(a, button) { min-height: 44px; border-radius: .5rem; text-align: left; }
.workspace-bar { gap: .55rem; min-height: 2rem; margin-block: 1.1rem .3rem; color: var(--muted); }
.workspace-bar strong { border: 0; background: none; padding: 0; color: var(--text); font-weight: 600; }

/* A personal first page, with actual linked family portraits. */
.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4.5rem); margin-top: 1.7rem; padding: clamp(1.5rem, 4.2vw, 4.25rem); border: 1px solid var(--ui-line); border-radius: 1.7rem; background: var(--surface); box-shadow: var(--ui-shadow); }
.hero h1 { font-size: clamp(3rem, 5.9vw, 6rem); line-height: .99; letter-spacing: -.06em; text-wrap: balance; }
.hero h1 em { font-weight: 400; }
.hero .kicker { max-width: 34ch; font-size: .61rem; line-height: 1.65; letter-spacing: .13em; margin-bottom: 1.3rem; }
.hero-description { max-width: 39ch; margin-block: 1.35rem 1.8rem; font-size: clamp(.95rem, 1.2vw, 1.08rem); line-height: 1.75; }
.hero-search { min-width: 0; width: 100%; max-width: 33rem; border-radius: .8rem; border: 1px solid var(--panel-border); background: var(--paper); box-shadow: none; }
.hero-search input { min-width: 0; padding: .85rem 1rem; font-size: .86rem; }
.hero-search button { padding: .85rem 1rem; border-radius: .55rem; white-space: nowrap; font-size: .76rem; font-weight: 650; }
.home-hint { margin-block: .6rem 1.3rem; font-size: .7rem; }
.hero-links { gap: .75rem 1.4rem; flex-wrap: wrap; }
.hero-links a { font-size: .8rem; font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: .25em; }
.home-family-panel { position: relative; isolation: isolate; min-width: 0; padding: 1rem 1rem .65rem; border: 1px solid color-mix(in srgb, var(--gold) 48%, transparent); border-radius: 1.3rem; background: var(--world-backdrop, radial-gradient(ellipse at 10% 100%, #68754e 0, transparent 65%), linear-gradient(145deg, #173d37, #294d42 62%, #14302e)); overflow: hidden; }
.home-family-panel::before { content: ''; position: absolute; z-index: -1; inset: 12% -30% -35%; border-radius: 50%; border: 1px solid #e9dca82e; box-shadow: 0 0 0 25px #e9dca807, 0 0 0 55px #e9dca80a, 0 0 0 100px #e9dca807; pointer-events: none; }
.home-family-heading { display: flex; justify-content: space-between; align-items: center; color: var(--world-ink, #f9efd8); }
.home-family-heading .kicker { color: inherit; margin: .2rem .2rem 0; font-size: .55rem; }
.home-family-heading .kicker::before { background: currentColor; opacity: .55; }
.family-map-mark { padding-inline: .4rem; color: var(--world-accent, #e3c38f); font-size: 1.4rem; }
.home-family-map { position: relative; aspect-ratio: 500 / 420; max-width: 540px; margin-inline: auto; }
.home-family-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.home-family-lines path { fill: none; stroke: var(--world-accent, #e7d1a0); stroke-opacity: .65; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.home-family-node { position: absolute; display: flex; align-items: center; gap: .65rem; width: 43%; min-height: 4.65rem; padding: .6rem .7rem; border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--surface)); border-radius: .9rem; background: var(--surface); color: var(--text); box-shadow: 0 7px 18px #071a232a; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.home-family-node:hover { transform: translateY(-3px); box-shadow: 0 11px 24px #071a2345; }
.home-family-portrait { position: relative; display: grid; place-items: center; flex: none; width: clamp(34px, 4.1vw, 58px); aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: var(--panel); color: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); font: 600 1rem var(--serif); }
.home-family-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-family-node-copy { display: grid; gap: .18rem; min-width: 0; }
.home-family-node-copy strong { font: 600 clamp(.85rem, 1.3vw, 1.15rem)/1.15 var(--serif); }
.home-family-node-copy small { color: var(--muted); font-size: clamp(.54rem, .8vw, .66rem); line-height: 1.35; }
.home-family-velvet { left: 25%; top: 4%; width: 50%; min-height: 5.5rem; border-top: 3px solid #b88854; }
.home-family-gothic { left: 0; top: 43%; border-left: 3px solid #9e5c88; }
.home-family-kpop { right: 0; top: 43%; border-left: 3px solid #8e71c9; }
.home-family-dungeon { left: 0; top: 76%; border-left: 3px solid #9f794d; }
.home-family-pets { right: 0; top: 76%; border-left: 3px solid #6daaa0; }
.home-family-hint { margin: .7rem .3rem .2rem; text-align: center; color: var(--world-muted, #e1ddc8); font-size: .62rem; }
.summary-band { padding: 1.5rem .3rem; margin: 0; gap: 1rem; border-color: var(--ui-line); }
.stats { gap: 1.5rem 2.5rem; }
.stats > div { flex-direction: row; align-items: baseline; gap: .6rem; }
.stats strong { font-size: 1.85rem; letter-spacing: -.05em; }
.stats span { max-width: 8rem; font-size: .72rem; line-height: 1.35; }
.preview-badge { color: var(--muted); border: 0; background: none; font-size: .65rem; padding: 0; }

/* Spacious chapters, compact controls, and a consistent reading rhythm. */
.chapter { margin-block: 2.8rem; padding: clamp(1.15rem, 2.8vw, 2.5rem); border-radius: var(--ui-radius); box-shadow: none; border-color: var(--ui-line); }
#prehled > .chapter { padding: 0; border: 0; background: transparent; margin-block: 3.7rem; }
.chapter h2 { font-size: clamp(2.2rem, 4.25vw, 4rem); letter-spacing: -.05em; line-height: 1.05; text-wrap: balance; }
.chapter-intro { max-width: 65ch; color: var(--muted); line-height: 1.75; font-size: .91rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.section-heading .section-link { flex: none; padding-bottom: .3rem; font-size: .8rem; text-decoration: none; }
.section-link:hover { text-decoration: underline; text-underline-offset: .3em; }
.child-theme-picker { gap: 1rem; }
#child-theme-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 1.7rem; }
#child-theme-picker .child-theme-choice { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0; min-width: 0; padding: 0; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
#child-theme-picker .child-theme-choice:hover { transform: translateY(-5px); box-shadow: var(--ui-shadow); }
#child-theme-picker .world-thumbnail { display: block; width: 100%; aspect-ratio: 1.5; overflow: hidden; }
#child-theme-picker .world-thumbnail svg { display: block; width: 100%; height: 100%; transform: scale(1.06); }
.world-choice-avatar { position: relative; display: grid; place-items: center; z-index: 1; width: 46px; height: 46px; overflow: hidden; margin: -1.35rem 0 0 1rem; border: 3px solid var(--surface); border-radius: 50%; background: var(--panel); color: var(--accent); font: 600 .9rem var(--serif); box-shadow: 0 1px 7px #0002; }
.world-choice-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.world-choice-caption { display: grid; gap: .25rem; padding: .7rem 1rem 1.1rem; }
.world-choice-caption strong { font: 600 1.25rem var(--serif); color: var(--text); }
.world-choice-caption > span { color: var(--muted); font-size: .7rem; line-height: 1.4; }
#child-theme-switcher .world-choice-caption { padding: 0; display: flex; align-items: baseline; gap: .5rem; }
.anniversary-strip { padding: 1.4rem 1.6rem; border-radius: 1rem; background: var(--surface); border-color: var(--ui-line); }
.anniversary-strip h2 { font-size: 1.55rem; letter-spacing: -.035em; }
.anniversary-list { gap: .8rem; }
.anniversary-list li { padding: .5rem 1rem; border-inline-start: 1px solid var(--border); }
.anniversary-list strong { color: var(--accent); font-size: .75rem; }
.editorial-grid { gap: 1.1rem; }
#prehled .discoveries::before { left: 0; right: 0; width: auto; border-radius: 1.2rem; }
.editorial-card { border: 1px solid var(--ui-line); border-radius: 1rem; box-shadow: 0 4px 18px color-mix(in srgb, var(--text) 3%, transparent); }
.editorial-copy { padding: clamp(1.1rem, 2.2vw, 1.8rem); }
.editorial-copy h3 { margin-block: .65rem .8rem; font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.18; letter-spacing: -.025em; }
.editorial-copy .card-label { font-size: .56rem; letter-spacing: .11em; line-height: 1.6; }
.editorial-copy > p:not(.card-label) { font-size: .83rem; line-height: 1.75; }
.editorial-copy summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding-block: .7rem; margin-top: .5rem; font-size: .77rem; }
.editorial-body { font-size: .9rem; line-height: 1.8; }
.editorial-copy .profile-research-links { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.editorial-copy .profile-research-links a { min-height: 36px; font-size: .73rem; }
.home-research-section .editorial-card:first-child { border-top: 3px solid var(--accent); }
.chronicle-link { border-radius: 1.1rem; padding: 1.65rem; background: var(--panel); box-shadow: none; }
.chronicle-link strong { font-size: 1.8rem; letter-spacing: -.03em; }
.chronicle-link .book-symbol { font-size: 2.5rem; }

/* The tree is a workspace: one selected view, a clear focus, and a generous canvas. */
#strom.chapter, #osoby.chapter, #kronika.chapter, #zpravy.chapter { padding: .5rem 0 0; border: 0; border-radius: 0; background: transparent; }
:root[data-child-theme] #strom:not([hidden]) { display: block; }
#strom > .chapter-heading { margin-bottom: 1.7rem; align-items: end; gap: 1rem 2rem; }
#strom .chapter-heading > div:first-child { flex: 1; min-width: 13rem; }
#strom .tree-controls { padding: .8rem 1rem; border: 1px solid var(--border); border-radius: .85rem; background: var(--surface); }
#strom .tree-controls .field { font-size: .66rem; }
#strom .tree-controls select { max-width: 20rem; min-height: 42px; border: 0; background: var(--paper); }
#strom > .tree-mode-toolbar { gap: .6rem; margin-block: .9rem; padding: .85rem; border: 1px solid var(--border); border-radius: .85rem; background: var(--surface); }
#strom > .tree-mode-toolbar > .field:first-child { margin-right: auto; width: min(30rem, 100%); }
#strom .field input { min-height: 44px; border-color: var(--border); }
#strom .field { font-size: .72rem; }
#strom .person-link { min-height: 42px; border-radius: .6rem; padding: .6rem .9rem; font: 600 .72rem/1.3 var(--sans); }
#strom > #tree-mode-picker { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem; padding: .4rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); }
#tree-mode-picker button { display: flex; align-items: center; gap: .7rem; min-width: 0; min-height: 66px; margin: 0; padding: .7rem .85rem; border: 1px solid transparent; border-radius: .65rem; background: transparent; color: var(--muted); text-align: left; }
#tree-mode-picker button:hover { color: var(--text); background: var(--paper); }
#tree-mode-picker button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); box-shadow: 0 3px 9px color-mix(in srgb, var(--accent) 22%, transparent); }
#tree-mode-picker svg { width: 25px; height: 25px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.tree-mode-copy { display: grid; gap: .25rem; min-width: 0; }
.tree-mode-copy strong { font-size: .74rem; font-weight: 650; line-height: 1.3; }
.tree-mode-copy small { font-size: .59rem; line-height: 1.3; opacity: .8; }
.tree-view-caption { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .8rem; min-height: 3rem; margin: 0; padding: .9rem .4rem; color: var(--muted); font-size: .72rem; }
.tree-view-caption strong { color: var(--text); font-size: .8rem; }
#strom > .tree-mode-panel { min-width: 0; padding: .8rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); box-shadow: var(--ui-shadow); }
#strom .tree-mode-panel > .tree-mode-toolbar { margin: 0 0 .6rem; gap: .4rem; }
#strom .tree-mode-panel .tree-mode-toolbar output { padding: .45rem .6rem; font-size: .76rem; font-variant-numeric: tabular-nums; }
#strom .pedigree-legend { padding: .4rem .25rem .8rem; font-size: .65rem; color: var(--muted); }
#strom :is(#pedigree, #tree-descendants-list, .family-network-viewport) { height: min(72svh, 48rem); min-height: 28rem; border: 1px solid var(--border); border-radius: .7rem; }
#strom #anulka-fan-stage { height: min(70svh, 45rem); min-height: 28rem; max-height: none; border-radius: .7rem; border: 1px solid var(--border); }
#strom .pedigree { background: radial-gradient(ellipse at 50% 15%, color-mix(in srgb, var(--panel) 70%, transparent), transparent 70%), var(--paper); }
.pedigree-chart .pedigree-node { border-radius: .75rem; border-inline-start-width: 3px; box-shadow: 0 4px 12px #281b1722; }
.pedigree-chart .pedigree-node .compact-portrait { border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.pedigree-chart .pedigree-node-copy strong { font: 600 .91rem/1.15 var(--serif); }
.pedigree-chart .pedigree-node-copy small { font: .62rem/1.3 var(--sans); }
.pedigree-chart .pedigree-node-copy > small:first-child { text-transform: uppercase; font-size: .52rem; letter-spacing: .07em; }
.pedigree-chart .pedigree-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--accent), 0 6px 16px #281b1733; }
.tree-leaf-wash { opacity: .65; }
.tree-leaf { opacity: .9; }
.tree-mode-help { color: var(--muted); font-size: .72rem; line-height: 1.65; padding-inline: .25rem; }
.tree-network-heading { padding: .5rem .25rem 1rem; }
.tree-network-heading h3 { font-size: 1.4rem; }
.tree-network-detail { border: 1px solid var(--panel-border); border-radius: .85rem; background: var(--ui-wash); }
.fan-roster { margin-top: .7rem; padding: .85rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--paper); }
.fan-roster > summary { cursor: pointer; min-height: 30px; font-size: .8rem; font-weight: 650; }
.tree-find-results { position: relative; z-index: 3; margin: -.4rem 0 .9rem; border-radius: .85rem; background: var(--surface); box-shadow: var(--ui-shadow); max-height: 22rem; overflow: auto; }
.tree-find-results li button { min-height: 50px; }

/* Personal worlds differ in composition and linework, while controls stay familiar. */
:root[data-child-theme="velvet"] .hero { border-radius: .35rem 1.8rem 1.8rem .35rem; border-inline-start: 5px solid var(--gold); }
:root[data-child-theme="velvet"] .home-family-panel { border-radius: .4rem 1.1rem 1.1rem .4rem; box-shadow: inset 10px 0 18px #180f2144; }
:root[data-child-theme="velvet"] #strom > #tree-mode-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: .4rem 1.2rem .4rem .4rem; }
:root[data-child-theme="velvet"] #strom .pedigree-node { border-radius: .25rem .9rem .9rem .25rem; border-inline-start-color: var(--gold); }
:root[data-child-theme="gothic"] .hero { border-radius: 1.5rem 1.5rem .35rem .35rem; border-top: 3px double var(--gold); }
:root[data-child-theme="gothic"] .home-family-panel { border-radius: 45% 45% .5rem .5rem / 3.5rem 3.5rem .5rem .5rem; padding-top: 2rem; }
:root[data-child-theme="gothic"] #strom > #tree-mode-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); border: 3px double var(--border); border-radius: .3rem; }
:root[data-child-theme="gothic"] #strom #tree-mode-picker button { flex-direction: column; align-items: start; border-radius: 1.2rem 1.2rem .2rem .2rem; }
:root[data-child-theme="gothic"] #strom .pedigree-node { border-radius: 1.3rem 1.3rem .35rem .35rem; border-top: 2px solid var(--gold); }
:root[data-child-theme="kpop"] .hero { border-radius: 1.25rem .4rem 1.25rem .4rem; border-top: 3px solid var(--accent); }
:root[data-child-theme="kpop"] .home-family-panel { border-radius: .45rem; background-size: cover; }
:root[data-child-theme="kpop"] #strom > #tree-mode-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: .5rem; }
:root[data-child-theme="kpop"] #strom #tree-mode-picker button { border-inline-start: 3px solid var(--panel-border); border-radius: .35rem; }
:root[data-child-theme="kpop"] #strom #tree-mode-picker button:nth-child(even) { border-inline-start-color: var(--gold); }
:root[data-child-theme="kpop"] #strom .pedigree-node { border-radius: .35rem; border-block-start: 3px solid var(--branch-ink); border-inline-start-width: 1px; }
:root[data-child-theme="dungeon"] .hero { border-radius: .15rem; box-shadow: 5px 5px 0 var(--border); }
:root[data-child-theme="dungeon"] .home-family-panel { border-radius: .1rem; box-shadow: inset 0 0 0 4px #1b150c44; }
:root[data-child-theme="dungeon"] .home-family-node { border-radius: .15rem; box-shadow: 3px 3px 0 #120c0c55; }
:root[data-child-theme="dungeon"] #strom > #tree-mode-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: .1rem; gap: .5rem; padding: .6rem; }
:root[data-child-theme="dungeon"] #strom #tree-mode-picker button { border: 1px solid var(--border); border-radius: .1rem; }
:root[data-child-theme="dungeon"] #strom .pedigree-node { border-radius: .1rem; box-shadow: 3px 3px 0 #281b1733; }
:root[data-child-theme="pets"] .hero { border-radius: 2rem .8rem 2rem .8rem; }
:root[data-child-theme="pets"] .home-family-panel { border-radius: 2.2rem .8rem 2.2rem .8rem; }
:root[data-child-theme="pets"] .home-family-node { border-radius: 1.5rem .6rem 1.5rem .6rem; }
:root[data-child-theme="pets"] #strom > #tree-mode-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 1.5rem; }
:root[data-child-theme="pets"] #strom #tree-mode-picker button { border-radius: 1rem; }
:root[data-child-theme="pets"] #strom .pedigree-node { border-radius: 1.2rem .5rem 1.2rem .5rem; }
.world-context-banner { margin-bottom: 1.6rem; padding: 1rem 1.5rem; }
.world-context-art { max-width: 10rem; justify-self: end; }
.world-context-copy > strong { font: 400 clamp(1.2rem, 2.3vw, 2rem)/1.1 var(--serif); letter-spacing: -.025em; }
.world-context-copy .kicker { font-size: .6rem; }
.world-context-copy li { font-size: .64rem; padding: .3rem .55rem; background: color-mix(in srgb, var(--surface) 75%, transparent); }
.child-world { border-radius: 1.4rem; padding: clamp(1.4rem, 4.5vw, 4.2rem); }
.child-world-copy h2 { font-weight: 400; font-size: clamp(2.8rem, 5.4vw, 5.5rem); line-height: 1.02; }
.child-world-links :is(a, button) { min-height: 44px; border-radius: .6rem; }
.child-world-art { max-width: 30rem; justify-self: end; }
.world-atlas { border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
.atlas-nav { gap: .4rem; padding-block: .8rem; }
.atlas-nav button { min-height: 42px; font-size: .75rem; }

.archive-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 2rem; gap: .85rem; }
.archive-counts a { min-height: 7rem; justify-content: start; align-content: center; padding: 1.25rem 1.4rem; border-radius: .85rem; background: var(--surface); }
.archive-counts small { font-size: .6rem; color: var(--muted); letter-spacing: .08em; }
.archive-counts strong { font: 400 1.4rem/1.1 var(--serif); margin-top: .5rem; }
.archive-counts a:hover, .archive-counts a[aria-current] { border-color: var(--accent); background: var(--panel); }
.archive-section { padding-top: 2rem; margin-top: 2.8rem; border-color: var(--ui-line); }
.branch-card { padding: 1.5rem; border: 1px solid var(--border); border-inline-start: 3px solid var(--accent); border-radius: .25rem .9rem .9rem .25rem; }
.branch-card h4 { font-size: 1.5rem; letter-spacing: -.025em; line-height: 1.15; }
.branch-card p:not(.card-label) { font-size: .83rem; line-height: 1.75; }
.timeline-list li { padding: 1rem 1.4rem; gap: 1.3rem; background: var(--surface); border-bottom: 1px solid var(--border); border-left: 3px solid var(--accent); }
.timeline-list li:first-child { border-radius: .7rem .7rem 0 0; }
.timeline-list li:last-child { border-radius: 0 0 .7rem .7rem; }
.timeline-list li span { font-size: .87rem; line-height: 1.7; }
.footer { margin-top: 3rem; padding-block: 1.7rem; font-size: .75rem; }
.mobile-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1180px) {
  .site-header .nav-links a { padding-inline: .6rem; font-size: .73rem; }
  .brand { font-size: 1.3rem; }
  .brand small { font-size: .46rem; }
  .site-header-inner { gap: .75rem; }
  .nav-utilities > .nav-action { font-size: 0; gap: 0; width: 42px; justify-content: center; }
  #tree-mode-picker button { padding: .65rem; gap: .5rem; }
  .tree-mode-copy small { font-size: .56rem; }
}
@media (max-width: 900px) {
  .shell { width: calc(100% - 2rem); }
  .hero { gap: 1.5rem; padding: 1.6rem; margin-top: 1rem; }
  .hero h1 { font-size: clamp(2.8rem, 6.2vw, 4.2rem); }
  .hero-description { font-size: .88rem; }
  .hero-search { display: grid; grid-template-columns: minmax(0, 1fr); padding: .3rem; }
  .hero-search input { padding: .6rem .65rem; }
  .hero-search button { min-height: 40px; padding: .6rem .7rem; }
  .home-family-node { padding: .5rem; min-height: 4.15rem; gap: .4rem; }
  .home-family-velvet { min-height: 5rem; }
  .home-family-node-copy strong { font-size: .93rem; }
  .home-family-node-copy small { font-size: .55rem; }
  .home-family-portrait { width: 34px; }
  .home-family-hint { font-size: .55rem; }
  #child-theme-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
  #strom > #tree-mode-picker, :root[data-child-theme="gothic"] #strom > #tree-mode-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :root[data-child-theme="gothic"] #strom #tree-mode-picker button { flex-direction: row; align-items: center; }
  #tree-mode-picker button { min-height: 58px; }
  .tree-mode-copy strong { font-size: .74rem; }
  .tree-mode-copy small { font-size: .6rem; }
  .summary-band { padding-block: 1.15rem; }
  .stats { gap: .8rem 1.4rem; }
  .stats strong { font-size: 1.6rem; }
  .stats span { font-size: .65rem; }
  .preview-badge { font-size: .6rem; }
}
@media (max-width: 600px) {
  body { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
  .shell { width: calc(100% - 1.5rem); }
  .site-header-inner { min-height: 4.25rem; gap: .55rem; }
  .brand { font-size: 1.25rem; gap: .5rem; }
  .brand-mark { width: 31px; height: 31px; }
  .brand small { font-size: .43rem; letter-spacing: .07em; }
  .nav-utilities { gap: .3rem; }
  .nav-utilities > .nav-action { display: none; }
  .nav-options > summary, .nav-worlds > summary { min-height: 42px; min-width: 42px; padding: .6rem; justify-content: center; }
  .nav-worlds > summary span { max-width: 4rem; font-size: .68rem; overflow: hidden; text-overflow: ellipsis; }
  .nav-world-menu { right: -3rem; }
  .mobile-nav { z-index: 30; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .2rem; padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(18px); box-shadow: 0 -6px 25px #00000008; }
  .mobile-nav a { display: grid; justify-items: center; align-content: center; gap: .25rem; min-height: 47px; padding: .3rem .1rem; font-size: .56rem; border-radius: .7rem; color: var(--muted); text-decoration: none; }
  .mobile-nav a span { font-size: 1.2rem; line-height: 1; }
  .mobile-nav a[aria-current] { color: var(--accent); background: var(--panel); box-shadow: inset 0 -2px var(--accent); }
  .workspace-bar { font-size: .65rem; margin-block: .7rem 0; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 1.4rem; gap: 1.8rem; border-radius: 1.2rem; }
  .hero h1 { font-size: clamp(3.1rem, 13vw, 4.6rem); max-width: 13ch; }
  .hero .kicker { max-width: none; font-size: .53rem; margin-bottom: 1.1rem; }
  .hero-description { max-width: 36ch; margin-block: 1.2rem 1.3rem; font-size: .89rem; line-height: 1.75; }
  .hero-search { grid-template-columns: minmax(0, 1fr) auto; }
  .hero-search input { min-height: 44px; padding-inline: .6rem; font-size: .76rem; }
  .hero-search button { font-size: .65rem; white-space: normal; max-width: 7.4rem; }
  .home-hint { font-size: .61rem; margin-bottom: 1.1rem; }
  .hero-links { gap: .6rem 1rem; }
  .hero-links a { font-size: .7rem; }
  .home-family-panel { padding: .7rem .75rem .6rem; }
  .home-family-heading .kicker { font-size: .5rem; margin-bottom: .2rem; }
  .home-family-map { max-width: 430px; }
  .home-family-node { min-height: 4.2rem; }
  .home-family-velvet { min-height: 4.6rem; }
  .home-family-portrait { width: 36px; }
  .home-family-node-copy strong { font-size: 1rem; }
  .home-family-node-copy small { font-size: .52rem; }
  .home-family-hint { margin-top: 1.3rem; font-size: .52rem; }
  .summary-band { padding: 1.15rem .15rem; }
  .stats { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
  .stats > div { display: grid; gap: .1rem; }
  .stats strong { font-size: 1.8rem; }
  .stats span { max-width: 9rem; font-size: .61rem; }
  .preview-badge { font-size: .56rem; }
  #prehled > .chapter { margin-block: 2.5rem; }
  .chapter { margin-block: 1.8rem; padding: 1rem; border-radius: .9rem; }
  .chapter h2 { font-size: clamp(2.1rem, 8.8vw, 3rem); }
  .chapter .kicker { font-size: .56rem; letter-spacing: .11em; }
  .chapter-intro { font-size: .82rem; }
  .section-heading { align-items: start; flex-direction: column; gap: .7rem; }
  .section-heading .section-link { font-size: .7rem; }
  #child-theme-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: 1.2rem; }
  #child-theme-picker .child-theme-choice:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; }
  #child-theme-picker .child-theme-choice:first-child .world-thumbnail { grid-row: 1 / 3; aspect-ratio: 1.35; }
  #child-theme-picker .child-theme-choice:first-child .world-choice-avatar { margin: .75rem 0 0 .9rem; }
  #child-theme-picker .child-theme-choice:first-child .world-choice-caption { padding-top: .5rem; }
  .world-choice-caption { padding: .65rem .85rem 1rem; }
  .world-choice-caption strong { font-size: 1.2rem; }
  .world-choice-caption > span { font-size: .64rem; }
  .anniversary-strip { display: grid; padding: 1.1rem; gap: 1rem; }
  .anniversary-strip h2 { font-size: 1.65rem; }
  .anniversary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .anniversary-list li { padding: .4rem .65rem; min-width: 0; }
  .anniversary-list .person-link { font-size: .71rem; }
  .editorial-grid { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
  .editorial-copy { padding: 1.25rem; }
  .editorial-copy h3 { font-size: 1.6rem; }
  .editorial-copy > p:not(.card-label) { font-size: .82rem; }
  .chronicle-link { padding: 1.1rem; gap: 1rem; }
  .chronicle-link strong { font-size: 1.45rem; }
  #strom > .chapter-heading { gap: 1rem; margin-bottom: 1rem; }
  #strom .tree-controls { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 5.7rem; padding: .75rem; gap: .65rem; }
  #strom .tree-controls select { max-width: 100%; width: 100%; font-size: .77rem; }
  #strom > .tree-mode-toolbar { padding: .75rem; gap: .5rem; }
  #strom > .tree-mode-toolbar > .field:first-child { width: 100%; }
  #strom > .tree-mode-toolbar > button { flex: 1; }
  #strom > #tree-mode-picker { gap: .25rem; padding: .3rem; border-radius: .75rem; }
  #strom #tree-mode-picker button { min-height: 66px; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: .65rem .2rem; text-align: center; }
  #tree-mode-picker svg { width: 21px; height: 21px; }
  .tree-mode-copy strong { font-size: .64rem; }
  .tree-mode-copy small { display: none; }
  .tree-view-caption { padding: .8rem .2rem; line-height: 1.6; font-size: .65rem; }
  .tree-view-caption strong { font-size: .74rem; }
  #strom > .tree-mode-panel { padding: .5rem; border-radius: .85rem; }
  #strom :is(#pedigree, #tree-descendants-list, .family-network-viewport, #anulka-fan-stage) { height: 62svh; min-height: 24rem; }
  #strom .tree-mode-panel > .tree-mode-toolbar { gap: .3rem; }
  #strom .tree-mode-panel .person-link { padding: .55rem .65rem; font-size: .66rem; }
  #strom .tree-network-heading { gap: .65rem; }
  .world-context-banner { padding: .8rem 1rem; grid-template-columns: minmax(0, 1fr) 5.5rem; gap: .6rem; margin-bottom: 1.2rem; }
  .world-context-copy > strong { font-size: 1.35rem; }
  .world-context-copy li { font-size: .55rem; }
  .world-context-copy .kicker { font-size: .5rem; }
  .child-world { gap: 1.3rem; padding: 1.35rem; }
  .child-world-copy h2 { font-size: 2.75rem; }
  .child-world-art { max-width: 23rem; width: 100%; justify-self: center; }
  #child-theme-switcher { gap: .4rem; }
  #child-theme-switcher .child-theme-choice { min-height: 42px; padding: .5rem .65rem; }
  #child-theme-switcher .world-choice-caption { display: grid; gap: .12rem; }
  #child-theme-switcher .world-choice-caption strong { font-size: .84rem; }
  #child-theme-switcher .world-choice-caption > span { font-size: .5rem; }
  .archive-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .archive-counts a { min-height: 6rem; padding: .95rem; }
  .archive-counts strong { font-size: 1.25rem; }
  .archive-section { padding-top: 1.5rem; margin-top: 1.8rem; }
  .timeline-list li { grid-template-columns: 1fr; gap: .35rem; padding: 1rem; }
  .timeline-list li span { font-size: .8rem; }
  .footer { flex-wrap: wrap; gap: .7rem 1.2rem; margin-top: 2rem; font-size: .65rem; }
}
@media (max-width: 360px) {
  .hero { padding: 1.1rem; }
  .home-family-node { gap: .3rem; padding: .4rem; }
  .home-family-portrait { width: 30px; }
  .home-family-node-copy strong { font-size: .88rem; }
  .home-family-node-copy small { font-size: .48rem; }
  .home-family-hint { margin-top: 1.8rem; }
  .nav-worlds > summary span { display: none; }
}
.pedigree, #anulka-fan-stage, .family-card-fan-viewport { cursor: grab; }
.is-panning, .is-panning * { cursor: grabbing !important; user-select: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .nav-worlds, .home-family-panel, .mobile-nav { display: none !important; }
  .hero { display: block; box-shadow: none; border: 0; }
  .chapter, .editorial-card { box-shadow: none; }
}
