:root {
  color-scheme: light;
  --ink: #25372f;
  --muted: #758078;
  --paper: #f7f4ec;
  --surface: #fffefa;
  --green: #345847;
  --green-dark: #233d31;
  --line: #e8e5dc;
  --clay: #bb7859;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.grain { position: fixed; inset: 0; opacity: .07; pointer-events: none; z-index: 2; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E"); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-weight: 600; }
.muted { color: var(--muted); line-height: 1.65; }
.small { font-size: .78rem; margin: .25rem 0 0; }
.eyebrow { color: #8c674e; font-weight: 700; font-size: .68rem; letter-spacing: .19em; margin-bottom: .75rem; }
.button { border: 0; border-radius: 9px; padding: .78rem 1.1rem; font-size: .88rem; font-weight: 600; transition: transform .15s, background .15s; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; }
.button:hover { transform: translateY(-1px); }
.button-dark { color: white; background: var(--green); }
.button-dark:hover { background: var(--green-dark); }
.button-light { color: var(--ink); background: #eeece5; }
.button-outline { color: var(--green); background: transparent; border: 1px solid #bfcbbf; }

.login-view { min-height: 100svh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 2%, #fffdf7 0, transparent 60%); }
.login-card { width: min(100%, 430px); text-align: center; padding: 52px 48px 38px; background: rgba(255,254,250,.85); border: 1px solid #ece8df; border-radius: 18px; box-shadow: 0 20px 65px #344d3b0c; }
.family-mark, .brand-mark { display: grid; place-items: center; border-radius: 50%; font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; color: #fff; background: var(--green); }
.family-mark { width: 58px; height: 58px; margin: 0 auto 25px; font-size: .95rem; letter-spacing: .04em; outline: 1px solid #b7c0ae; outline-offset: 5px; }
.login-card h1 { font-size: 2.3rem; margin-bottom: .6rem; }
.login-card > .muted { font-size: .9rem; margin-bottom: 31px; }
.stack { display: grid; text-align: left; gap: 10px; }
.stack label, .person-dialog label { font-size: .78rem; color: #4d5c52; font-weight: 600; }
.stack input, .person-dialog input, .person-dialog textarea, .person-dialog select { width: 100%; border: 1px solid #dddcd3; border-radius: 8px; background: #fff; padding: .8rem .85rem; color: var(--ink); outline: none; }
.stack input:focus, .person-dialog input:focus, .person-dialog textarea:focus, .person-dialog select:focus { border-color: #76917d; box-shadow: 0 0 0 3px #628c711a; }
.stack .button { margin-top: 8px; width: 100%; }
.login-note { border-top: 1px solid var(--line); margin: 30px 0 0; padding-top: 19px; color: #98988e; font-size: .72rem; }
.family-gate-card { width: min(100%, 560px); }
.family-gate-card h1 { font-size: 2rem; }
.gate-choices { display: grid; gap: 12px; margin-top: 8px; }
.gate-choice { display: grid; gap: 4px; text-align: left; border: 1px solid #e4e1d6; border-radius: 12px; background: #fff; color: var(--ink); padding: 16px 18px; }
.gate-choice strong { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-size: 1.35rem; }
.gate-choice span { color: var(--muted); font-size: .82rem; }
.gate-choice:hover { border-color: #9aaf9b; background: #f4f7f1; }
.topbar-actions { display: flex; gap: 8px; }
.form-error { min-height: 1em; color: #a24736; font-size: .78rem; margin: 0; }

.app-view { min-height: 100svh; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(20px, 5vw, 80px); background: #fffefae8; border-bottom: 1px solid #eae7df; backdrop-filter: blur(10px); }
.brand { color: inherit; text-decoration: none; display: flex; gap: 11px; align-items: center; }
.brand-mark { width: 39px; height: 39px; font-size: .72rem; letter-spacing: .03em; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-size: .98rem; }
.brand small { color: #8b938a; font-size: .57rem; letter-spacing: .14em; margin-top: 2px; }
.main-nav { display: flex; gap: 29px; height: 55px; align-items: center; }
.nav-link { align-self: stretch; position: relative; border: 0; background: none; color: #727c74; font-size: .82rem; }
.nav-link.active { color: var(--green); font-weight: 700; }
.nav-link.active::after { content: ""; position: absolute; height: 2px; bottom: 0; left: 0; right: 0; background: var(--green); }
.topbar-actions .button { font-size: .75rem; padding: .6rem .85rem; }
.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 59px 0 52px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.page-heading h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.025em; margin-bottom: .5rem; }
.page-heading .muted { margin-bottom: 0; font-size: .9rem; }
.page-heading > .button { margin-bottom: 5px; }
.family-layout { display: grid; grid-template-columns: minmax(240px, 310px) minmax(0, 1fr); min-height: 500px; border: 1px solid #e6e3da; background: var(--surface); border-radius: 13px; overflow: hidden; box-shadow: 0 9px 30px #2e483407; }
.people-panel { padding: 23px 19px 19px; border-right: 1px solid #ebe9e1; display: flex; flex-direction: column; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; }
.panel-heading h2 { font-size: 1.05rem; margin-bottom: 0; }
.leaf-icon { color: #87957d; font-size: 1.25rem; }
.branch-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; }
.filter-chip { border: 1px solid #e4e6dc; background: #f8f8f3; color: #506456; border-radius: 999px; padding: .32rem .62rem; font-size: .68rem; }
.filter-chip.active { background: var(--green); color: #fff; border-color: var(--green); }
.search-box { display: flex; align-items: center; gap: 8px; margin: 12px 0 12px; padding: 0 .65rem; border: 1px solid #e8e6df; border-radius: 7px; color: #9ca198; }
.search-box input { border: 0; outline: 0; width: 100%; min-width: 0; padding: .65rem 0; font-size: .76rem; background: transparent; }
.people-list { display: grid; align-content: start; gap: 4px; max-height: 440px; overflow: auto; }
.person-list-item { border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; padding: 10px; display: flex; align-items: center; gap: 10px; }
.person-list-item:hover, .person-list-item.selected { background: #f1f3ed; }
.person-avatar { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; color: #45664e; background: #e8eee3; font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.person-list-item strong, .person-list-item small { display: block; }
.person-list-item strong { font-size: .76rem; font-weight: 600; }
.person-list-item small { color: #9a9c93; font-size: .68rem; margin-top: 3px; }
.side-note { color: #92978e; border-top: 1px solid var(--line); padding: 16px 3px 0; margin: auto 0 0; font-size: .7rem; line-height: 1.6; }
.person-view { min-width: 0; padding: 28px clamp(20px, 4vw, 46px); }
.empty-state { min-height: 430px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; max-width: 410px; margin: auto; }
.empty-tree { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; color: #567260; background: #edf0e8; font-size: 2rem; margin-bottom: 22px; }
.empty-state h2 { font-size: 1.65rem; margin-bottom: .55rem; }
.empty-state > .muted { font-size: .84rem; margin-bottom: 21px; }
.person-detail-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.person-title { font-size: clamp(1.8rem, 4vw, 2.45rem); margin-bottom: .35rem; overflow-wrap: anywhere; }
.person-dates { color: #888f85; font-size: .79rem; line-height: 1.55; }
.person-meta { color: #9a8a78; font-size: .72rem; margin: .45rem 0 0; }
.person-edit-button { border: 0; color: var(--green); background: #eef2eb; border-radius: 7px; padding: .58rem .75rem; font-size: .75rem; }
.family-branch { display: flex; gap: 10px; align-items: stretch; margin: 24px 0 28px; overflow-x: auto; padding: 2px 1px 6px; }
.branch-card { min-width: 125px; border: 1px solid #e8e6de; border-radius: 8px; padding: 10px 12px; background: #fff; text-align: left; color: inherit; }
.branch-card.current { background: #f1f4ee; border-color: #cbd6c8; }
.branch-card span { display: block; color: #999b93; font-size: .62rem; margin-bottom: 5px; }
.branch-card strong { display: block; font-size: .75rem; font-weight: 600; }
.branch-card button { border: 0; background: transparent; color: inherit; text-align: left; padding: 0; }
.branch-title { font-family: "DM Sans", sans-serif; color: #818a80; letter-spacing: .12em; font-size: .63rem; font-weight: 700; }
.detail-section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 17px; }
.detail-section h3 { font-family: "DM Sans", sans-serif; font-size: .85rem; margin-bottom: 11px; }
.story-copy { white-space: pre-wrap; line-height: 1.75; color: #606c61; font-size: .85rem; }
.story-empty { color: #9a9d94; font-size: .8rem; font-style: italic; }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photos-grid img, .photo-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #f0eee7; }
.photo-tile { margin: 0; }
.photo-tile figcaption { display: grid; gap: 2px; margin-top: 6px; color: #606c61; font-size: .78rem; line-height: 1.4; }
.photo-tile figcaption strong { font-size: .84rem; }
.album-form { display: grid; gap: 12px; max-width: 680px; margin: 8px 0 28px; }
.album-form label, .album-meta label { display: grid; gap: 6px; font-size: .78rem; color: #4d574e; }
.album-form input, .album-form textarea { width: 100%; font: inherit; font-size: 16px; border: 1px solid #d9d6cc; border-radius: 8px; padding: .7rem .75rem; background: #fff; color: inherit; }
.album-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.album-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.album-hits { display: grid; gap: 4px; margin-top: 6px; }
.album-hits button, .album-tag { border: 1px solid #e4e6dc; background: #f8f8f3; color: #314036; border-radius: 8px; text-align: left; }
.album-hits button { padding: .55rem .7rem; min-height: 40px; }
.album-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.album-tag { display: grid; gap: 4px; padding: 8px; min-width: min(100%, 220px); }
.album-tag input { font-size: 16px; }
.album-tag button { justify-self: start; border: 0; background: transparent; color: #8d3d3d; padding: 0; min-height: 32px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.photo-card { border: 1px solid #e5e2d8; background: #fffefa; border-radius: 11px; overflow: hidden; }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f0eee7; }
.photo-card-body { display: grid; gap: 8px; padding: 12px 14px 14px; }
.photo-card-body p { margin: 0; }
.photo-people { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-people button { border: 1px solid #e4e6dc; background: #f8f8f3; color: #314036; border-radius: 999px; padding: .35rem .65rem; min-height: 32px; }
.google-photo-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.google-photo-form input { flex: 1 1 220px; min-width: 0; min-height: 42px; font-size: 16px; border: 1px solid #d9d6cc; border-radius: 8px; padding: .7rem .75rem; background: #fff; }
.google-photo-form .form-error { flex-basis: 100%; }
.photo-upload { display: inline-flex; border: 1px dashed #c6d0c5; color: var(--green); padding: .6rem .75rem; border-radius: 7px; font-size: .73rem; cursor: pointer; margin-top: 10px; }
.photo-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.branch-children { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.child-chip { border: 1px solid #e4e6dc; background: #f8f8f3; color: #506456; border-radius: 999px; padding: .42rem .68rem; font-size: .7rem; }
.archive-page { min-height: calc(100svh - 180px); }
.archive-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; }
.archive-card { border: 1px solid #e5e2d8; background: #fffefa; border-radius: 11px; overflow: hidden; }
.tree-image-link { display: block; position: relative; background: #fff; overflow: hidden; height: 245px; }
.tree-image-link img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .25s; }
.tree-image-link:hover img { transform: scale(1.025); }
.image-hint { position: absolute; right: 12px; bottom: 12px; border-radius: 5px; background: #fffef0e8; color: var(--green); padding: .4rem .55rem; font-size: .66rem; }
.archive-caption { padding: 15px 17px; display: flex; gap: 12px; align-items: center; }
.archive-icon { color: #8a947f; font-size: .69rem; letter-spacing: .1em; }
.archive-caption h2 { font-size: .98rem; margin-bottom: .27rem; }
.archive-caption p { font-size: .7rem; color: #8e948a; margin: 0; }
.archive-tip { display: flex; gap: 14px; align-items: start; margin-top: 22px; padding: 18px 20px; border: 1px solid #e6e8db; border-radius: 9px; color: #6e776d; background: #f0f1e9; font-size: .78rem; line-height: 1.65; }
.archive-tip > span { color: #a37c50; font-size: 1.1rem; }
.archive-tip p { margin: 0; }
.archive-tip strong { color: #3c5041; }
.site-footer { text-align: center; padding: 23px; color: #99988f; font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-size: .83rem; }
.site-footer span { color: #8e9a81; padding-left: 6px; }

.research-hint { color: #7d867c; font-size: .74rem; line-height: 1.55; margin: -4px 0 12px; }
.fact-list, .partner-list { display: grid; gap: 8px; }
.fact-item { display: flex; justify-content: space-between; gap: 10px; align-items: start; border: 1px solid #e8e6de; border-radius: 8px; padding: 10px 12px; background: #fff; }
.kind-pill { display: inline-block; background: #eef2eb; color: var(--green); border-radius: 999px; padding: .15rem .5rem; font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-right: 6px; }
.fact-item time, .fact-place { color: #7c8478; font-size: .72rem; margin-right: 7px; }
.fact-copy { margin: 6px 0 0; color: #5c665d; font-size: .8rem; line-height: 1.55; white-space: pre-wrap; }
.fact-source { margin: 4px 0 0; color: #8c674e; font-size: .7rem; }
.text-link { border: 0; background: none; padding: 0; color: inherit; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.inline-form select, .inline-form input, .inline-form textarea { width: 100%; border: 1px solid #dddcd3; border-radius: 8px; background: #fff; padding: .62rem .7rem; color: var(--ink); font-size: .76rem; }
.inline-form textarea, .fact-form button, .inline-form .button { grid-column: 1 / -1; }
.checkbox-label { display: flex !important; flex-direction: row; align-items: center; gap: 8px; font-size: .78rem; }
.checkbox-label input { width: auto; }
.person-dialog { width: min(620px, calc(100% - 28px)); max-height: 90svh; overflow: auto; padding: 25px; border: 1px solid #e5e2d8; border-radius: 13px; color: var(--ink); background: #fffefa; box-shadow: 0 25px 90px #15231944; }
.person-dialog::backdrop { background: #1c2b2080; backdrop-filter: blur(3px); }
.person-dialog form { display: grid; gap: 14px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; }
.dialog-heading h2 { margin-bottom: 0; font-size: 1.55rem; }
.dialog-heading .eyebrow { margin-bottom: .35rem; }
.icon-button { border: 0; background: transparent; color: #6e776f; font-size: 1.6rem; }
.person-dialog label { display: grid; gap: 6px; }
.person-dialog input, .person-dialog textarea, .person-dialog select { font-size: .8rem; font-weight: 400; }
.person-dialog textarea { resize: vertical; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 1px; }
.dialog-actions .button { font-size: .77rem; padding: .68rem .85rem; }

.tree-page { width: min(1680px, calc(100% - 48px)); }
.tree-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.tree-index button { border: 1px solid #e4e1d6; background: #fff; color: var(--ink); border-radius: 999px; padding: .45rem .75rem; font-size: .75rem; }
.tree-index button:hover, .tree-index button.active { border-color: #9aaf9b; background: #f4f7f1; }
.tree-section { margin: 28px 0 12px; font-size: 1.7rem; }
.tree-block h2 { font-size: 1.35rem; margin-bottom: .2rem; }
.tree-scroll { overflow-x: auto; padding: 8px 4px 22px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 254, 250, .72); text-align: center; }
.gtree, .gtree ul { margin: 0 auto; padding: 0; list-style: none; display: table; width: max-content; border-collapse: separate; border-spacing: 0; }
.gtree ul { position: relative; padding-top: 26px; }
.gtree li { display: table-cell; vertical-align: top; text-align: center; position: relative; padding: 26px 12px 0; }
.gtree > li { padding-top: 8px; }
.gtree li::before, .gtree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 26px; border-top: 1px solid #c5cfc4; }
.gtree li::after { right: auto; left: 50%; border-left: 1px solid #c5cfc4; }
.gtree > li::before, .gtree > li::after, .gtree li:only-child::before, .gtree li:only-child::after { display: none; }
.gtree li:only-child { padding-top: 0; }
.gtree li:first-child::before { border: 0; }
.gtree li:last-child::after { border: 0; }
.gtree li:last-child::before { border-right: 1px solid #c5cfc4; }
.tree-couple { display: inline-flex; gap: 2px; position: relative; z-index: 1; background: #fff; border: 1px solid #e4e1d6; border-radius: 12px; padding: 3px; box-shadow: 0 8px 22px #344d3b0d; vertical-align: top; }
.tree-couple.has-kids::after { content: ""; position: absolute; left: 50%; top: 100%; height: 26px; border-left: 1px solid #c5cfc4; }
.tree-person { display: grid; gap: 2px; align-content: center; min-width: 112px; max-width: 168px; border: 0; background: transparent; color: var(--ink); text-align: left; padding: 8px 10px; border-radius: 9px; }
.tree-person + .tree-person { border-left: 1px solid #efece4; }
.tree-person:hover { background: #f3f6f1; }
.tree-person strong { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-size: .92rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.tree-person small, .tree-via { color: var(--muted); font-size: .7rem; }
.tree-person.other-book { background: #f7f1ea; }
.tree-person.branch-zablati, .tree-person.branch-kik, .tree-person.branch-hlavni { --branch: #2f6b4f; }
.tree-person.branch-zablati_1 { --branch: #1d5f8a; }
.tree-person.branch-zablati_2 { --branch: #8a5a1d; }
.tree-person.branch-zablati_jan { --branch: #6b3d6e; }
.tree-person.branch-bez_linie { --branch: #6e6a62; }
.tree-person.branch-horejs { --branch: #8d3d3d; }
.tree-person.branch-other { --branch: #5c665d; }
.tree-person { box-shadow: inset 3px 0 0 var(--branch, #d5ddd4); }
.tree-person.direct-line { background: #fbf6ea; box-shadow: inset 4px 0 0 #b8892d; }
.tree-person.line-child { background: #fbf8f1; box-shadow: inset 4px 0 0 #d4b36a; }
.tree-person.is-self { outline: 2px solid #b8892d; }
.tree-person.is-picked { outline: 2px solid #1d5f8a; background: #f3f7fb; }
.you-tag { color: #8a6230; font-size: .62rem; letter-spacing: .08em; font-weight: 700; text-transform: uppercase; }
.tree-couple:has(.direct-line) { border-color: #e4d3a8; background: #fffaf0; }
#tree-root[data-focus="line"] .tree-person:not(.direct-line):not(.line-child) { opacity: .28; }
#tree-root[data-focus="zablati"] .tree-person:not(.branch-zablati):not(.direct-line),
#tree-root[data-focus="zablati_1"] .tree-person:not(.branch-zablati_1):not(.direct-line),
#tree-root[data-focus="zablati_2"] .tree-person:not(.branch-zablati_2):not(.direct-line),
#tree-root[data-focus="zablati_jan"] .tree-person:not(.branch-zablati_jan):not(.direct-line),
#tree-root[data-focus="bez_linie"] .tree-person:not(.branch-bez_linie):not(.direct-line),
#tree-root[data-focus="horejs"] .tree-person:not(.branch-horejs):not(.direct-line),
#tree-root[data-focus="hlavni"] .tree-person:not(.branch-hlavni):not(.direct-line) { opacity: .28; }
.book-tag { color: #8c674e; font-size: .6rem; letter-spacing: .08em; font-weight: 700; }
.branch-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0 0 16px; }
.branch-form label { display: grid; gap: 4px; font-size: .75rem; color: var(--muted); }
.branch-form input, .branch-form select { border: 1px solid #dddcd3; border-radius: 8px; background: #fff; padding: .55rem .7rem; min-width: 12rem; }
.branch-form .form-error { flex-basis: 100%; }
.tree-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.line-preview { position: sticky; top: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fffefa; padding: 16px 16px 8px; }
.line-preview h2 { font-size: 1.35rem; margin-bottom: .35rem; overflow-wrap: anywhere; }
.line-steps, .line-kids { list-style: none; margin: 0 0 12px; padding: 0; }
.line-steps { border-left: 2px solid #d4b36a; }
.line-steps li { padding: 0 0 10px 12px; }
.line-steps button, .line-kids button { border: 0; background: none; color: inherit; text-align: left; padding: 0; }
.line-steps strong, .line-kids strong { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.line-now, .line-picked { font-size: .68rem; letter-spacing: .08em; font-weight: 700; }
.line-now { color: #8a6230; }
.line-picked { color: #1d5f8a; }
.line-steps li.is-picked strong { color: #1d5f8a; }
.you-stay { margin: 0 0 10px; color: #8a6230; font-size: .78rem; }
.line-side { display: block; color: var(--muted); font-size: .72rem; }
.swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 99px; margin-right: .35rem; vertical-align: -1px; }
.login-wide, .family-gate-card { width: min(100%, 560px); }
.provider-row, .identity-form, #code-form { display: grid; gap: 10px; text-align: left; }
.provider { display: grid; gap: 2px; border: 1px solid #e4e1d6; border-radius: 12px; background: #fff; color: var(--ink); padding: 12px 14px; text-align: left; }
.provider b { font-size: .95rem; }
.provider span, .login-note { color: var(--muted); font-size: .75rem; line-height: 1.5; }
.identity-form label, #code-form label { display: grid; gap: 6px; font-size: .78rem; }
.identity-form input, #code-form input, #code-form select { width: 100%; border: 1px solid #dddcd3; border-radius: 8px; background: #fff; padding: .7rem .75rem; }
.member-results { display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.member-hit { border: 1px solid #e4e1d6; border-radius: 10px; background: #fff; text-align: left; padding: 8px 10px; }
.member-hit.selected { border-color: #345847; background: #f4f7f1; }
.rules-link { justify-self: center; margin-top: 8px; color: #8c674e; font-size: .78rem; }
.rules-card { width: min(100%, 760px); padding: 42px 40px; background: rgba(255,254,250,.92); border: 1px solid #ece8df; border-radius: 18px; }
.rules-list { display: grid; gap: 12px; padding-left: 1.2rem; line-height: 1.55; }
.rules-list li { padding-left: .2rem; }
.member-chip { margin: 0; font-size: .75rem; color: #8a6230; max-width: 240px; align-self: center; }
.gate-choice.open { border-color: #9aaf9b; }
.gate-choice.closed { opacity: .72; }
.changes-list { display: grid; gap: 12px; }
.change-card { border: 1px solid var(--line); border-radius: 12px; background: #fffefa; padding: 14px 16px; }
.change-card p { margin: .35rem 0 0; }
.person-avatar.branch-zablati_1 { background: #e5f1f6; color: #1d5f8a; }
.person-avatar.branch-zablati_2 { background: #f8efe4; color: #8a5a1d; }
.person-avatar.branch-zablati_jan { background: #f6eaf6; color: #6b3d6e; }
.person-avatar.branch-horejs { background: #f8eaea; color: #8d3d3d; }
.person-avatar.branch-bez_linie { background: #f0eeea; color: #6e6a62; }
.person-list-item.direct-line { box-shadow: inset 3px 0 0 #b8892d; }
.loose-people { display: flex; flex-wrap: wrap; gap: 8px; }
.loose-people .tree-person { border: 1px solid #e4e1d6; background: #fff; border-radius: 10px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .login-view { align-items: start; padding: max(16px, env(safe-area-inset-top)) 14px 24px; }
  .login-card, .rules-card { padding: 28px 18px 22px; border-radius: 16px; }
  .login-card h1, .family-gate-card h1, .rules-card h1 { font-size: 1.85rem; line-height: 1.15; }
  .login-card > .muted { font-size: 1rem; margin-bottom: 22px; }
  .eyebrow { letter-spacing: .12em; }
  .provider, .gate-choice { padding: 14px; }
  .gate-choice strong { font-size: 1.25rem; }
  .gate-choice span, .provider span { font-size: .9rem; }
  .stack input, .identity-form input, #code-form input, #code-form select,
  .person-dialog input, .person-dialog textarea, .person-dialog select,
  .inline-form select, .inline-form input, .inline-form textarea,
  .search-box input, .branch-form input, .branch-form select, .album-form input, .album-form textarea, .album-tag input, .google-photo-form input { font-size: 16px; }
  .google-photo-form .button { width: 100%; min-height: 46px; }
  .album-meta, .album-grid, .photos-grid { grid-template-columns: 1fr; }
  .album-actions .button { width: 100%; min-height: 46px; }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
    padding: max(10px, env(safe-area-inset-top)) 14px 8px;
  }
  .brand strong { font-size: 1rem; }
  .brand small { font-size: .62rem; letter-spacing: .08em; }
  .main-nav {
    position: sticky;
    top: 0;
    z-index: 6;
    order: 3;
    height: auto;
    gap: 6px;
    width: auto;
    margin: 0 -14px;
    padding: 8px 14px;
    overflow-x: auto;
    background: #fffefaf2;
    backdrop-filter: blur(10px);
  }
  .nav-link {
    flex: 0 0 auto;
    min-height: 40px;
    padding: .55rem .8rem;
    border-radius: 999px;
    background: #f1efe8;
    font-size: .88rem;
  }
  .nav-link.active { background: var(--green); color: #fff; }
  .nav-link.active::after { display: none; }
  .topbar-actions { order: 2; flex-wrap: wrap; width: 100%; }
  .member-chip { display: block; flex: 1 0 100%; max-width: none; font-size: .95rem; line-height: 1.35; }
  .topbar-actions .button { flex: 1 1 calc(50% - 8px); min-height: 40px; padding: .5rem .7rem; font-size: .84rem; }

  .page-shell, .tree-page { width: min(100% - 24px, 1680px); padding: 22px 0 40px; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 14px; margin-bottom: 18px; }
  .page-heading h1 { font-size: 1.7rem; line-height: 1.15; }
  .page-heading .muted, #tree-lead, #family-lead { font-size: 1rem; }
  .page-heading > .button, #add-unlinked-button { width: 100%; min-height: 46px; }

  .family-layout { grid-template-columns: 1fr; }
  .people-panel { display: block; border-right: 0; border-bottom: 1px solid #ebe9e1; padding: 16px; }
  .filter-chip { font-size: .84rem; padding: .5rem .75rem; min-height: 36px; }
  .people-list { display: grid; height: auto; min-height: 240px; max-height: 52vh; overflow: auto; }
  .person-list-item { max-width: none; min-height: 56px; padding: 12px 10px; }
  .person-list-item strong { font-size: .98rem; }
  .person-list-item small { font-size: .82rem; }
  .side-note { display: none; }
  .person-view { padding: 18px 16px 28px; }
  .person-detail-head { flex-direction: column; }
  .person-edit-button { min-height: 44px; font-size: .88rem; }
  .person-dates, .person-meta, .research-hint, .fact-copy, .story-copy { font-size: .95rem; }
  .fact-item { flex-direction: column; }
  .child-chip { font-size: .84rem; min-height: 36px; }
  .empty-state { min-height: 240px; }
  .form-row, .inline-form { grid-template-columns: 1fr; }
  .inline-form .button, .fact-form button { min-height: 46px; }

  .branch-form { display: grid; grid-template-columns: 1fr; }
  .branch-form input, .branch-form select, .branch-form .button { width: 100%; min-width: 0; min-height: 46px; }
  .tree-layout { grid-template-columns: minmax(0, 1fr); }
  #tree-root, .tree-block, .tree-scroll, .tree-index { min-width: 0; max-width: 100%; }
  .line-preview { order: -1; position: static; padding: 16px; }
  .line-preview h2 { font-size: 1.45rem; }
  .line-steps strong, .line-kids strong { font-size: 1.05rem; }
  .line-side, .you-stay { font-size: .9rem; }
  .tree-index { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
  .tree-index button { flex: 0 0 auto; min-height: 40px; font-size: .84rem; }
  .tree-scroll { max-width: 100%; -webkit-overflow-scrolling: touch; }
  .tree-block h2 { font-size: 1.25rem; }
  .tree-person { min-width: 132px; max-width: 168px; padding: 10px; }
  .tree-person strong { font-size: 1rem; }
  .tree-person small { font-size: .78rem; }

  .archive-grid { grid-template-columns: 1fr; }
  .tree-image-link { height: 220px; }
  .person-dialog { width: calc(100% - 16px); max-height: calc(100svh - 16px); padding: 18px 14px; }
  .dialog-actions { flex-direction: column; }
  .dialog-actions .button { width: 100%; min-height: 46px; }
  .rules-list { font-size: 1rem; padding-left: 1.1rem; }
  .site-footer { padding-bottom: max(23px, env(safe-area-inset-bottom)); }
  .research-grid { grid-template-columns: 1fr; }
  .main-nav { gap: 8px; overflow-x: auto; }
}

.research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.research-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-width: 0; }
.research-card h2 { font-size: 1.35rem; margin-bottom: .6rem; }
.research-card h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
.research-list { margin: .8rem 0 0; padding-left: 1.1rem; }
.research-list li { margin: .45rem 0; }
.research-row { display: grid; gap: 8px; margin: 10px 0; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kinship { margin: 0 0 8px; color: #8a6230; }
.reading-badge { display: inline-block; margin-left: .4rem; padding: .1rem .45rem; border-radius: 999px; background: #f3e4c8; color: #6d4a1d; font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: .72rem; font-weight: 700; letter-spacing: 0; vertical-align: middle; }

@media print {
  .grain, .topbar, .site-footer, .tree-scroll, .tree-index, .branch-form, .preview-actions, .page-heading { display: none !important; }
  #login-view, #family-gate, #rules-view, #family-tab, #research-tab, #changes-tab, #photos-tab, #archive-tab { display: none !important; }
  #tree-tab, #app-view { display: block !important; }
  .line-preview { border: 0; box-shadow: none; }
  body { background: white; }
}
