/* ==========================================================================
   BeGourzo — Modern Nordic Family Tree Design System
   Warm Ivory · Deep Forest Ink · Botanical Sage · Heirloom Gold
   ========================================================================== */

:root {
    --bg-canvas: #faf8f4;
    --bg-surface: rgba(255, 255, 255, 0.86);
    --bg-surface-solid: #ffffff;
    --bg-subtle: #f2ede3;
    --bg-tint: #eef5f0;

    --ink-primary: #182721;
    --ink-secondary: #4a5d54;
    --ink-muted: #76887f;

    --brand-primary: #245c44;
    --brand-primary-hover: #1b4734;
    --brand-soft: #d9eee2;
    --brand-accent: #c88946;
    --brand-accent-soft: #f7ebd9;

    --danger: #b83b3b;
    --danger-soft: #fdecec;
    --warn: #b26b17;
    --warn-soft: #fdf3e2;
    --success: #1f6e49;
    --success-soft: #e2f5eb;

    --border-hairline: rgba(24, 39, 33, 0.09);
    --border-strong: rgba(24, 39, 33, 0.16);

    --shadow-sm: 0 2px 10px rgba(24, 39, 33, 0.05);
    --shadow-md: 0 12px 32px rgba(24, 39, 33, 0.08), 0 2px 8px rgba(24, 39, 33, 0.04);
    --shadow-lg: 0 24px 60px rgba(24, 39, 33, 0.14), 0 4px 16px rgba(24, 39, 33, 0.06);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink-primary);
    background-color: var(--bg-canvas);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---------- Ambient Animated Background ---------- */

.app-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 10%, rgba(217, 238, 226, 0.65), transparent 44%),
        radial-gradient(circle at 88% 16%, rgba(247, 235, 217, 0.7), transparent 42%),
        radial-gradient(circle at 50% 90%, rgba(217, 238, 226, 0.35), transparent 50%),
        var(--bg-canvas);
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    animation: ambientFloat 22s ease-in-out infinite alternate;
}

.orb-1 {
    width: 420px;
    height: 420px;
    background: #b7e4c7;
    top: -120px;
    left: -90px;
}

.orb-2 {
    width: 380px;
    height: 380px;
    background: #f0d7b5;
    top: 120px;
    right: -120px;
    animation-delay: -7s;
}

.orb-3 {
    width: 320px;
    height: 320px;
    background: #cde7da;
    bottom: -100px;
    left: 38%;
    animation-delay: -14s;
}

@keyframes ambientFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(26px, -18px, 0) scale(1.06); }
    100% { transform: translate3d(-18px, 24px, 0) scale(0.96); }
}

/* ---------- Header / Navigation ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(250, 248, 244, 0.8);
    border-bottom: 1px solid var(--border-hairline);
}

.header-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-primary), #3a7d5e);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(36, 92, 68, 0.24);
    transition: transform 0.35s var(--ease-spring);
}

.brand-link:hover .brand-mark {
    transform: rotate(-4deg) scale(1.05);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 0.74rem;
    color: var(--ink-muted);
    letter-spacing: 0.02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-form {
    margin: 0;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.52rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s var(--ease-spring);
}

.nav-pill:hover {
    background: rgba(36, 92, 68, 0.08);
    color: var(--brand-primary);
}

.nav-pill.active {
    background: var(--ink-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(24, 39, 33, 0.16);
}

.nav-pill-admin.active {
    background: var(--brand-primary);
}

.nav-pill-ghost {
    border-color: var(--border-hairline);
    background: rgba(255, 255, 255, 0.65);
}

.app-main {
    flex: 1;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.28s var(--ease-spring), box-shadow 0.28s var(--ease-spring), background-color 0.2s ease, border-color 0.2s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.btn-lg {
    padding: 0.88rem 1.6rem;
    font-size: 0.98rem;
}

.btn-sm {
    padding: 0.48rem 0.95rem;
    font-size: 0.84rem;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), #2e7356);
    color: #fff;
    box-shadow: 0 8px 22px rgba(36, 92, 68, 0.24);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--brand-primary-hover), var(--brand-primary));
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(36, 92, 68, 0.3);
}

.btn-soft {
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink-primary);
    border-color: var(--border-hairline);
    box-shadow: var(--shadow-sm);
}

.btn-soft:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--ink-secondary);
    border-color: var(--border-hairline);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(24, 39, 33, 0.05);
    color: var(--ink-primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #9c2f2f;
}

.btn-danger-outline {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(184, 59, 59, 0.25);
}

.btn-danger-outline:hover:not(:disabled) {
    background: #fbd9d9;
}

/* ---------- Landing Hero ---------- */

.hero-section {
    padding: 4rem 1.5rem 2.2rem;
    text-align: center;
}

.hero-inner {
    max-width: 820px;
    margin: 0 auto;
    animation: fadeUp 0.75s var(--ease-spring) both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--border-hairline);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand-primary);
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3aa173;
    box-shadow: 0 0 0 0 rgba(58, 161, 115, 0.55);
    animation: pulseRing 2.4s ease-out infinite;
}

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(58, 161, 115, 0.55); }
    70% { box-shadow: 0 0 0 9px rgba(58, 161, 115, 0); }
    100% { box-shadow: 0 0 0 0 rgba(58, 161, 115, 0); }
}

.hero-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5.4vw, 4.1rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--ink-primary);
}

.title-accent {
    background: linear-gradient(125deg, var(--brand-primary), #3a8b65, var(--brand-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    margin: 1.15rem auto 0;
    max-width: 620px;
    font-size: 1.08rem;
    color: var(--ink-secondary);
    line-height: 1.65;
}

.hero-actions {
    margin-top: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.hero-stats-strip {
    margin: 2.3rem auto 0;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.85rem 1.7rem;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-hairline);
    box-shadow: var(--shadow-md);
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    color: inherit;
}

.stat-pill-clickable {
    cursor: pointer;
    transition: transform 0.25s var(--ease-spring);
}

.stat-pill-clickable:hover {
    transform: translateY(-2px);
}

.stat-pill-clickable:hover .stat-name-latest {
    color: var(--brand-primary);
}

.stat-num {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--ink-primary);
    line-height: 1.15;
}

.stat-name-latest {
    font-size: 1.08rem;
    transition: color 0.2s ease;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-top: 0.15rem;
}

.stat-sep {
    width: 1px;
    height: 30px;
    background: var(--border-hairline);
}

/* ---------- Tree Workspace & Toolbar ---------- */

.tree-workspace-section {
    padding: 1rem 1.5rem 4rem;
}

.workspace-container {
    max-width: 1360px;
    margin: 0 auto;
}

.workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.15rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 240px;
    max-width: 400px;
}

.search-box svg {
    position: absolute;
    left: 0.95rem;
    color: var(--ink-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.68rem 2.2rem 0.68rem 2.6rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-hairline);
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--ink-primary);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(36, 92, 68, 0.12);
}

.search-clear {
    position: absolute;
    right: 0.7rem;
    border: none;
    background: var(--bg-subtle);
    color: var(--ink-secondary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.match-count-badge {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--brand-soft);
    color: var(--brand-primary);
    font-size: 0.82rem;
    font-weight: 600;
}

.view-segmented {
    display: inline-flex;
    padding: 4px;
    border-radius: var(--radius-pill);
    background: rgba(24, 39, 33, 0.06);
    border: 1px solid var(--border-hairline);
}

.seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-pill);
    border: none;
    background: transparent;
    color: var(--ink-secondary);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
}

.seg-btn.active {
    background: #fff;
    color: var(--ink-primary);
    box-shadow: var(--shadow-sm);
}

/* ---------- Interactive Family Tree Canvas ---------- */

.tree-canvas-shell {
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-hairline);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: fadeUp 0.6s var(--ease-spring) both;
}

.tree-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.7rem 1.15rem;
    border-bottom: 1px solid var(--border-hairline);
    background: rgba(255, 255, 255, 0.76);
}

.tree-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--ink-muted);
}

.zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.icon-ctrl-btn,
.text-ctrl-btn {
    border: 1px solid var(--border-hairline);
    background: #fff;
    color: var(--ink-primary);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
}

.icon-ctrl-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.text-ctrl-btn {
    height: 32px;
    padding: 0 0.75rem;
    font-size: 0.8rem;
}

.icon-ctrl-btn:hover,
.text-ctrl-btn:hover {
    background: var(--bg-tint);
    border-color: rgba(36, 92, 68, 0.3);
    color: var(--brand-primary);
}

.zoom-readout {
    min-width: 48px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-secondary);
}

.ctrl-divider {
    width: 1px;
    height: 20px;
    background: var(--border-hairline);
    margin: 0 0.2rem;
}

.tree-viewport {
    position: relative;
    width: 100%;
    height: clamp(540px, 68vh, 760px);
    overflow: hidden;
    cursor: grab;
    background-image: radial-gradient(rgba(24, 39, 33, 0.085) 1px, transparent 1px);
    background-size: 24px 24px;
    user-select: none;
    touch-action: none;
}

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

.tree-stage {
    position: relative;
    display: inline-block;
    padding: 3rem 4rem 4.5rem;
    transform-origin: 0 0;
    will-change: transform;
}

.tree-stage.smooth-pan {
    transition: transform 0.38s var(--ease-spring);
}

.tree-connectors-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

.tree-connector-path {
    fill: none;
    stroke: rgba(36, 92, 68, 0.28);
    stroke-width: 2.2;
    stroke-linecap: round;
    transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.tree-connector-path.is-highlighted {
    stroke: var(--brand-primary);
    stroke-width: 3.2;
    filter: drop-shadow(0 0 6px rgba(36, 92, 68, 0.28));
}

.tree-connector-dot {
    fill: rgba(36, 92, 68, 0.45);
    transition: fill 0.3s ease;
}

.tree-connector-dot.is-highlighted {
    fill: var(--brand-accent);
}

.tree-roots-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4rem;
}

.tree-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tree-children {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2.2rem;
    margin-top: 4.1rem;
}

.tree-node-wrapper {
    animation: nodeReveal 0.6s var(--ease-spring) var(--enter-delay, 0ms) both;
}

@keyframes nodeReveal {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- Person Node Cards ---------- */

.person-node {
    --accent-main: #245c44;
    --accent-soft: #dff1e7;

    position: relative;
    width: 248px;
    padding: 1rem 1.05rem 0.9rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid var(--border-hairline);
    box-shadow: 0 10px 26px rgba(24, 39, 33, 0.07), 0 2px 6px rgba(24, 39, 33, 0.04);
    cursor: pointer;
    text-align: left;
    transition:
        transform 0.35s var(--ease-spring),
        box-shadow 0.35s var(--ease-spring),
        border-color 0.25s ease,
        opacity 0.25s ease;
}

.person-node::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
    background: var(--accent-main);
    opacity: 0.85;
}

.person-node:hover,
.person-node:focus-visible {
    outline: none;
    transform: translateY(-6px) scale(1.015);
    border-color: var(--accent-main);
    box-shadow: 0 20px 42px rgba(24, 39, 33, 0.13), 0 0 0 4px rgba(36, 92, 68, 0.08);
}

.person-node.is-selected {
    border-color: var(--accent-main);
    box-shadow: 0 18px 40px rgba(36, 92, 68, 0.2), 0 0 0 4px rgba(36, 92, 68, 0.16);
    transform: translateY(-4px);
}

.person-node.is-search-match {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px rgba(200, 137, 70, 0.24), var(--shadow-md);
}

.person-node.is-dimmed {
    opacity: 0.32;
    filter: grayscale(0.4);
}

/* Generation Color Accents */
.gen-1 { --accent-main: #1f543e; --accent-soft: #d9eee2; }
.gen-2 { --accent-main: #2e7356; --accent-soft: #e2f3ea; }
.gen-3 { --accent-main: #b47838; --accent-soft: #f7ebd9; }
.gen-4 { --accent-main: #3e6b7e; --accent-soft: #e2eef4; }
.gen-5 { --accent-main: #7b5a82; --accent-soft: #f0e6f3; }

.node-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.gen-pill {
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.18rem 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-main);
}

.node-badges {
    display: flex;
    gap: 0.3rem;
}

.status-dot-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.48rem;
    border-radius: var(--radius-pill);
}

.status-new {
    background: var(--warn-soft);
    color: var(--warn);
}

.status-flagged {
    background: var(--danger-soft);
    color: var(--danger);
}

.node-body {
    display: flex;
    align-items: center;
    gap: 0.78rem;
}

.node-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-soft), #fff);
    border: 1px solid rgba(24, 39, 33, 0.08);
    color: var(--accent-main);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-info {
    min-width: 0;
}

.node-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.03rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ink-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-dates {
    margin: 0.18rem 0 0;
    font-size: 0.8rem;
    color: var(--ink-muted);
    font-weight: 500;
}

.node-partner {
    margin-top: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.22rem 0.55rem;
    border-radius: 8px;
    background: var(--bg-subtle);
    font-size: 0.75rem;
    color: var(--ink-secondary);
}

.node-partner span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-excerpt {
    margin: 0.6rem 0 0;
    font-size: 0.79rem;
    color: var(--ink-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.node-footer {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.node-meta-count {
    font-size: 0.75rem;
    color: var(--ink-muted);
    font-weight: 500;
}

.node-add-child-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.58rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(36, 92, 68, 0.2);
    background: var(--bg-tint);
    color: var(--brand-primary);
    font-family: inherit;
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.node-add-child-btn:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* ---------- Generations Grid View ---------- */

.generations-board {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    animation: fadeUp 0.45s var(--ease-spring) both;
}

.generation-band {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}

.generation-band-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.gen-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.32rem 0.85rem;
    border-radius: var(--radius-pill);
    background: var(--accent-soft, var(--brand-soft));
    color: var(--accent-main, var(--brand-primary));
}

.gen-count {
    font-size: 0.84rem;
    color: var(--ink-muted);
    font-weight: 600;
}

.generation-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.gen-card {
    background: #fff;
    border: 1.5px solid var(--border-hairline);
    border-radius: 18px;
    padding: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), border-color 0.2s ease;
}

.gen-card:hover,
.gen-card.is-selected {
    transform: translateY(-4px);
    border-color: var(--accent-main, var(--brand-primary));
    box-shadow: var(--shadow-md);
}

.gen-card-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.gen-card-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.gen-card-parent {
    margin: 0.7rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand-primary);
}

.gen-card-desc {
    margin: 0.5rem 0 0;
    font-size: 0.84rem;
    color: var(--ink-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Person Detail Slide-Over Drawer ---------- */

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(18, 30, 25, 0.38);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: flex-end;
    animation: fadeIn 0.25s ease both;
}

.detail-drawer {
    width: min(460px, 100vw);
    height: 100%;
    background: #fcfbf8;
    box-shadow: -16px 0 48px rgba(18, 30, 25, 0.18);
    display: flex;
    flex-direction: column;
    animation: drawerSlideIn 0.38s var(--ease-spring) both;
}

@keyframes drawerSlideIn {
    from { transform: translateX(100%); opacity: 0.6; }
    to { transform: translateX(0); opacity: 1; }
}

.drawer-header {
    padding: 1.4rem 1.5rem 1.15rem;
    border-bottom: 1px solid var(--border-hairline);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
}

.drawer-identity {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.drawer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand-primary), #3d8968);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(36, 92, 68, 0.22);
}

.drawer-badges {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.drawer-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.16rem 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--brand-soft);
    color: var(--brand-primary);
}

.drawer-tag-soft {
    background: var(--bg-subtle);
    color: var(--ink-secondary);
}

.drawer-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.2;
}

.close-circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-hairline);
    background: #fff;
    color: var(--ink-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.close-circle-btn:hover {
    background: var(--bg-subtle);
    color: var(--ink-primary);
}

.drawer-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.drawer-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.fact-tile {
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border-hairline);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.fact-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
}

.fact-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink-primary);
}

.drawer-section h3 {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
}

.drawer-bio {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.68;
    color: var(--ink-primary);
    white-space: pre-line;
    background: #fff;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--border-hairline);
}

.drawer-bio.is-muted {
    color: var(--ink-muted);
    font-style: italic;
}

.relations-stack {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.relation-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.relation-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-secondary);
}

.relation-chips-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.relation-chip {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.85rem;
    border-radius: 14px;
    border: 1px solid var(--border-hairline);
    background: #fff;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: all 0.22s var(--ease-spring);
}

.relation-chip:hover {
    border-color: var(--brand-primary);
    background: var(--bg-tint);
    transform: translateX(3px);
}

.chip-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chip-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.chip-text strong {
    font-size: 0.9rem;
}

.chip-text small {
    font-size: 0.76rem;
    color: var(--ink-muted);
}

.chip-arrow {
    color: var(--ink-muted);
    font-weight: 600;
}

.empty-relation-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.drawer-report-box {
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-hairline);
}

.report-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.submitted-meta {
    font-size: 0.78rem;
    color: var(--ink-muted);
}

.link-danger-btn {
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.flag-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.flag-form label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-secondary);
}

.flag-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.drawer-footer {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid var(--border-hairline);
    background: #fff;
}

/* ---------- Modals & Forms ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(18, 30, 25, 0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeIn 0.2s ease both;
}

.modal-card {
    width: min(620px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.65rem;
    box-shadow: var(--shadow-lg);
    animation: modalPop 0.34s var(--ease-spring) both;
}

.modal-compact {
    width: min(460px, 100%);
}

@keyframes modalPop {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.modal-eyebrow {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-primary);
    margin-bottom: 0.2rem;
}

.modal-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink-primary);
}

.req {
    color: var(--danger);
}

.opt {
    font-weight: 400;
    color: var(--ink-muted);
    font-size: 0.78rem;
}

.field-input {
    width: 100%;
    padding: 0.68rem 0.85rem;
    border-radius: 12px;
    border: 1.5px solid var(--border-hairline);
    background: #fcfbf9;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--ink-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(36, 92, 68, 0.11);
}

textarea.field-input {
    resize: vertical;
    min-height: 84px;
}

.moderation-note {
    margin: 0;
    padding: 0.75rem 0.95rem;
    border-radius: 12px;
    background: var(--bg-tint);
    color: var(--brand-primary);
    font-size: 0.82rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.4rem;
}

.confirm-text {
    margin: 0 0 1rem;
    color: var(--ink-secondary);
    font-size: 0.94rem;
}

/* ---------- Toasts & Alerts ---------- */

.toast-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.2rem;
    border-radius: 14px;
    margin-bottom: 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    animation: fadeUp 0.35s var(--ease-spring) both;
}

.toast-success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(31, 110, 73, 0.22);
}

.toast-error {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(184, 59, 59, 0.25);
}

.toast-close {
    border: none;
    background: none;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.alert-banner {
    padding: 0.78rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
}

.alert-error {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(184, 59, 59, 0.2);
}

/* ---------- Admin Login ---------- */

.login-section {
    padding: 4.5rem 1.5rem;
    display: flex;
    justify-content: center;
}

.login-card {
    width: min(430px, 100%);
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.55s var(--ease-spring) both;
}

.login-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--brand-soft);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-card h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.75rem;
}

.login-sub {
    margin: 0.45rem 0 1.4rem;
    font-size: 0.9rem;
    color: var(--ink-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-hint {
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-hairline);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.79rem;
    color: var(--ink-muted);
}

.login-hint code {
    background: var(--bg-subtle);
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    color: var(--ink-primary);
}

/* ---------- Admin Dashboard ---------- */

.admin-section {
    padding: 2.2rem 1.5rem 4rem;
}

.admin-container {
    max-width: 1360px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeUp 0.5s var(--ease-spring) both;
}

.admin-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.admin-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-primary);
}

.admin-header h1 {
    margin: 0.2rem 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.admin-header p {
    margin: 0.35rem 0 0;
    color: var(--ink-secondary);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.kpi-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-hairline);
    border-radius: 18px;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.kpi-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 600;
}

.kpi-ok .kpi-value { color: var(--success); }
.kpi-warn .kpi-value { color: var(--warn); }
.kpi-danger .kpi-value { color: var(--danger); }
.kpi-muted .kpi-value { color: var(--ink-muted); }

.admin-panel-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.admin-toolbar {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-hairline);
    background: #fff;
    color: var(--ink-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    background: var(--bg-subtle);
}

.filter-tab.active {
    background: var(--ink-primary);
    border-color: var(--ink-primary);
    color: #fff;
}

.tab-count {
    font-size: 0.74rem;
    padding: 0.08rem 0.45rem;
    border-radius: var(--radius-pill);
    background: rgba(24, 39, 33, 0.08);
}

.filter-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.2);
}

.admin-search {
    max-width: 300px;
}

.bulk-action-bar {
    padding: 0.75rem 1.25rem;
    background: var(--bg-tint);
    border-bottom: 1px solid rgba(36, 92, 68, 0.16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.88rem;
}

.bulk-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
    background: #faf9f6;
    border-bottom: 1px solid var(--border-hairline);
}

.admin-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-hairline);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr.row-flagged {
    background: rgba(253, 236, 236, 0.55);
}

.admin-table tr.row-hidden {
    opacity: 0.68;
}

.col-check {
    width: 42px;
}

.col-actions {
    text-align: right;
}

.nowrap {
    white-space: nowrap;
}

.table-person-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 220px;
    max-width: 340px;
}

.mini-avatar {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand-primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.table-person-name {
    font-weight: 700;
    color: var(--ink-primary);
}

.table-person-desc {
    font-size: 0.79rem;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.status-cell-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}

.status-pill {
    display: inline-flex;
    padding: 0.22rem 0.62rem;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-approved { background: var(--success-soft); color: var(--success); }
.status-unverified { background: var(--warn-soft); color: var(--warn); }
.status-pending { background: #e8eef9; color: #2b5499; }
.status-hidden { background: var(--bg-subtle); color: var(--ink-muted); }

.flag-chip {
    display: inline-block;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.16rem 0.5rem;
    border-radius: 8px;
    background: var(--danger-soft);
    color: var(--danger);
}

.meta-cell small {
    color: var(--ink-muted);
    font-size: 0.75rem;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.action-chip {
    padding: 0.34rem 0.68rem;
    border-radius: 9px;
    border: 1px solid var(--border-hairline);
    background: #fff;
    color: var(--ink-primary);
    font-family: inherit;
    font-size: 0.77rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-chip:hover {
    background: var(--bg-subtle);
}

.action-approve {
    border-color: rgba(31, 110, 73, 0.25);
    color: var(--success);
    background: var(--success-soft);
}

.action-approve:hover {
    background: var(--success);
    color: #fff;
}

.action-delete {
    border-color: rgba(184, 59, 59, 0.25);
    color: var(--danger);
    background: var(--danger-soft);
}

.action-delete:hover {
    background: var(--danger);
    color: #fff;
}

.admin-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--ink-muted);
}

/* ---------- Settings Card ---------- */

.settings-card {
    padding: 1.5rem;
}

.settings-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
}

.settings-header p {
    margin: 0.3rem 0 1.25rem;
    font-size: 0.9rem;
    color: var(--ink-secondary);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.95rem 1.05rem;
    border-radius: 14px;
    border: 1px solid var(--border-hairline);
    background: #faf9f6;
    cursor: pointer;
}

.toggle-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--brand-primary);
    flex-shrink: 0;
}

.toggle-row strong {
    display: block;
    font-size: 0.9rem;
}

.toggle-row span {
    display: block;
    font-size: 0.81rem;
    color: var(--ink-secondary);
    margin-top: 0.15rem;
}

.compact-toggle {
    margin-bottom: 1rem;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
}

/* ---------- Loading, Empty & Error States ---------- */

.loading-stage {
    padding: 5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--ink-muted);
}

.loading-stage.compact {
    padding: 3rem 1.5rem;
}

.spinner-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--brand-soft);
    border-top-color: var(--brand-primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.db-error-card,
.empty-tree-card,
.empty-card {
    max-width: 540px;
    margin: 2rem auto;
    padding: 2.2rem;
    text-align: center;
    background: #fff;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.db-error-hint {
    margin: 1rem 0 1.3rem;
}

.db-error-hint code {
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    background: var(--ink-primary);
    color: #dff1e7;
    font-size: 0.9rem;
}

.empty-page {
    padding: 4rem 1.5rem;
}

.empty-code {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 600;
    color: var(--brand-primary);
}

/* ---------- Footer ---------- */

.app-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-hairline);
    background: rgba(255, 255, 255, 0.55);
}

.footer-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 1.3rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink-primary);
}

.brand-leaf {
    color: var(--brand-primary);
    display: inline-flex;
}

.footer-note {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ink-muted);
}

/* ---------- Animations ---------- */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    .hero-section {
        padding: 2.6rem 1rem 1.6rem;
    }

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

    .drawer-facts-grid {
        grid-template-columns: 1fr;
    }

    .tree-hint {
        display: none;
    }

    .brand-sub {
        display: none;
    }
}
