:root {
    --bg: #f5f6f7;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-strong: #ffffff;
    --surface-muted: #f0f2f4;
    --line: #d7dde3;
    --line-strong: #bfc8d2;
    --text: #1e252c;
    --muted: #5f6b76;
    --accent: #1f4f7a;
    --accent-dark: #173b5b;
    --action-green: #1d5b41;
    --action-green-dark: #154531;
    --action-blue: #1f4f7a;
    --action-blue-dark: #173b5b;
    --action-red: #8f2f2f;
    --action-red-dark: #6d2222;
    --shadow: 0 18px 42px rgba(33, 41, 52, 0.08);
    --radius-soft: 5px;
    --font-sans: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.tree-editor-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(31, 79, 122, 0.14);
    border-radius: var(--radius-soft);
    background: linear-gradient(180deg, #ffffff 0%, rgba(241, 247, 252, 0.98) 100%);
}

.tree-editor-head {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    align-items: center;
    justify-content: space-between;
}

.tree-editor-head h3,
.tree-editor-head p {
    margin: 0;
}

.tree-editor-actions,
.tree-person-actions,
.tree-link-actions,
.tree-editor-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tree-editor-button {
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 0.92rem;
}

.tree-editor-button.is-active {
    border-color: rgba(31, 79, 122, 0.36);
    background: rgba(224, 238, 249, 0.96);
    color: #163d5d;
}

.tree-editor-button.is-danger {
    border-color: rgba(109, 34, 34, 0.34);
    background: linear-gradient(135deg, var(--action-red) 0%, var(--action-red-dark) 100%);
    color: #ffffff;
}

.tree-editor-button.is-danger:hover,
.tree-editor-button.is-danger:focus-visible,
.tree-editor-button.is-danger.is-active {
    border-color: rgba(109, 34, 34, 0.42);
    background: linear-gradient(135deg, #a23838 0%, #7d2626 100%);
    color: #ffffff;
}

.tree-editor-notice {
    margin: 0;
    padding: 10px 12px;
    border-radius: 7px;
    background: rgba(232, 241, 249, 0.92);
    color: #24475f;
}

.tree-editor-notice.is-success {
    background: rgba(229, 244, 236, 0.95);
    color: #1d5b41;
}

.tree-editor-notice.is-error {
    background: rgba(252, 235, 235, 0.96);
    color: #8f2f2f;
}

.tree-canvas-node.is-selected {
    border-color: rgba(31, 79, 122, 0.62);
    background: linear-gradient(180deg, #ffffff 0%, rgba(235, 244, 252, 0.98) 100%);
    box-shadow: 0 18px 34px rgba(23, 59, 91, 0.2);
    z-index: 4;
}

.tree-canvas-node.is-pickable {
    cursor: crosshair;
}

.tree-canvas-node.is-relation-start {
    border-color: rgba(29, 91, 65, 0.62);
    background: linear-gradient(180deg, #ffffff 0%, rgba(231, 244, 238, 0.98) 100%);
}

.tree-canvas-node.is-child-highlight {
    border-color: rgba(29, 91, 65, 0.42);
    background: linear-gradient(180deg, #ffffff 0%, rgba(229, 244, 236, 0.96) 100%);
    box-shadow: 0 16px 28px rgba(23, 59, 91, 0.1);
}

.tree-canvas-node.is-parent-highlight {
    border-color: rgba(31, 79, 122, 0.42);
    background: linear-gradient(180deg, #ffffff 0%, rgba(225, 241, 238, 0.96) 100%);
    box-shadow: 0 16px 28px rgba(23, 59, 91, 0.1);
}

.tree-canvas-node.is-spouse-highlight {
    border-color: rgba(29, 91, 65, 0.58);
    background: linear-gradient(180deg, #ffffff 0%, rgba(207, 235, 220, 0.98) 100%);
    box-shadow: 0 16px 28px rgba(23, 59, 91, 0.1);
}

.tree-canvas-node.is-unlinked {
    border-style: solid;
    border-color: rgba(95, 107, 118, 0.36);
    background: linear-gradient(180deg, #ffffff 0%, rgba(244, 247, 250, 0.98) 100%);
}

.tree-canvas-arrow {
    fill: rgba(38, 87, 132, 0.72);
}

.tree-canvas-line-label rect {
    fill: rgba(255, 255, 255, 0.94);
    stroke: rgba(31, 79, 122, 0.16);
}

.tree-canvas-line-label text {
    fill: #24475f;
    font-size: 13px;
    font-weight: 700;
}

.tree-person-card.is-selected {
    border-color: rgba(31, 79, 122, 0.5);
}

.tree-link-actions {
    margin-top: 12px;
}

.tree-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: block;
    overflow-y: auto;
    padding: 24px;
    background: rgba(12, 28, 42, 0.42);
}

.tree-editor-modal::before,
.tree-editor-modal::after {
    content: "";
    display: block;
    height: max(24px, calc((100vh - 760px) / 2));
}

.tree-editor-dialog {
    width: min(720px, 100%);
    margin: 0 auto;
    overflow: visible;
    padding: 22px;
    border-radius: var(--radius-soft);
    background: #fff;
    box-shadow: 0 28px 70px rgba(12, 28, 42, 0.24);
}

.tree-editor-dialog-compact {
    width: min(520px, 100%);
}

.tree-confirm-dialog {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.tree-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, var(--action-red) 0%, var(--action-red-dark) 100%);
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 12px 24px rgba(143, 47, 47, 0.18);
}

.tree-confirm-content {
    display: grid;
    gap: 8px;
}

.tree-confirm-content h3,
.tree-confirm-content p {
    margin: 0;
}

.tree-confirm-content p {
    color: var(--muted);
    line-height: 1.5;
}

.tree-confirm-person-name {
    color: var(--action-blue-dark);
    font-weight: 800;
}

.tree-confirm-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

.tree-confirm-danger {
    border-color: rgba(109, 34, 34, 0.34);
    background: linear-gradient(135deg, var(--action-red) 0%, var(--action-red-dark) 100%);
    color: #ffffff;
}

.tree-confirm-danger:hover,
.tree-confirm-danger:focus-visible {
    border-color: rgba(109, 34, 34, 0.42);
    background: linear-gradient(135deg, #a23838 0%, #7d2626 100%);
    color: #ffffff;
}

.tree-editor-dialog-head {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tree-editor-dialog-head h3 {
    margin: 0;
}

.tree-editor-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(31, 79, 122, 0.18);
    border-radius: 50%;
    background: #fff;
    color: #24475f;
    cursor: pointer;
}

.tree-editor-form {
    display: grid;
    gap: 12px;
}

.tree-editor-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
    color: #24475f;
}

.tree-editor-form input,
.tree-editor-form select {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid rgba(31, 79, 122, 0.18);
    border-radius: 7px;
    background: #fff;
    color: #1c3345;
}

.tree-editor-checkbox {
    display: flex !important;
    flex-direction: row;
    gap: 10px !important;
    align-items: center;
}

.tree-editor-checkbox input {
    width: 18px;
    min-height: 18px;
}

.tree-editor-dialog-actions {
    justify-content: flex-end;
    margin-top: 8px;
}

body.tree-editor-modal-open {
    overflow: hidden;
}

.tree-canvas::before {
    z-index: 0;
}

.tree-canvas-world {
    z-index: 1;
}

.tree-canvas-lines {
    z-index: 2;
    overflow: visible;
}

.tree-canvas-layer {
    z-index: 3;
}

.tree-canvas-line {
    stroke: #1f4f7a;
    stroke-width: 5;
    opacity: 1;
    filter: drop-shadow(0 2px 2px rgba(23, 59, 91, 0.16));
}

.tree-canvas-line.is-parental {
    stroke: #1f4f7a;
}

.tree-canvas-line.is-spouse {
    stroke: #3a7099;
    stroke-width: 4;
}

.tree-canvas-arrow {
    fill: #1f4f7a;
}

.tree-canvas-line-label rect {
    fill: #ffffff;
    stroke: rgba(31, 79, 122, 0.36);
}

.tree-canvas-line-label text {
    fill: #173b5b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(207, 214, 221, 0.26), transparent 28%),
        linear-gradient(180deg, #fafbfc 0%, #eef1f4 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(31, 79, 122, 0.1);
}

.header-inner,
.footer-inner,
.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 50px;
    padding: 0;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.16);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 0.98rem;
}

.top-nav-link,
.top-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.18s ease;
}

.top-nav-link::after,
.top-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0;
    transform: scaleX(0.45);
    transform-origin: center;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.top-nav-link:hover,
.top-nav-link:focus-visible,
.top-nav a:hover,
.top-nav a:focus-visible {
    color: var(--accent-dark);
    text-decoration: none;
}

.top-nav-link:hover::after,
.top-nav-link:focus-visible::after,
.top-nav a:hover::after,
.top-nav a:focus-visible::after,
.top-nav-link.is-active::after,
.top-nav a.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

.top-nav-link.is-active,
.top-nav a.is-active {
    color: var(--text);
}

.site-header-inside {
    box-shadow: 0 8px 24px rgba(23, 38, 54, 0.05);
}

.header-inner-inside {
    min-height: 64px;
    gap: 18px;
}

.top-nav-inside {
    gap: 18px;
    justify-content: flex-end;
}

.top-nav-link {
    padding: 0;
}

.top-nav-link:hover,
.top-nav-link:focus-visible {
    text-decoration: none;
}

.top-nav-link.is-active {
    color: var(--text);
}

.top-nav-link.is-logout {
    color: var(--muted);
}

.top-nav-link.is-logout:hover,
.top-nav-link.is-logout:focus-visible {
    color: var(--accent-dark);
}

.page-shell {
    padding: 42px 0 56px;
}

.page-shell-narrow {
    width: min(760px, calc(100% - 32px));
}

.page-shell-wide {
    width: min(1240px, calc(100% - 32px));
}

.hero-block {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 28px;
    align-items: stretch;
}

.hero-copy,
.hero-card,
.content-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-soft);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 36px;
}

.hero-card,
.content-card {
    padding: 28px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--action-blue);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

h1,
h2 {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.1rem, 4vw, 3.7rem);
    line-height: 1.02;
    margin-bottom: 18px;
}

.hero-text,
.content-card p,
.feature-list li {
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.button-primary,
.button-secondary,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 46px;
    padding: 0 18px;
    border-radius: var(--radius-soft);
    border: 1px solid transparent;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease,
        color 0.16s ease,
        border-color 0.16s ease;
}

.button-primary,
button {
    color: #fffdf9;
    background: linear-gradient(135deg, var(--action-green) 0%, var(--action-green-dark) 100%);
}

.button-secondary {
    border-color: rgba(31, 79, 122, 0.26);
    background: linear-gradient(135deg, var(--action-blue) 0%, var(--action-blue-dark) 100%);
    color: #fff;
}

.button-primary:hover,
.button-primary:focus-visible,
.button-secondary:hover,
.button-secondary:focus-visible,
button:hover,
button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(23, 59, 91, 0.14);
}

.button-primary:hover,
.button-primary:focus-visible,
button:hover,
button:focus-visible {
    background: linear-gradient(135deg, #23674a 0%, #184d36 100%);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    background: linear-gradient(135deg, #255d90 0%, #1a456a 100%);
    border-color: rgba(23, 59, 91, 0.42);
}

a.button-primary:hover,
a.button-primary:focus-visible,
a.button-secondary:hover,
a.button-secondary:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.feature-list {
    margin: 18px 0 0;
    padding-left: 20px;
}

.content-card + .content-card {
    margin-top: 24px;
}

.form-stack {
    display: grid;
    gap: 18px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
    margin: 20px 0;
}

.inline-form label {
    display: grid;
    gap: 8px;
    min-width: 280px;
}

.form-stack label {
    display: grid;
    gap: 8px;
}

.checkbox-line {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.checkbox-line input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
}

.form-stack input,
.form-stack textarea,
.form-stack select,
.inline-form select {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    font: inherit;
    color: var(--text);
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-soft);
}

.form-stack input:focus,
.form-stack textarea:focus,
.form-stack select:focus,
.inline-form select:focus {
    outline: 2px solid rgba(31, 79, 122, 0.16);
    border-color: rgba(31, 79, 122, 0.48);
}

.form-stack select,
.inline-form select {
    padding-right: 42px;
    background:
        linear-gradient(45deg, transparent 50%, var(--action-blue-dark) 50%),
        linear-gradient(135deg, var(--action-blue-dark) 50%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    background-position:
        calc(100% - 18px) 20px,
        calc(100% - 13px) 20px,
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    appearance: none;
}

.form-stack textarea {
    resize: vertical;
}

.notice {
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: var(--radius-soft);
    border: 1px solid transparent;
}

.notice-success {
    color: #234826;
    background: rgba(210, 237, 204, 0.8);
    border-color: rgba(76, 124, 71, 0.25);
}

.notice-error {
    color: #6b1e1e;
    background: rgba(246, 212, 212, 0.86);
    border-color: rgba(160, 72, 72, 0.24);
}

.status-box {
    margin: 20px 0;
    padding: 18px 20px;
    border-radius: var(--radius-soft);
    border: 1px solid var(--line);
}

.status-box-graph_pending,
.status-box-render_pending {
    background: rgba(232, 239, 247, 0.92);
}

.status-box-ready_or_stale {
    background: rgba(225, 239, 232, 0.92);
}

.status-box-empty {
    background: rgba(241, 243, 245, 0.94);
}

.tree-placeholder {
    margin-top: 20px;
    padding: 22px;
    border-radius: var(--radius-soft);
    background: rgba(248, 251, 254, 0.96);
    border: 1px dashed rgba(31, 79, 122, 0.22);
}

.tree-placeholder-rich {
    display: grid;
    gap: 20px;
}

.tree-summary-grid,
.tree-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.tree-node-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.tree-link-grid {
    display: grid;
    gap: 14px;
}

.tree-canvas-stage {
    display: grid;
    gap: 16px;
}

.tree-canvas-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: baseline;
}

.tree-canvas-meta p {
    margin: 0;
}

.tree-canvas-layout {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.tree-canvas-side-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: start;
    padding: 14px;
    border: 1px solid rgba(31, 79, 122, 0.16);
    border-radius: var(--radius-soft);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 28px rgba(23, 59, 91, 0.08);
}

.tree-side-label,
.tree-side-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.tree-side-actions {
    display: grid;
    gap: 7px;
}

.tree-side-action {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(31, 79, 122, 0.2);
    border-radius: 6px;
    color: var(--action-blue-dark);
    background: rgba(238, 245, 251, 0.98);
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    cursor: pointer;
}

.tree-side-action:hover,
.tree-side-action:focus-visible {
    border-color: rgba(31, 79, 122, 0.36);
    background: rgba(220, 236, 248, 0.98);
    outline: none;
}

.tree-side-action.is-danger {
    border-color: rgba(109, 34, 34, 0.28);
    color: #ffffff;
    background: rgba(143, 47, 47, 0.92);
}

.tree-side-action.is-danger:hover,
.tree-side-action.is-danger:focus-visible {
    background: rgba(125, 38, 38, 0.98);
}

.tree-side-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.tree-canvas {
    position: relative;
    height: 640px;
    min-height: 680px;
    overflow: hidden;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.18);
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.9), transparent 42%),
        linear-gradient(180deg, rgba(247, 250, 253, 0.98), rgba(232, 239, 247, 0.95));
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.tree-canvas.is-dragging {
    cursor: grabbing;
}

.tree-canvas::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(31, 79, 122, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 79, 122, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.tree-canvas-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border-radius: var(--radius-soft);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(31, 79, 122, 0.14);
    box-shadow: 0 12px 24px rgba(23, 59, 91, 0.1);
}

.tree-canvas-control {
    min-width: 36px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 1rem;
    line-height: 1;
}

.tree-canvas-control.is-wide {
    min-width: 54px;
    font-size: 0.86rem;
}

.tree-canvas-world {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    will-change: transform;
}

.tree-canvas-lines {
    position: absolute;
    top: 0;
    left: 0;
}

.tree-canvas-lines {
    pointer-events: none;
}

.tree-canvas-layer {
    position: relative;
    min-height: 680px;
    width: 100%;
    z-index: 1;
}

.tree-canvas-line {
    stroke: rgba(31, 79, 122, 0.32);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    filter: drop-shadow(0 2px 2px rgba(23, 59, 91, 0.08));
}

.tree-canvas-line.is-parental {
    stroke: rgba(38, 87, 132, 0.58);
}

.tree-canvas-line.is-spouse {
    stroke: rgba(58, 112, 153, 0.62);
    stroke-dasharray: 10 10;
}

.tree-canvas-node {
    position: absolute;
    transform: translate(-50%, -50%);
    display: grid;
    gap: 6px;
    width: 190px;
    padding: 14px 16px;
    text-align: left;
    color: var(--text);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(31, 79, 122, 0.18);
    border-radius: var(--radius-soft);
    box-shadow: 0 16px 28px rgba(23, 59, 91, 0.1);
    cursor: inherit;
    z-index: 2;
}

.tree-canvas-node strong,
.tree-canvas-node span {
    pointer-events: none;
}

.tree-canvas-node:hover {
    transform: translate(-50%, -50%);
    box-shadow: 0 16px 28px rgba(23, 59, 91, 0.1);
}

.tree-canvas-node:focus,
.tree-canvas-node:focus-visible {
    outline: none;
}

.tree-canvas-node.is-focus {
    z-index: 3;
}

.tree-canvas-node.is-ancestor {
    border-color: rgba(31, 79, 122, 0.22);
}

.tree-canvas-node.is-descendant {
    border-color: rgba(29, 91, 65, 0.2);
}

.tree-canvas-node.is-spouse {
    border-style: solid;
    border-color: rgba(29, 91, 65, 0.28);
}

.tree-canvas-relation-badge {
    position: absolute;
    left: 12px;
    top: -13px;
    z-index: 2;
    display: inline-flex;
    width: max-content;
    min-height: 24px;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    color: var(--action-blue-dark);
    background: rgba(232, 239, 247, 0.92);
    border: 1px solid rgba(31, 79, 122, 0.14);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: none;
}

.tree-canvas-relation-badge[hidden] {
    display: none;
}

.tree-summary-card,
.tree-data-card {
    padding: 18px;
    border-radius: var(--radius-soft);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(31, 79, 122, 0.16);
}

.tree-summary-card h3,
.tree-data-block h3,
.tree-data-card h4 {
    margin-top: 0;
}

.tree-data-block {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-soft);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 79, 122, 0.12);
}

.tree-subsection {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.tree-mini-list {
    display: grid;
    gap: 8px;
}

.tree-mini-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: var(--radius-soft);
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(31, 79, 122, 0.1);
}

.tree-mini-title {
    color: var(--text);
    font-weight: 700;
}

.tree-mini-preview {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.tree-person-card {
    padding: 20px;
    border-radius: var(--radius-soft);
    background: linear-gradient(180deg, #ffffff 0%, rgba(246, 249, 252, 0.96) 100%);
    border: 1px solid rgba(31, 79, 122, 0.14);
    box-shadow: 0 14px 28px rgba(23, 59, 91, 0.07);
}

.tree-person-card.is-focused {
    border-color: rgba(31, 79, 122, 0.36);
    box-shadow: 0 18px 32px rgba(23, 59, 91, 0.14);
}

.tree-person-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.tree-person-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fffdf8;
    font-weight: 700;
    background: linear-gradient(135deg, var(--action-blue) 0%, var(--action-blue-dark) 100%);
}

.tree-person-card h4,
.tree-link-card h4 {
    margin: 0;
}

.tree-person-meta {
    margin: 4px 0 0;
    color: var(--muted);
}

.tree-person-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tree-toggle-button {
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--action-blue-dark);
    border: 1px solid rgba(31, 79, 122, 0.22);
}

.tree-focus-button {
    margin-top: 10px;
    background: rgba(232, 239, 247, 0.82);
    color: var(--action-blue-dark);
    border: 1px solid rgba(31, 79, 122, 0.16);
}

.tree-person-card.is-open .tree-toggle-button {
    background: linear-gradient(135deg, var(--action-blue) 0%, var(--action-blue-dark) 100%);
    color: #fffdf9;
}

.tree-person-details {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(31, 79, 122, 0.16);
}

.tree-detail-section {
    display: grid;
    gap: 10px;
}

.tree-detail-section h5 {
    margin: 0;
    font-size: 1rem;
}

.tree-detail-list {
    display: grid;
    gap: 10px;
}

.tree-detail-item {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-soft);
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(31, 79, 122, 0.1);
}

.tree-detail-item p {
    margin: 0;
}

.tree-detail-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.tree-detail-status,
.tree-detail-path {
    color: var(--muted);
    font-size: 0.92rem;
}

.tree-relatives-grid {
    display: grid;
    gap: 12px;
}

.tree-relative-group {
    display: grid;
    gap: 10px;
}

.tree-relative-group h6 {
    margin: 0;
    font-size: 0.98rem;
    color: var(--action-blue-dark);
}

.tree-relative-list {
    display: grid;
    gap: 10px;
}

.tree-relative-card {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: var(--radius-soft);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(31, 79, 122, 0.1);
}

.tree-relative-card p {
    margin: 0;
}

.tree-relative-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.tree-relative-role {
    color: var(--action-blue-dark);
    font-size: 0.9rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(232, 239, 247, 0.86);
    border: 1px solid rgba(31, 79, 122, 0.12);
}

.tree-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--action-blue-dark);
    background: rgba(232, 239, 247, 0.86);
    border: 1px solid rgba(31, 79, 122, 0.12);
    font-size: 0.9rem;
}

.tree-link-card {
    padding: 18px;
    border-radius: var(--radius-soft);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(31, 79, 122, 0.14);
}

.tree-link-line {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tree-link-person {
    padding: 10px 12px;
    border-radius: var(--radius-soft);
    background: rgba(247, 250, 253, 0.95);
    border: 1px solid rgba(31, 79, 122, 0.1);
}

.tree-link-arrow {
    padding: 8px 10px;
    border-radius: 999px;
    color: #fffdf8;
    background: linear-gradient(135deg, var(--action-blue) 0%, var(--action-blue-dark) 100%);
    white-space: nowrap;
    font-size: 0.92rem;
}

.tree-export-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) auto;
    gap: 16px;
    align-items: end;
    padding: 16px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.96));
}

.tree-export-field {
    display: grid;
    gap: 8px;
    margin: 0;
}

.tree-export-field span {
    color: var(--text);
    font-weight: 700;
}

.tree-export-field select {
    width: 100%;
    min-height: 48px;
    padding: 0 42px 0 14px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.22);
    color: var(--text);
    background:
        linear-gradient(45deg, transparent 50%, var(--action-blue-dark) 50%),
        linear-gradient(135deg, var(--action-blue-dark) 50%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    background-position:
        calc(100% - 18px) 21px,
        calc(100% - 13px) 21px,
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    appearance: none;
}

.tree-export-field select:focus {
    outline: 2px solid rgba(31, 79, 122, 0.16);
    border-color: rgba(31, 79, 122, 0.46);
}

.tree-generated-files {
    display: grid;
    gap: 18px;
}

.tree-generated-files-block {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.tree-generated-files-block h3 {
    margin: 0;
}

.tree-generated-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.tree-generated-card {
    display: grid;
    align-content: start;
    gap: 8px;
}

.tree-generated-card h3,
.tree-generated-card p {
    margin: 0;
}

.tree-download-button {
    min-height: 40px;
    margin-top: 6px;
}

.book-family-form {
    align-items: end;
    padding: 16px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.96));
}

.book-family-field {
    display: grid;
    gap: 8px;
    min-width: min(420px, 100%);
    margin: 0;
}

.book-family-field span,
.book-title-field span {
    color: var(--text);
    font-weight: 700;
}

.book-family-field select {
    width: 100%;
    min-height: 48px;
    padding: 0 42px 0 14px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.22);
    color: var(--text);
    background:
        linear-gradient(45deg, transparent 50%, var(--action-blue-dark) 50%),
        linear-gradient(135deg, var(--action-blue-dark) 50%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    background-position:
        calc(100% - 18px) 21px,
        calc(100% - 13px) 21px,
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    appearance: none;
}

.book-family-field select:focus {
    outline: 2px solid rgba(31, 79, 122, 0.16);
    border-color: rgba(31, 79, 122, 0.46);
}

.book-title-field {
    display: grid;
    gap: 8px;
    width: min(500px, 100%);
}

.book-title-field input,
.book-title-field textarea {
    width: 100%;
}

.book-profile-options {
    display: grid;
    gap: 14px;
    width: min(500px, 100%);
}

.book-profile-field {
    display: grid;
    gap: 8px;
    margin: 0;
}

.book-profile-field span {
    color: var(--text);
    font-weight: 700;
}

.book-profile-field select {
    width: 100%;
    min-height: 46px;
    padding: 0 42px 0 14px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.22);
    color: var(--text);
    background:
        linear-gradient(45deg, transparent 50%, var(--action-blue-dark) 50%),
        linear-gradient(135deg, var(--action-blue-dark) 50%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    background-position:
        calc(100% - 18px) 20px,
        calc(100% - 13px) 20px,
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    appearance: none;
}

.book-profile-field select:focus {
    outline: 2px solid rgba(31, 79, 122, 0.16);
    border-color: rgba(31, 79, 122, 0.46);
}

.book-create-button {
    width: fit-content;
    min-width: 220px;
}

.book-history-list {
    display: grid;
    gap: 18px;
}

.book-history-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
}

.book-history-grid .mini-card {
    display: grid;
    gap: 6px;
}

.book-history-grid .mini-card h3,
.book-history-grid .mini-card p {
    margin: 0;
}

.family-create-form,
.content-story-form,
.content-biography-form {
    max-width: 500px;
}

.family-field,
.content-field {
    width: min(500px, 100%);
}

.tree-family-form,
.content-family-form {
    padding: 16px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.96));
}

.tree-top-panel {
    display: grid;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.tree-add-person-button {
    width: fit-content;
    min-height: 42px;
}

.tree-family-field,
.content-select-field {
    width: min(420px, 100%);
}

.tree-family-form select,
.content-family-form select,
.content-story-form select,
.content-biography-form select {
    min-height: 46px;
    padding: 0 42px 0 14px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.22);
    color: var(--text);
    background:
        linear-gradient(45deg, transparent 50%, var(--action-blue-dark) 50%),
        linear-gradient(135deg, var(--action-blue-dark) 50%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    background-position:
        calc(100% - 18px) 20px,
        calc(100% - 13px) 20px,
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    appearance: none;
}

.tree-family-form select:focus,
.content-family-form select:focus,
.content-story-form select:focus,
.content-biography-form select:focus {
    outline: 2px solid rgba(31, 79, 122, 0.16);
    border-color: rgba(31, 79, 122, 0.46);
}

.book-section-box {
    border-color: rgba(31, 79, 122, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.96));
    box-shadow: 0 10px 22px rgba(23, 59, 91, 0.04);
}

.book-section-box legend {
    color: var(--action-blue-dark);
}

.book-section-box .checkbox-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 12px;
    align-items: start;
    padding: 10px 12px;
    border-radius: var(--radius-soft);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 79, 122, 0.1);
}

.book-section-box .checkbox-line input {
    grid-column: 2;
    grid-row: 1;
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--action-blue-dark);
}

.book-section-box .checkbox-line span {
    grid-column: 1;
    grid-row: 1;
}

.book-material-section {
    display: grid;
    gap: 10px;
}

.person-create-form,
.person-edit-form,
.media-upload-form {
    max-width: 500px;
}

.person-field,
.media-upload-field {
    width: min(500px, 100%);
}

.relationship-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 14px;
}

.relationship-field {
    width: min(250px, 100%);
}

.relationship-field select {
    width: 250px;
    max-width: 100%;
}

.media-family-form {
    padding: 16px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.96));
}

.media-select-field {
    width: min(420px, 100%);
}

.person-create-form select,
.relationship-form select,
.media-family-form select,
.media-upload-form select,
.media-inline-form select {
    min-height: 46px;
    padding: 0 42px 0 14px;
    border-radius: var(--radius-soft);
    border: 1px solid rgba(31, 79, 122, 0.22);
    color: var(--text);
    background:
        linear-gradient(45deg, transparent 50%, var(--action-blue-dark) 50%),
        linear-gradient(135deg, var(--action-blue-dark) 50%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    background-position:
        calc(100% - 18px) 20px,
        calc(100% - 13px) 20px,
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    appearance: none;
}

.person-create-form select:focus,
.relationship-form select:focus,
.media-family-form select:focus,
.media-upload-form select:focus,
.media-inline-form select:focus {
    outline: 2px solid rgba(31, 79, 122, 0.16);
    border-color: rgba(31, 79, 122, 0.46);
}

.site-footer {
    border-top: 1px solid rgba(143, 79, 44, 0.15);
    background: rgba(255, 250, 241, 0.65);
}

.footer-inner {
    padding: 18px 0 26px;
    color: var(--muted);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.mini-card {
    padding: 18px;
    border-radius: var(--radius-soft);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(31, 79, 122, 0.12);
    box-shadow: 0 10px 22px rgba(23, 59, 91, 0.05);
}

.mini-card a {
    text-underline-offset: 3px;
    transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.mini-card a:hover,
.mini-card a:focus-visible {
    color: var(--accent-dark);
    text-decoration: underline;
}

.permission-box {
    margin: 0;
    padding: 14px;
    border-radius: var(--radius-soft);
    border: 1px solid var(--line);
    background: rgba(255, 252, 247, 0.88);
}

.permission-box legend {
    padding: 0 8px;
    font-weight: 700;
}

.permission-box .checkbox-line {
    align-items: flex-start;
    margin-top: 10px;
}

.permission-box.book-section-box {
    border-color: rgba(31, 79, 122, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.96));
    box-shadow: 0 10px 22px rgba(23, 59, 91, 0.04);
}

.permission-box.book-section-box .checkbox-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 12px;
    align-items: start;
    padding: 10px 12px;
    border-radius: var(--radius-soft);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 79, 122, 0.1);
}

.permission-box.book-section-box .checkbox-line input {
    grid-column: 2;
    grid-row: 1;
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--action-blue-dark);
}

.permission-box.book-section-box .checkbox-line span {
    grid-column: 1;
    grid-row: 1;
}

.invite-link-box {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-soft);
    background: rgba(255, 252, 247, 0.92);
    border: 1px dashed rgba(143, 79, 44, 0.3);
    word-break: break-all;
    font-family: "Courier New", monospace;
}

.media-inline-form {
    margin-top: 14px;
}

.button-danger {
    border-color: rgba(109, 34, 34, 0.34);
    color: #fff;
    background: linear-gradient(135deg, var(--action-red) 0%, var(--action-red-dark) 100%);
}

.button-danger:hover,
.button-danger:focus-visible {
    background: linear-gradient(135deg, #a23838 0%, #7d2626 100%);
    border-color: rgba(109, 34, 34, 0.42);
}

.show-more-item.is-hidden {
    display: none;
}

.show-more-button {
    margin-top: 18px;
    justify-self: center;
}

.auth-shell {
    width: min(360px, calc(100% - 32px));
}

.auth-card {
    width: min(300px, 100%);
    margin: 0 auto;
}

.auth-card p a,
.auth-card .notice a {
    text-underline-offset: 3px;
    transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.auth-card p a:hover,
.auth-card p a:focus-visible,
.auth-card .notice a:hover,
.auth-card .notice a:focus-visible {
    color: var(--accent-dark);
    text-decoration: underline;
}

@media (max-width: 860px) {
    .header-inner,
    .hero-block {
        grid-template-columns: 1fr;
        display: grid;
    }

    .header-inner {
        justify-content: initial;
    }

    .top-nav {
        gap: 12px;
    }

    .hero-copy,
    .hero-card,
    .content-card {
        padding: 24px;
    }

    .tree-canvas {
        min-height: 760px;
    }

    .tree-canvas-layout {
        grid-template-columns: 1fr;
    }

    .tree-canvas-side-panel {
        position: relative;
        z-index: 3;
    }

    .tree-side-actions {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }

    .tree-canvas-layer {
        min-height: 760px;
    }

    .tree-canvas-node {
        width: 160px;
        padding: 12px 14px;
    }

    .tree-export-form {
        grid-template-columns: 1fr;
    }

    .tree-export-form .button-primary {
        width: 100%;
    }

    .tree-generated-grid,
    .tree-node-grid {
        grid-template-columns: 1fr;
    }
}

.tree-canvas::before {
    z-index: 0;
}

.tree-canvas-world {
    z-index: 1;
}

.tree-canvas-lines {
    z-index: 5 !important;
    overflow: visible;
}

.tree-canvas-layer {
    z-index: 3 !important;
}

.tree-canvas-line {
    stroke: #1f4f7a !important;
    stroke-width: 5 !important;
    opacity: 1 !important;
    filter: drop-shadow(0 2px 2px rgba(23, 59, 91, 0.16));
}

.tree-canvas-line.is-parental {
    stroke: #1f4f7a !important;
}

.tree-canvas-line.is-spouse {
    stroke: #3a7099 !important;
    stroke-width: 4 !important;
}

.tree-canvas-arrow {
    fill: #1f4f7a !important;
}

.landing-shell {
    width: min(1180px, calc(100% - 32px));
    padding-top: 34px;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 28px;
    align-items: stretch;
}

.landing-hero-copy,
.landing-hero-visual,
.landing-feature,
.landing-band,
.landing-contact,
.landing-steps article {
    border: 1px solid var(--line);
    border-radius: var(--radius-soft);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.landing-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 520px;
    padding: 44px;
}

.landing-hero-copy h1 {
    max-width: 780px;
    margin-bottom: 20px;
    color: var(--text);
}

.landing-lead {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 1.13rem;
    line-height: 1.75;
}

.landing-hero-visual {
    position: relative;
    display: grid;
    align-content: center;
    gap: 28px;
    min-height: 520px;
    padding: 34px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 252, 0.96));
}

.landing-tree-card {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 6px;
    min-width: 138px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-soft);
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(23, 59, 91, 0.1);
}

.landing-tree-card strong {
    color: var(--text);
    font-size: 1rem;
}

.landing-tree-card span {
    color: var(--muted);
    font-size: 0.9rem;
}

.landing-tree-card-root {
    justify-self: center;
    border-color: rgba(31, 79, 122, 0.3);
    background: linear-gradient(180deg, #ffffff 0%, #eef7fd 100%);
}

.landing-tree-row {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 22px;
}

.landing-tree-row-small {
    gap: 16px;
}

.landing-tree-row-small .landing-tree-card {
    min-width: 112px;
    padding: 12px 13px;
}

.landing-tree-line {
    justify-self: center;
    width: 4px;
    height: 28px;
    margin: -12px 0;
    border-radius: 999px;
    background: var(--action-blue);
}

.landing-tree-line-wide {
    width: min(78%, 420px);
    height: 4px;
    background: var(--action-green);
}

.landing-section,
.landing-band,
.landing-contact {
    margin-top: 30px;
}

.landing-section-head {
    max-width: 760px;
    margin-bottom: 18px;
}

.landing-section-head h2,
.landing-band h2,
.landing-contact h2 {
    margin-bottom: 10px;
    font-size: clamp(1.7rem, 2.6vw, 2.45rem);
    line-height: 1.12;
}

.landing-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.landing-feature {
    padding: 22px;
}

.landing-feature h3,
.landing-steps h3 {
    margin: 0 0 10px;
    font-size: 1.08rem;
}

.landing-feature p,
.landing-band p,
.landing-contact p,
.landing-steps p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.landing-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 28px;
    background: linear-gradient(135deg, #ffffff 0%, #eef6fb 100%);
}

.landing-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.landing-steps article {
    padding: 20px;
}

.landing-steps span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    border-radius: var(--radius-soft);
    color: #ffffff;
    background: var(--action-blue);
    font-weight: 800;
}

.landing-contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.35fr);
    gap: 26px;
    align-items: center;
    padding: 28px;
}

.landing-contact-list {
    display: grid;
    gap: 10px;
}

.landing-contact-list a,
.landing-footer a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.landing-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 28px;
    margin-top: 26px;
    padding: 24px 0 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.95rem;
}

@media (max-width: 960px) {
    .landing-hero,
    .landing-band,
    .landing-contact {
        grid-template-columns: 1fr;
    }

    .landing-feature-grid,
    .landing-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-hero-copy,
    .landing-hero-visual {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .landing-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 24px;
    }

    .landing-hero-copy,
    .landing-hero-visual,
    .landing-band,
    .landing-contact {
        padding: 22px;
    }

    .landing-feature-grid,
    .landing-steps {
        grid-template-columns: 1fr;
    }

    .landing-tree-row,
    .landing-tree-row-small {
        flex-direction: column;
        align-items: center;
    }

    .landing-tree-line-wide {
        width: 4px;
        height: 34px;
    }
}

.tree-canvas-node,
.tree-canvas-node:hover,
.tree-canvas-node.is-child-highlight,
.tree-canvas-node.is-parent-highlight,
.tree-canvas-node.is-spouse-highlight {
    transform: translate(-50%, -50%) !important;
}

.tree-canvas-relation-badge {
    position: absolute !important;
    left: 12px !important;
    top: -13px !important;
    width: max-content !important;
    box-shadow: none !important;
}

.tree-canvas-line-label rect {
    fill: #ffffff;
    stroke: rgba(31, 79, 122, 0.36);
}

.tree-canvas-line-label text {
    fill: #173b5b;
    font-size: 13px;
    font-weight: 700;
}

.tree-canvas-node {
    z-index: 4;
}

.tree-canvas-layer {
    position: relative;
    z-index: 3 !important;
}

.tree-canvas-lines {
    position: absolute;
    inset: 0;
    z-index: 8 !important;
    display: block;
    overflow: visible;
    pointer-events: none;
}

.tree-canvas-line {
    fill: none !important;
    stroke: #1f4f7a !important;
    stroke-width: 5 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 1 !important;
    filter: drop-shadow(0 2px 2px rgba(23, 59, 91, 0.16));
}

.tree-canvas-line.is-parental {
    stroke: #1f4f7a !important;
}

.tree-canvas-line.is-spouse {
    stroke: #1d5b41 !important;
    stroke-width: 4 !important;
    stroke-dasharray: none !important;
}

.tree-canvas-line.is-relative-highlight {
    stroke: #2f8f62 !important;
    stroke-width: 6 !important;
    opacity: 1 !important;
    filter: none !important;
}

.tree-canvas-node.is-child-highlight {
    border-color: rgba(29, 91, 65, 0.42) !important;
    background: linear-gradient(180deg, #ffffff 0%, rgba(229, 244, 236, 0.96) 100%) !important;
    box-shadow: 0 16px 28px rgba(23, 59, 91, 0.1) !important;
}

.tree-canvas-node.is-parent-highlight {
    border-color: rgba(31, 79, 122, 0.42) !important;
    background: linear-gradient(180deg, #ffffff 0%, rgba(225, 241, 238, 0.96) 100%) !important;
    box-shadow: 0 16px 28px rgba(23, 59, 91, 0.1) !important;
}

.tree-canvas-node.is-spouse-highlight {
    border-color: rgba(29, 91, 65, 0.58) !important;
    background: linear-gradient(180deg, #ffffff 0%, rgba(207, 235, 220, 0.98) 100%) !important;
    box-shadow: 0 16px 28px rgba(23, 59, 91, 0.1) !important;
}

.tree-canvas-arrow {
    fill: #1f4f7a !important;
}
