@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Serif+Display:ital@0;1&display=swap');

:root { --ink:#26352c; --muted:#718077; --paper:#fbfaf6; --cream:#f3efe4; --line:#d9d6cb; --sage:#6f806f; --terracotta:#b76645; --white:#fff; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; color:var(--ink); background:var(--paper); font-family:"DM Sans",sans-serif; min-height:100vh; }
button,input { font:inherit; }
button { cursor:pointer; }
.topbar { height:76px; display:flex; align-items:center; justify-content:space-between; padding:0 clamp(22px,5vw,72px); border-bottom:1px solid #e5e1d8; background:rgba(251,250,246,.92); position:sticky; top:0; z-index:5; backdrop-filter:blur(10px); }
.brand { display:flex; align-items:center; gap:11px; color:var(--ink); text-decoration:none; font-family:"DM Serif Display",serif; font-size:24px; }
.brand-mark { width:36px; height:36px; display:grid; place-items:center; border:1px solid var(--ink); border-radius:50% 50% 45% 55%; font-size:19px; font-style:italic; transform:rotate(-4deg); }
.topbar-actions { display:flex; align-items:center; gap:9px; }
.account-name { color:var(--muted); font-size:12px; }
.code-button { border:1px solid #d8d5ca; background:white; border-radius:5px; padding:7px 12px; color:var(--ink); display:flex; flex-direction:column; align-items:flex-start; }
.code-button span { color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.08em; }
.code-button strong { font-size:12px; letter-spacing:.1em; }
.leave-button { font-size:19px; }
.button { border:0; border-radius:5px; padding:11px 18px; font-weight:600; transition:.18s ease; }
.button:hover { transform:translateY(-1px); }
.button-primary { background:var(--ink); color:white; box-shadow:0 4px 12px rgba(38,53,44,.14); }
.button-primary:hover { background:#33483b; }
.button-secondary { color:var(--ink); background:#edeae1; }
main { padding:0 clamp(16px,4vw,56px) 54px; }
.access-gate { min-height:calc(100vh - 76px); padding:65px 22px; background:var(--cream); background-image:radial-gradient(#d7d2c5 1px,transparent 1px); background-size:24px 24px; }
.gate-intro { text-align:center; max-width:650px; margin:0 auto 42px; }
.gate-intro h1 { margin:0; font:48px/1.08 "DM Serif Display",serif; }
.gate-intro h1 em { color:var(--terracotta); font-weight:400; }
.gate-intro > p:last-child { color:var(--muted); line-height:1.6; }
.gate-panels { display:grid; grid-template-columns:1fr 50px 1fr; max-width:900px; margin:auto; align-items:stretch; }
.gate-card { padding:32px; background:rgba(255,255,255,.94); border:1px solid #d9d5ca; border-radius:10px; box-shadow:0 15px 35px rgba(55,59,50,.07); display:flex; flex-direction:column; }
.gate-number { color:var(--terracotta); font:italic 18px "DM Serif Display",serif; }
.gate-card h2 { margin:12px 0 3px; font:28px "DM Serif Display",serif; }
.gate-card p { color:var(--muted); font-size:13px; line-height:1.55; min-height:42px; }
.gate-card label { margin:12px 0 7px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.gate-card input { border:1px solid #d5d2c8; border-radius:5px; padding:12px; outline:none; margin-bottom:12px; }
.gate-card input:focus { border-color:var(--sage); box-shadow:0 0 0 3px rgba(111,128,111,.12); }
.code-input { text-transform:uppercase; letter-spacing:.15em; font-weight:600; }
.gate-divider { display:grid; place-items:center; color:#999c96; font:italic 15px "DM Serif Display",serif; }
.gate-divider span { background:var(--cream); padding:9px 0; z-index:1; }
.gate-divider::before { content:""; height:100%; width:1px; background:#d6d2c7; position:absolute; }
.gate-divider { position:relative; }
.gate-error { color:#a34c36; text-align:center; min-height:20px; font-size:13px; margin-top:20px; }
.text-button { border:0; background:transparent; color:var(--sage); padding:10px; font-size:12px; }
.guest-view-form { max-width:900px; margin:18px auto 0; padding:14px 18px; display:grid; grid-template-columns:1fr 190px auto; gap:12px; align-items:center; border:1px solid #d9d5ca; border-radius:8px; background:rgba(255,255,255,.8); }
.guest-view-form strong,.guest-view-form span { display:block; }
.guest-view-form span { color:var(--muted); font-size:10px; }
.guest-view-form input { padding:11px; border:1px solid #d5d2c8; border-radius:5px; text-transform:uppercase; letter-spacing:.1em; }
.my-trees { max-width:900px; margin:0 auto 28px; padding:22px; border:1px solid #d9d5ca; border-radius:10px; background:rgba(255,255,255,.82); }
.my-trees-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.my-trees-heading h2 { margin:0; font:25px "DM Serif Display",serif; }
.my-trees-heading span { color:var(--muted); font-size:11px; }
.my-trees-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; }
.my-tree-button { padding:14px; border:1px solid #d9d5ca; border-radius:7px; background:white; text-align:left; color:var(--ink); }
.my-tree-button strong,.my-tree-button span { display:block; }
.my-tree-button span { margin-top:4px; color:var(--muted); font-size:10px; text-transform:uppercase; }
.hero { text-align:center; max-width:760px; margin:0 auto; padding:68px 20px 46px; }
.eyebrow { margin:0 0 12px; text-transform:uppercase; letter-spacing:.18em; font-size:11px; font-weight:600; color:var(--terracotta); }
.hero h1 { margin:0; font:50px/1.08 "DM Serif Display",serif; letter-spacing:-.02em; }
.hero h1 em { color:var(--terracotta); font-weight:400; }
.hero-copy { max-width:570px; margin:20px auto 0; color:var(--muted); line-height:1.65; font-size:15px; }
.tree-shell { max-width:1300px; min-height:460px; margin:0 auto; border:1px solid #dedbd1; border-radius:12px; background:var(--cream); overflow:hidden; box-shadow:0 18px 45px rgba(65,62,52,.06); }
.tree-toolbar { height:72px; padding:0 22px; background:rgba(255,255,255,.68); border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.toolbar-label { margin:0 0 3px; font:20px "DM Serif Display",serif; }
.person-count { margin:0; color:var(--muted); font-size:12px; }
.toolbar-right,.relationship-key { display:flex; align-items:center; }
.toolbar-right { gap:16px; }
.relationship-key { gap:15px; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.06em; }
.relationship-key span { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.key-line { display:inline-block; width:25px; height:0; border-top:2px solid #68786d; }
.divorced-key { border-color:#c7473d; border-top-style:dashed; }
.widowed-key { border-color:#7651a8; border-top-style:dotted; }
.zoom-controls { display:flex; align-items:center; border:1px solid #d8d5ca; border-radius:5px; overflow:hidden; background:white; }
.zoom-button,.zoom-value { height:32px; border:0; border-right:1px solid #e1ded5; background:white; color:var(--ink); }
.zoom-button { width:33px; font-size:16px; }
.zoom-value { min-width:48px; padding:0 7px; color:var(--muted); font-size:10px; }
.zoom-button:last-child { border-right:0; }
.zoom-button:hover,.zoom-value:hover { background:#eef0e9; }
.fullscreen-button { font-size:15px; }
.group-settings-button { height:34px; padding:0 12px; border:1px solid #d8d5ca; border-radius:5px; background:white; color:var(--ink); font-size:11px; font-weight:600; }
.group-settings-button:hover { background:#eef0e9; }
.group-settings-button.active { background:var(--ink); border-color:var(--ink); color:white; }
.icon-button,.close-button { border:0; background:transparent; color:var(--muted); font-size:21px; padding:8px; border-radius:50%; }
.icon-button:hover,.close-button:hover { background:#e7e3d9; color:var(--ink); }
.tree-canvas { min-height:388px; position:relative; overflow:auto; padding:72px; cursor:grab; background-image:radial-gradient(#d5d0c2 1px,transparent 1px); background-size:22px 22px; }
.tree-canvas.is-dragging { cursor:grabbing; user-select:none; }
.tree-canvas button,.tree-canvas input,.tree-canvas select,.tree-canvas textarea { cursor:pointer; }
.tree-zoom-stage { position:relative; margin:0 auto; }
.tree-zoom-stage > .generations { position:absolute; top:0; left:0; transform-origin:top left; }
.tree-shell:fullscreen { width:100vw; max-width:none; height:100vh; border:0; border-radius:0; background:var(--cream); }
.tree-shell:fullscreen .tree-canvas { height:calc(100vh - 72px); min-height:0; }
.tree-shell:fullscreen:has(.compare-banner:not([hidden])) .tree-canvas { height:calc(100vh - 128px); }
.tree-shell.mobile-fullscreen { position:fixed; inset:0; z-index:1000; width:100vw; max-width:none; height:100dvh; min-height:0; margin:0; border:0; border-radius:0; background:var(--cream); }
.tree-shell.mobile-fullscreen .tree-canvas { height:calc(100dvh - 66px); min-height:0; }
.tree-shell.mobile-fullscreen:has(.compare-banner:not([hidden])) .tree-canvas { height:calc(100dvh - 122px); }
body.tree-fullscreen-open { overflow:hidden; }
.compare-banner { min-height:56px; padding:8px 18px; display:flex; align-items:center; gap:12px; border-bottom:1px solid #d9d5ca; background:#edf0e8; }
.compare-banner[hidden] { display:none; }
.compare-banner > div { flex:1; display:flex; flex-direction:column; }
.compare-banner strong { font-size:13px; }
.compare-banner span { color:var(--muted); font-size:11px; }
.empty-state { min-height:315px; max-width:460px; margin:auto; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:35px 20px; }
.sapling { width:68px; height:68px; margin-bottom:18px; border-radius:50% 50% 45% 55%; background:#e0e5d9; display:grid; place-items:center; color:var(--sage); font-size:28px; transform:rotate(-5deg); }
.sapling span { transform:rotate(5deg); }
.empty-state h2 { margin:0; font:32px/1.1 "DM Serif Display",serif; }
.empty-state > p:not(.eyebrow) { color:var(--muted); line-height:1.55; max-width:400px; font-size:14px; }
.empty-add { margin-top:8px; }
.generations { min-width:fit-content; display:flex; flex-direction:column; align-items:center; gap:210px; padding:8px 54px 80px; }
.generations { position:relative; }
.generation { display:flex; justify-content:center; align-items:flex-start; gap:164px; position:relative; z-index:2; }
.generation-family { display:flex; align-items:flex-start; gap:72px; position:relative; }
.household { display:flex; align-items:flex-start; gap:48px; }
.tree-connections { position:absolute; inset:0; pointer-events:none; z-index:1; overflow:visible; }
.connection-underlay { fill:none; stroke:var(--cream); stroke-width:7; stroke-linecap:round; stroke-linejoin:round; }
.connection { fill:none; stroke:#8e9a90; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.connection.married { stroke:#68786d; stroke-width:2.5; }
.connection.divorced { stroke:#c7473d; stroke-width:2.5; stroke-dasharray:8 6; }
.connection.widowed { stroke:#7651a8; stroke-width:2.5; stroke-dasharray:2 5; }
.connection.compare-path { stroke:#d58b3d; stroke-width:4; stroke-dasharray:none; }
.family-junction { fill:var(--cream); stroke:#7f8e83; stroke-width:2; rx:2; }
.person-card { width:245px; background:color-mix(in srgb,var(--group-color,#fff) 18%,#fff); border:1px solid #d8d5ca; border-radius:8px; box-shadow:0 7px 18px rgba(61,64,54,.08); overflow:hidden; position:relative; }
.person-card.compare-selectable { cursor:pointer; }
.person-card.compare-selected { outline:3px solid #d39a5c; outline-offset:4px; }
.person-card.compare-highlight { width:270px; z-index:4; box-shadow:0 12px 28px rgba(38,53,44,.2); outline:3px solid #657a68; outline-offset:4px; }
.compare-relationship-label { padding:10px 12px; border-top:1px solid #d7d4ca; background:rgba(255,255,255,.72); text-align:center; color:var(--ink); font-size:13px; font-weight:700; }
.tree-shell.clean-view .card-actions,.tree-shell.clean-view .edit-person { display:none; }
.tree-shell.view-only .card-actions,.tree-shell.view-only .edit-person { display:none; }
.tree-shell.compare-mode .card-actions,.tree-shell.compare-mode .edit-person { opacity:.2; pointer-events:none; }
.person-card::before { content:""; position:absolute; top:0; left:0; bottom:0; width:4px; background:var(--sage); }
.person-card[data-gender="male"]::before { background:#4f8dcc; }
.person-card[data-gender="female"]::before { background:#df769c; }
.card-main { padding:18px 18px 14px 21px; }
.card-top { display:flex; gap:12px; align-items:center; }
.avatar { width:42px; height:42px; flex:0 0 auto; display:grid; place-items:center; border-radius:50%; background:#e7eadf; color:var(--sage); font:20px "DM Serif Display",serif; }
[data-gender="male"] .avatar { background:#dceafa; color:#3475b7; }
[data-gender="female"] .avatar { background:#f9dfe8; color:#c5527c; }
.card-name { margin:0; font:19px/1.15 "DM Serif Display",serif; }
.maiden { font-size:11px; color:var(--muted); margin-top:3px; }
.life { margin:13px 0 0; font-size:12px; color:var(--muted); line-height:1.55; }
.life strong { color:var(--ink); font-weight:500; }
.place { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card-notes { margin-top:10px; padding-top:9px; border-top:1px solid #ece8df; color:#667168; font-size:11px; line-height:1.45; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.card-actions { display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid #e7e4dc; }
.card-actions button { border:0; border-right:1px solid #e7e4dc; padding:9px 4px; background:#faf9f5; color:#68746c; font-size:11px; }
.card-actions button:last-child { border-right:0; }
.card-actions button:hover { background:#eef0e9; color:var(--ink); }
.edit-person { position:absolute; right:8px; top:7px; border:0; background:transparent; color:#9a9e98; padding:4px; font-size:14px; }
.relation-tag { position:absolute; top:-20px; left:50%; transform:translateX(-50%); font-size:10px; color:#8c928c; background:var(--cream); padding:2px 7px; text-transform:uppercase; letter-spacing:.08em; white-space:nowrap; }
dialog { width:min(720px,calc(100% - 28px)); border:0; border-radius:12px; padding:0; color:var(--ink); background:var(--paper); box-shadow:0 30px 100px rgba(23,34,27,.3); }
dialog::backdrop { background:rgba(30,39,33,.58); backdrop-filter:blur(3px); }
.share-dialog-content { padding:38px; text-align:center; position:relative; }
.share-dialog-content h2 { margin:0; font:32px "DM Serif Display",serif; }
.share-dialog-content > p:not(.eyebrow) { color:var(--muted); }
.share-close { position:absolute; right:14px; top:12px; }
.share-code { padding:11px; border:1px dashed var(--sage); border-radius:7px; background:#eef0e8; font-size:16px; font-weight:600; letter-spacing:.13em; }
.invite-code-row { display:grid; grid-template-columns:1fr 180px auto; gap:12px; align-items:center; margin-top:14px; text-align:left; }
.invite-code-row strong,.invite-code-row span { display:block; }
.invite-code-row span { color:var(--muted); font-size:10px; margin-top:2px; }
.group-dialog-content { padding:32px; position:relative; }
.group-dialog-content h2 { margin:0; font:32px "DM Serif Display",serif; }
.group-dialog-copy { color:var(--muted); font-size:13px; }
.group-dialog-close { position:absolute; right:14px; top:12px; }
.group-form { display:grid; grid-template-columns:1fr 90px auto; gap:12px; align-items:end; margin-top:22px; padding-bottom:22px; border-bottom:1px solid #e2dfd6; }
.group-form .button { height:42px; }
.group-form small { color:var(--muted); font-size:10px; }
.group-form-actions { display:flex; gap:7px; }
.color-field input { height:42px; padding:4px; cursor:pointer; }
.group-list { display:flex; flex-direction:column; gap:8px; margin-top:18px; }
.group-list-empty { color:var(--muted); font-size:12px; text-align:center; padding:18px; }
.group-list-row { display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid #e0ddd4; border-radius:6px; background:white; }
.group-swatch { width:22px; height:22px; border-radius:50%; border:1px solid rgba(0,0,0,.12); }
.group-list-row strong { flex:1; font-size:13px; }
.group-row-actions { display:flex; gap:5px; }
.group-edit,.group-delete { border:0; background:transparent; font-size:12px; }
.group-edit { color:#526b5b; }
.group-delete { color:#a05a47; }
.backup-form { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:end; margin-top:22px; }
.backup-form .button { height:42px; }
.backup-limit-note { margin:9px 0 18px; color:var(--muted); font-size:10px; }
.backup-list { display:flex; flex-direction:column; gap:9px; max-height:340px; overflow:auto; }
.backup-list-row { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; padding:12px; border:1px solid #dfdcd3; border-radius:6px; background:white; }
.backup-list-row strong { display:block; font-size:13px; }
.backup-meta { color:var(--muted); font-size:10px; margin-top:3px; }
.backup-actions { display:flex; gap:6px; }
.backup-actions button { border:0; background:#eef0e9; border-radius:4px; padding:7px 9px; color:var(--ink); font-size:11px; }
.tree-danger-zone { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:24px; padding-top:20px; border-top:1px solid #dfc9c1; }
.tree-danger-zone strong { display:block; color:#8f3f32; font-size:13px; }
.tree-danger-zone p { margin:4px 0 0; color:var(--muted); font-size:10px; }
.danger-button { border:1px solid #a54838; background:#a54838; color:white; }
.danger-button:hover { background:#8d392d; }
.delete-tree-content .field { margin-top:20px; }
.delete-tree-error { min-height:18px; color:#a54838; font-size:12px; }
.import-dialog-content { width:min(760px,calc(100vw - 28px)); box-sizing:border-box; }
.import-prompt-row,.import-actions,.import-confirm { display:flex; align-items:center; gap:12px; margin-top:18px; }
.import-prompt-row span { color:var(--sage); font-size:12px; }
.import-code-field { margin-top:18px; }
.import-code-field textarea { min-height:220px; font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; }
.import-preview { margin-top:18px; padding:14px; border:1px solid #d7d4ca; border-radius:6px; background:white; font-size:12px; line-height:1.5; }
.import-preview strong { display:block; margin-bottom:5px; font-size:14px; }
.import-preview ul { margin:8px 0 0; padding-left:20px; color:#9a5c3f; }
.import-confirm { flex-wrap:wrap; padding-top:16px; border-top:1px solid #e2dfd6; }
.import-confirm label { display:flex; align-items:center; gap:6px; font-size:12px; }
.import-confirm .button { margin-left:auto; }
#personForm { padding:28px; }
.dialog-header { display:flex; justify-content:space-between; align-items:flex-start; border-bottom:1px solid #e2dfd6; padding-bottom:20px; margin-bottom:22px; }
.dialog-header h2 { margin:0; font:32px "DM Serif Display",serif; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:17px; }
.full-width { margin-bottom:20px; }
.field { display:flex; flex-direction:column; gap:7px; }
.field label { font-size:12px; font-weight:600; }
.field label b { color:var(--terracotta); }
.field input,.field textarea { width:100%; padding:11px 12px; border:1px solid #d7d4ca; border-radius:5px; background:white; outline:none; }
.field textarea { resize:vertical; min-height:110px; line-height:1.5; }
.field input:focus,.field textarea:focus { border-color:var(--sage); box-shadow:0 0 0 3px rgba(111,128,111,.12); }
.notes-field { grid-column:1 / -1; }
.parent-selectors { margin-top:20px; padding:16px; border:1px solid #dedbd1; border-radius:6px; background:#f8f6f0; }
.parent-selector-heading label { font-size:12px; font-weight:600; }
.parent-selector-heading p { margin:3px 0 13px; color:var(--muted); font-size:11px; }
.parent-selector-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.field select { width:100%; padding:11px 12px; border:1px solid #d7d4ca; border-radius:5px; background:white; outline:none; }
.field select:focus { border-color:var(--sage); box-shadow:0 0 0 3px rgba(111,128,111,.12); }
.segmented { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.segmented input { position:absolute; opacity:0; pointer-events:none; }
.segmented span { display:block; border:1px solid #d7d4ca; border-radius:5px; padding:9px; text-align:center; font-size:12px; color:var(--muted); }
.segmented input:checked + span { border-color:var(--ink); background:#e8ece4; color:var(--ink); font-weight:600; }
.partner-relationships { margin-top:20px; padding:16px; border:1px solid #ded8cb; border-radius:6px; background:#f4f0e7; }
.partner-relationships-heading label { font-size:12px; font-weight:600; }
.partner-relationships-heading p { margin:3px 0 12px; color:var(--muted); font-size:11px; }
.partner-relationship-row { display:grid; grid-template-columns:1fr 145px; align-items:center; gap:14px; padding:10px 0; border-top:1px solid #ddd8cc; }
.partner-relationship-row strong { font-size:13px; }
.partner-relationship-row select { width:100%; padding:9px 10px; border:1px solid #d2cec3; border-radius:5px; background:white; }
.dialog-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:26px; padding-top:20px; border-top:1px solid #e2dfd6; }
.action-spacer { flex:1; }
.delete-button { background:#f3e2dc; color:#934f3b; }
.delete-button:hover { background:#ead1c8; }
@media (max-width:650px) { .hero { padding-top:48px; } .hero h1,.gate-intro h1 { font-size:38px; } .form-grid,.parent-selector-grid { grid-template-columns:1fr; } dialog { max-height:92vh; overflow:auto; } #personForm { padding:21px; } .topbar { height:66px; padding-inline:15px; } .brand { font-size:21px; } .gate-panels { grid-template-columns:1fr; gap:14px; } .gate-divider { height:20px; } .gate-divider::before { height:1px; width:100%; } .code-button span { display:none; } .code-button { padding:9px; } .topbar-actions { gap:4px; } .relationship-key { display:none; } .toolbar-right { gap:5px; } .zoom-button { width:29px; } .group-settings-button { padding:0 8px; } .group-form { grid-template-columns:1fr 72px; } .group-form .button { grid-column:1 / -1; } }

@media (max-width:700px) {
  main { padding-inline:8px; padding-bottom:20px; }
  .topbar { min-height:62px; height:auto; padding:8px 10px; gap:8px; }
  .brand { font-size:19px; flex-shrink:0; }
  .brand-mark { width:32px; height:32px; }
  .topbar-actions { min-width:0; overflow-x:auto; scrollbar-width:none; }
  .topbar-actions::-webkit-scrollbar,.toolbar-right::-webkit-scrollbar { display:none; }
  .topbar-actions .button { min-height:42px; padding:8px 10px; white-space:nowrap; font-size:11px; }
  .code-button { flex:0 0 auto; min-height:42px; justify-content:center; }
  .leave-button { min-width:42px; min-height:42px; }
  .hero { padding:30px 12px 25px; }
  .hero h1 { font-size:34px; }
  .tree-shell { min-height:0; border-radius:8px; }
  .tree-toolbar { min-height:66px; height:auto; padding:8px 10px; gap:8px; }
  .tree-toolbar > div:first-child { flex:0 0 auto; }
  .toolbar-label { font-size:17px; }
  .toolbar-right { min-width:0; flex:1; justify-content:flex-start; overflow-x:auto; scroll-snap-type:x proximity; padding-bottom:2px; }
  .zoom-controls,.group-settings-button { flex:0 0 auto; scroll-snap-align:start; }
  .zoom-button { width:44px; height:44px; font-size:20px; }
  .zoom-value { height:44px; min-width:52px; }
  .group-settings-button { min-height:44px; padding:0 13px; font-size:11px; }
  .tree-canvas { height:68dvh; min-height:430px; padding:45px; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  .person-card { width:260px; }
  .card-main { padding:19px 18px 16px 22px; }
  .card-actions button { min-height:48px; padding:10px 3px; font-size:11px; touch-action:manipulation; }
  .edit-person { min-width:42px; min-height:42px; font-size:18px; touch-action:manipulation; }
  .compare-banner { padding:8px 10px; flex-wrap:wrap; }
  .compare-banner > div { flex-basis:100%; }
  .compare-banner .button,.compare-banner .close-button { min-height:42px; }
  dialog { width:calc(100% - 16px); max-height:94dvh; margin:auto; border-radius:10px; }
  #personForm,.group-dialog-content,.share-dialog-content { padding:18px; }
  .dialog-actions { position:sticky; bottom:-18px; margin-inline:-18px; padding:13px 18px; background:var(--paper); z-index:3; }
  .dialog-actions .button { min-height:44px; }
  .guest-view-form { grid-template-columns:1fr; }
  .invite-code-row { grid-template-columns:1fr auto; }
  .invite-code-row > div:first-child { grid-column:1 / -1; }
  .share-code { font-size:13px; }
  .backup-form { grid-template-columns:1fr; }
  .backup-list-row { grid-template-columns:1fr; }
  .backup-actions button { min-height:42px; }
  .tree-danger-zone { align-items:stretch; flex-direction:column; }
  .import-confirm { align-items:stretch; flex-direction:column; }
  .import-confirm .button { margin-left:0; }
}

@media (pointer:coarse) {
  .tree-canvas { touch-action:none; }
  .tree-canvas button { touch-action:manipulation; }
}
