/* =========================================================================
   GENORA — design system "Heritage Modern"
   Dark warm ink + cream + gold accent, editorial serif + clean sans.
   Single source of truth for the entire application.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------- */
:root {
    /* Inks (background hierarchy) */
    --ink-0: #0A0C11;       /* deepest, page bg */
    --ink-1: #11141B;       /* default surface */
    --ink-2: #181C25;       /* elevated panel */
    --ink-3: #232834;       /* interactive surface */
    --ink-4: #2D3340;       /* hover state */
    --ink-5: #3A4151;       /* border-strong */

    /* Hairlines */
    --line-1: rgba(244, 234, 210, 0.06);
    --line-2: rgba(244, 234, 210, 0.10);
    --line-3: rgba(244, 234, 210, 0.16);

    /* Text on dark */
    --text-1: #F4EEDF;      /* primary, warm cream */
    --text-2: #B7B0A0;      /* secondary */
    --text-3: #7A7567;      /* tertiary */
    --text-4: #4F4B41;      /* disabled */

    /* Paper (cream, optional light surfaces) */
    --paper-0: #F8F2E4;
    --paper-1: #EFE8D6;
    --paper-2: #E0D6BD;
    --ink-on-paper: #1A1810;

    /* Gold accent — heritage, lineage, value */
    --gold-1: #D4A958;
    --gold-2: #E5C78A;
    --gold-3: #B68936;
    --gold-soft: rgba(212, 169, 88, 0.14);
    --gold-glow: 0 0 0 1px rgba(212, 169, 88, 0.28),
                 0 8px 32px rgba(212, 169, 88, 0.18);

    /* Functional accents */
    --moss: #6B9080;
    --moss-soft: rgba(107, 144, 128, 0.16);
    --rose: #C56F58;
    --rose-soft: rgba(197, 111, 88, 0.14);
    --ash: #5C6573;

    /* Semantic aliases */
    --bg: var(--ink-0);
    --bg-1: var(--ink-1);
    --bg-2: var(--ink-2);
    --bg-3: var(--ink-3);
    --bg-4: var(--ink-4);
    --border: var(--line-2);
    --border-strong: var(--line-3);
    --text: var(--text-1);
    --text-muted: var(--text-2);
    --text-faint: var(--text-3);
    --accent: var(--gold-1);
    --accent-hover: var(--gold-2);
    --accent-press: var(--gold-3);

    /* Typography */
    --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'JetBrains Mono', SFMono-Regular, Consolas, monospace;

    /* Spacing scale (4pt) */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-7: 32px;
    --s-8: 40px;
    --s-9: 48px;
    --s-10: 56px;
    --s-12: 64px;
    --s-14: 80px;
    --s-16: 96px;
    --s-20: 128px;

    /* Radii */
    --r-1: 4px;
    --r-2: 8px;
    --r-3: 12px;
    --r-4: 16px;
    --r-5: 24px;
    --r-pill: 999px;

    /* Elevations */
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.32),
                inset 0 1px 0 var(--line-2);
    --shadow-3: 0 18px 48px rgba(0, 0, 0, 0.45),
                inset 0 1px 0 var(--line-2);
    --shadow-card: 0 1px 0 var(--line-2),
                   0 8px 32px rgba(0, 0, 0, 0.30);

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-soft: cubic-bezier(0.6, 0, 0.4, 1);
    --t-fast: 140ms;
    --t-base: 240ms;
    --t-slow: 420ms;

    /* Layout */
    --container: 1280px;
    --container-narrow: 920px;
}

/* -------------------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(1200px 600px at 12% -10%, rgba(212, 169, 88, 0.06), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(107, 144, 128, 0.05), transparent 65%),
        linear-gradient(180deg, var(--ink-0), var(--ink-1) 60%, var(--ink-0));
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
    overflow-x: hidden;
}

img,
picture,
svg,
video {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--t-fast) var(--ease-out);
}

a:hover {
    color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--ink-0), 0 0 0 4px var(--accent);
    border-radius: var(--r-2);
}

::selection {
    background: rgba(212, 169, 88, 0.35);
    color: var(--text-1);
}

/* Subtle paper grain on the body for warmth */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.92 0 0 0 0 0.85 0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    mix-blend-mode: overlay;
}

/* -------------------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-1);
}

h1 {
    font-size: clamp(2.4rem, 4vw + 1rem, 4.4rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.02;
}

h2 {
    font-size: clamp(1.6rem, 1.5vw + 1rem, 2.4rem);
    letter-spacing: -0.025em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
}

p {
    color: var(--text-2);
    line-height: 1.65;
}

strong {
    color: var(--text-1);
    font-weight: 600;
}

small {
    font-size: 0.8125rem;
    color: var(--text-3);
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    color: var(--text-1);
    background: var(--ink-3);
    padding: 2px 6px;
    border-radius: var(--r-1);
    border: 1px solid var(--line-1);
}

/* Display utility — very large editorial serif */
.display {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 0.96;
    font-size: clamp(3rem, 6vw + 1rem, 6rem);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 6px 12px;
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-pill);
    background: rgba(212, 169, 88, 0.06);
    backdrop-filter: blur(8px);
}

.eyebrow::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(212, 169, 88, 0.6);
}

.text-link {
    color: var(--accent);
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color var(--t-fast) var(--ease-out);
}

.text-link:hover {
    color: var(--accent-hover);
    border-bottom-color: currentColor;
}

.text-muted {
    color: var(--text-3);
}

/* -------------------------------------------------------------------------
   4. Layout shell
   ------------------------------------------------------------------------- */
.site-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-content {
    flex: 1;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-9) var(--s-7) var(--s-14);
    display: flex;
    flex-direction: column;
    gap: var(--s-9);
}

.landing-body .page-content {
    max-width: var(--container);
    padding-top: var(--s-7);
    gap: var(--s-14);
}

@media (max-width: 768px) {
    .page-content {
        padding: var(--s-7) var(--s-5) var(--s-12);
        gap: var(--s-7);
    }
}

/* -------------------------------------------------------------------------
   5. Header & navigation
   ------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 12, 17, 0.72);
    backdrop-filter: saturate(140%) blur(18px);
    -webkit-backdrop-filter: saturate(140%) blur(18px);
    border-bottom: 1px solid var(--line-1);
}

.site-header__inner {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-3) var(--s-6);
    /* Flex au lieu d'un grid 3-col : permet au .site-nav de "vivre" avec
       margin: auto pour rester centré tout en se laissant pousser quand
       les côtés sont serrés. Avec un grid `auto 1fr auto`, la nav avait
       une nature plus large que sa colonne 1fr et débordait sur la
       marque à viewport ≤ 1280px. */
    display: flex;
    align-items: center;
    gap: var(--s-4);
    /* min-width: 0 sur les enfants pour que le .site-nav pill puisse être
       contraint et ellipsiser plutôt que pousser la marque hors champ. */
    flex-wrap: nowrap;
}

.site-header__inner > .brand {
    flex: 0 0 auto;
}

.site-header__inner > .site-nav {
    /* Pousse à gauche par margin-left:auto ; le margin-right: auto le
       garde centré entre brand et actions. Les deux auto se partagent
       l'espace disponible — c'est le pattern flex "centré entre frères
       qui se laissent compresser". */
    margin-left: auto;
    margin-right: auto;
    flex: 0 1 auto;
    min-width: 0;
}

.site-header__inner > .site-header__actions {
    flex: 0 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--text-1);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
}

.brand:hover {
    color: var(--text-1);
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: auto;
    color: var(--gold-1);
    transition: transform var(--t-base) var(--ease-out);
    flex-shrink: 0;
}

.brand:hover .brand__mark {
    transform: scale(1.04);
}

.brand__mark svg,
.brand__mark img {
    height: 100%;
    width: auto;
    display: block;
}

.brand__wordmark {
    height: 20px;
    width: auto;
    display: block;
    transition: opacity var(--t-fast) var(--ease-out);
}

.brand:hover .brand__wordmark {
    opacity: 0.9;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    justify-self: center;
    padding: 6px;
    background: var(--ink-2);
    border: 1px solid var(--line-1);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-1);
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
    border-radius: var(--r-pill);
    transition: all var(--t-fast) var(--ease-out);
}

.site-nav a:hover {
    color: var(--text-1);
    background: var(--ink-3);
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    justify-self: end;
}

.site-header__actions > form:not(.header-search) {
    display: contents;
}

.header-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--r-pill);
    border: 1px solid transparent;
    color: var(--text-1);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--t-fast) var(--ease-out),
                border-color var(--t-fast) var(--ease-out);
}

.header-profile:hover {
    background: var(--ink-2);
    border-color: var(--line-2);
}

.header-profile__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.header-profile__avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-3);
    color: var(--text-1);
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
}

.header-search input {
    width: 220px;
    padding: 8px 14px;
    font-size: 0.8125rem;
    color: var(--text-1);
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    transition: border-color var(--t-fast) var(--ease-out),
                width var(--t-base) var(--ease-out);
}

.header-search input::placeholder {
    color: var(--text-3);
}

.header-search input:focus {
    outline: none;
    border-color: var(--gold-soft);
    width: 280px;
    box-shadow: 0 0 0 4px var(--gold-soft);
}

@media (max-width: 1080px) {
    .header-search input { width: 140px; }
    .header-search input:focus { width: 200px; }
}
@media (max-width: 880px) {
    .header-search { display: none; }
}

.site-nav__toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    justify-content: space-between;
    align-self: center;
}

.site-nav__toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-1);
    border-radius: 2px;
    transition: transform var(--t-fast) var(--ease-out),
                opacity var(--t-fast) var(--ease-out);
}

.site-nav__toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav__toggle.is-active span:nth-child(2) { opacity: 0; }
.site-nav__toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
    .site-header__inner {
        /* brand prend l'espace, hamburger + actions à droite — évite que le toggle
           ne déborde sur le wordmark de la marque */
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: var(--s-2);
        padding: var(--s-3) var(--s-4);
    }
    .site-nav__toggle { display: flex; }
    .brand { gap: var(--s-2); min-width: 0; }
    .brand__mark { height: 44px; }
    .brand__wordmark { height: 22px; }
    .site-nav {
        display: none;
        position: fixed;
        top: 78px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: var(--s-4);
        background: rgba(10, 12, 17, 0.97);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--line-2);
        border-radius: 0;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
        z-index: 49;
    }
    .site-nav.is-open {
        display: flex;
    }
    .site-nav a {
        padding: 14px 16px;
        font-size: 1rem;
        text-align: left;
        border-radius: var(--r-2);
        border-bottom: 1px solid var(--line-1);
    }
    .site-nav a:last-child { border-bottom: none; }
}

/* -------------------------------------------------------------------------
   6. Buttons
   ------------------------------------------------------------------------- */
.button {
    --btn-bg: var(--ink-3);
    --btn-fg: var(--text-1);
    --btn-border: var(--line-2);
    --btn-shadow: var(--shadow-1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: 10px 18px;
    min-height: 40px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: var(--r-2);
    box-shadow: var(--btn-shadow);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-out),
                border-color var(--t-fast) var(--ease-out),
                box-shadow var(--t-fast) var(--ease-out),
                color var(--t-fast) var(--ease-out);
}

.button:hover {
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button-primary {
    --btn-bg: linear-gradient(180deg, #E5C78A, #C8A24B);
    --btn-fg: #1A1810;
    --btn-border: rgba(255, 220, 150, 0.5);
    --btn-shadow: 0 1px 0 rgba(255, 240, 200, 0.5) inset,
                  0 8px 24px rgba(212, 169, 88, 0.25),
                  0 1px 2px rgba(0, 0, 0, 0.3);
}

.button-primary:hover {
    --btn-bg: linear-gradient(180deg, #F0D49E, #D4A958);
    --btn-shadow: 0 1px 0 rgba(255, 240, 200, 0.6) inset,
                  0 12px 32px rgba(212, 169, 88, 0.4),
                  0 1px 2px rgba(0, 0, 0, 0.3);
}

.button-secondary {
    --btn-bg: var(--ink-2);
    --btn-fg: var(--text-1);
    --btn-border: var(--line-3);
}

.button-secondary:hover {
    --btn-bg: var(--ink-3);
    --btn-border: var(--ink-5);
}

.button-ghost {
    --btn-bg: transparent;
    --btn-fg: var(--text-2);
    --btn-border: transparent;
    --btn-shadow: none;
}

.button-ghost:hover {
    --btn-fg: var(--text-1);
    --btn-bg: var(--ink-2);
}

.button-danger {
    --btn-bg: rgba(197, 111, 88, 0.10);
    --btn-fg: #E59A85;
    --btn-border: rgba(197, 111, 88, 0.35);
}

.button-danger:hover {
    --btn-bg: rgba(197, 111, 88, 0.18);
    --btn-fg: #F4B6A1;
    --btn-border: rgba(197, 111, 88, 0.55);
}

.button-compact {
    padding: 6px 12px;
    min-height: 32px;
    font-size: 0.8125rem;
}

/* -------------------------------------------------------------------------
   7. Panels & cards
   ------------------------------------------------------------------------- */
.panel {
    position: relative;
    padding: var(--s-7);
    background: linear-gradient(180deg,
                  rgba(244, 234, 210, 0.025),
                  rgba(244, 234, 210, 0.005)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}

.panel--spaced {
    gap: var(--s-5);
}

.panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--line-1);
    /* Indispensable pour que les enfants à largeur dynamique (h2 long, lien)
       puissent ellipsiser proprement plutôt que de pousser hors-carte. */
    min-width: 0;
}

.panel__header > div {
    /* Bloc gauche (eyebrow + h2) : il peut rétrécir à 0 et laisser la
       place au lien "Ouvrir →" sans casser la mise en page. */
    min-width: 0;
    flex: 1 1 auto;
}

.panel__header h2,
.panel__header h3 {
    margin: 0;
    /* Cap visuel : 2 lignes max avec ellipsis pour les noms d'arbres
       très longs ("Famille Randrianarivony Razafimalala"). */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
    line-height: 1.2;
}

.panel__header > a,
.panel__header > .text-link {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Two-column details grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--s-6);
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--s-4);
    padding: 12px 0;
    border-bottom: 1px dashed var(--line-1);
}

.detail-list > div:last-child {
    border-bottom: none;
}

.detail-list dt {
    font-size: 0.8125rem;
    color: var(--text-3);
    font-weight: 500;
}

.detail-list dd {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-1);
    font-weight: 500;
    text-align: right;
}

/* -------------------------------------------------------------------------
   8. Page header
   ------------------------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-7);
    padding-bottom: var(--s-6);
    border-bottom: 1px solid var(--line-1);
}

.page-header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    max-width: 760px;
}

.page-header h1 {
    font-size: clamp(2rem, 2.4vw + 1rem, 3rem);
    margin: 0;
}

.page-header h2 {
    font-size: clamp(1.5rem, 1vw + 1rem, 2rem);
    margin: 0;
}

.page-header p {
    color: var(--text-2);
    font-size: 1rem;
    max-width: 56ch;
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    flex-shrink: 0;
}

.page-header--compact {
    padding-bottom: var(--s-3);
    border-bottom: none;
    align-items: center;
}

.page-header--compact h2 {
    font-size: 1.5rem;
}

@media (max-width: 720px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s-4);
        padding-bottom: var(--s-5);
    }
    .page-header__actions {
        width: 100%;
    }
    .page-header h1 {
        font-size: clamp(1.5rem, 5vw + 0.5rem, 2.2rem);
        line-height: 1.15;
        word-break: break-word;
        hyphens: auto;
    }
    .page-header p {
        font-size: 0.9375rem;
    }
}
@media (max-width: 480px) {
    .page-header h1 { font-size: 1.6rem; }
}

/* Variante page-header utilisée avec une .tree-toolbar juste en dessous :
   on retire la border-bottom et on resserre l'espace pour une transition
   visuelle propre vers la barre d'outils. */
.page-header--with-toolbar {
    border-bottom: none;
    padding-bottom: var(--s-3);
}

/* -------------------------------------------------------------------------
   8b. Tree toolbar (vue switcher + actions + menu owner)
   ------------------------------------------------------------------------- */
.tree-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-3) 0 var(--s-6);
    margin-bottom: var(--s-5);
    border-bottom: 1px solid var(--line-1);
    flex-wrap: wrap;
}

/* Switcher segmenté pour les vues */
.tree-toolbar__views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-1);
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tree-toolbar__views::-webkit-scrollbar { display: none; }

.tree-view-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    transition: all var(--t-fast) var(--ease-out);
}
.tree-view-tab:hover {
    color: var(--text-1);
    background: var(--ink-3);
}
.tree-view-tab.is-active {
    color: var(--ink-1);
    background: var(--gold-1);
    box-shadow: 0 4px 12px rgba(212, 169, 88, 0.3);
}
.tree-view-tab__icon {
    font-size: 0.875rem;
    opacity: 0.8;
    line-height: 1;
}

.tree-toolbar__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    flex-shrink: 0;
}

/* Menu déroulant kebab */
.tree-toolbar__menu {
    position: relative;
}
.tree-toolbar__menu summary {
    list-style: none;
    cursor: pointer;
}
.tree-toolbar__menu summary::-webkit-details-marker { display: none; }
.tree-toolbar__menu summary::marker { content: ''; }

.tree-toolbar__menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    padding: 6px;
    z-index: 50;
    animation: treeMenuSlide 160ms var(--ease-out);
}
@keyframes treeMenuSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tree-toolbar__menu-panel a {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 10px 12px;
    border-radius: var(--r-2);
    color: var(--text-1);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--t-fast) var(--ease-out);
}
.tree-toolbar__menu-panel a:hover {
    background: var(--ink-3);
    color: var(--gold-1);
}
.tree-menu__icon {
    width: 18px;
    text-align: center;
    color: var(--gold-1);
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* Mobile : empile et adapte */
@media (max-width: 720px) {
    .tree-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--s-3);
        padding: var(--s-3) 0 var(--s-5);
    }
    .tree-toolbar__views {
        width: 100%;
        justify-content: flex-start;
    }
    .tree-toolbar__actions {
        width: 100%;
        justify-content: stretch;
    }
    .tree-toolbar__actions > .button-primary {
        flex: 1;
    }
    .tree-toolbar__menu {
        flex-shrink: 0;
    }
    .tree-toolbar__menu-panel {
        right: 0;
        left: auto;
    }
}

/* -------------------------------------------------------------------------
   9. Soft badges & dots
   ------------------------------------------------------------------------- */
.soft-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
    background: var(--ink-3);
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    line-height: 1.4;
}

.soft-badge--verified {
    color: #7AC890;
    background: rgba(120, 200, 140, 0.10);
    border-color: rgba(120, 200, 140, 0.35);
}

.soft-badge--pending {
    color: var(--gold-1);
    background: var(--gold-soft);
    border-color: rgba(212, 169, 88, 0.35);
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ash);
}

.dot-male {
    background: #6BA0CF;
    box-shadow: 0 0 8px rgba(107, 160, 207, 0.4);
}

.dot-female {
    background: #D9849C;
    box-shadow: 0 0 8px rgba(217, 132, 156, 0.4);
}

.dot-unknown {
    background: var(--ash);
}

/* -------------------------------------------------------------------------
   10. Hero section (landing)
   ------------------------------------------------------------------------- */
.hero-section {
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--s-12);
    align-items: center;
    padding: var(--s-12) 0 var(--s-9);
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: -10% -10% auto -10%;
    height: 90%;
    background:
        radial-gradient(60% 60% at 30% 50%, rgba(212, 169, 88, 0.15), transparent 70%),
        radial-gradient(50% 60% at 80% 30%, rgba(107, 144, 128, 0.10), transparent 70%);
    pointer-events: none;
    z-index: -1;
    filter: blur(40px);
}

.hero-section__copy {
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
    align-items: flex-start;
}

.hero-section__copy h1 {
    font-size: clamp(2.6rem, 4.2vw + 1rem, 5rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.hero-section__copy h1 em {
    font-style: italic;
    font-weight: 500;
    color: var(--gold-2);
    background: linear-gradient(180deg, #E5C78A, #D4A958);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section__lead {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text-2);
    max-width: 52ch;
}

.hero-section__actions {
    display: flex;
    gap: var(--s-3);
    flex-wrap: wrap;
    margin-top: var(--s-3);
}

.hero-logo {
    height: 140px;
    width: auto;
    margin-bottom: var(--s-3);
    align-self: flex-start;
    filter: drop-shadow(0 8px 32px rgba(212, 169, 88, 0.25));
}

@media (max-width: 920px) {
    .hero-logo {
        height: 110px;
        align-self: center;
    }
}

/* Demo strip — credentials block on landing */
.demo-strip {
    padding: var(--s-12) var(--s-9);
    background: linear-gradient(135deg,
                  rgba(212, 169, 88, 0.10),
                  rgba(212, 169, 88, 0.02)),
                var(--ink-2);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-5);
    box-shadow: 0 0 0 1px var(--gold-soft) inset,
                0 24px 48px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

.demo-strip::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 60%;
    height: 180%;
    background: radial-gradient(circle, var(--gold-soft), transparent 65%);
    pointer-events: none;
    opacity: 0.7;
}

.demo-strip__inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: var(--s-9);
    align-items: center;
}

.demo-strip__inner > div:first-child {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.demo-strip h2 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 1.6vw + 1rem, 2rem);
    line-height: 1.15;
}

.demo-strip__creds {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding: var(--s-6);
    background: rgba(10, 12, 17, 0.55);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    backdrop-filter: blur(8px);
}

.demo-cred {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--s-4);
    padding: var(--s-3) var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
}

.demo-cred__label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
}

.demo-cred code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.9375rem;
    color: var(--gold-2);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.demo-strip__actions {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-2);
    flex-wrap: wrap;
}

@media (max-width: 880px) {
    .demo-strip {
        padding: var(--s-9) var(--s-6);
    }
    .demo-strip__inner {
        grid-template-columns: 1fr;
    }
}

.hero-section__panel {
    perspective: 1400px;
}

@media (max-width: 920px) {
    .hero-section {
        grid-template-columns: 1fr;
        gap: var(--s-8);
        padding-top: var(--s-7);
    }
    .hero-section__panel {
        order: -1;
    }
}

/* Hero glass card preview */
.glass-card {
    position: relative;
    padding: var(--s-7);
    background: linear-gradient(160deg,
                  rgba(244, 234, 210, 0.06),
                  rgba(244, 234, 210, 0.01) 60%),
                rgba(24, 28, 37, 0.65);
    border: 1px solid var(--line-3);
    border-radius: var(--r-5);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(244, 234, 210, 0.08);
    backdrop-filter: blur(20px);
    transform: rotate3d(1, 0.4, 0, 4deg);
    transition: transform var(--t-slow) var(--ease-out);
}

.glass-card:hover {
    transform: rotate3d(1, 0.4, 0, 0deg);
}

.glass-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding-bottom: var(--s-5);
    margin-bottom: var(--s-6);
    border-bottom: 1px solid var(--line-1);
    color: var(--text-3);
    font-size: 0.8125rem;
}

.family-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-3);
}

.family-preview__row {
    display: flex;
    gap: var(--s-4);
    width: 100%;
    justify-content: center;
}

.family-preview__row--single {
    justify-content: center;
}

.family-preview__connector {
    width: 1px;
    height: var(--s-5);
    background: linear-gradient(180deg, var(--gold-soft), transparent);
}

.family-preview__connector--short {
    height: var(--s-3);
}

.mini-person {
    flex: 1;
    min-width: 0;
    padding: var(--s-3) var(--s-4);
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    transition: border-color var(--t-base) var(--ease-out),
                transform var(--t-base) var(--ease-out);
}

.mini-person:hover {
    border-color: var(--gold-soft);
    transform: translateY(-2px);
}

.mini-person strong {
    font-size: 0.875rem;
    color: var(--text-1);
    font-weight: 600;
}

.mini-person span {
    font-size: 0.75rem;
    color: var(--text-3);
}

.mini-person--accent {
    background: linear-gradient(180deg, rgba(212, 169, 88, 0.08), rgba(212, 169, 88, 0.02));
    border-color: var(--gold-soft);
    box-shadow: var(--gold-glow);
}

.mini-person--accent strong {
    color: var(--gold-2);
}

/* -------------------------------------------------------------------------
   11. Features & sections
   ------------------------------------------------------------------------- */
.section-heading {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    align-items: center;
}

.section-heading h2 {
    font-size: clamp(1.8rem, 2vw + 1rem, 2.6rem);
}

.section-heading p {
    font-size: 1.0625rem;
    color: var(--text-2);
    max-width: 56ch;
}

.feature-section {
    display: flex;
    flex-direction: column;
    gap: var(--s-9);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--s-5);
}

.feature-card {
    position: relative;
    padding: var(--s-7);
    background: linear-gradient(180deg,
                  rgba(244, 234, 210, 0.02),
                  rgba(244, 234, 210, 0)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    transition: border-color var(--t-base) var(--ease-out),
                transform var(--t-base) var(--ease-out),
                box-shadow var(--t-base) var(--ease-out);
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: var(--s-7);
    width: 28px;
    height: 1px;
    background: var(--gold-1);
    transition: width var(--t-base) var(--ease-out);
}

.feature-card:hover {
    border-color: var(--gold-soft);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
                0 0 0 1px var(--gold-soft);
}

.feature-card:hover::before {
    width: 60px;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.375rem;
    margin-bottom: var(--s-3);
    color: var(--text-1);
}

.feature-card p {
    color: var(--text-2);
    font-size: 0.9375rem;
}

.experience-strip {
    padding: var(--s-12) var(--s-9);
    background: linear-gradient(135deg,
                  rgba(212, 169, 88, 0.08),
                  rgba(107, 144, 128, 0.06)),
                var(--ink-2);
    border: 1px solid var(--line-3);
    border-radius: var(--r-5);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-9);
    align-items: center;
    position: relative;
    overflow: hidden;
}

.experience-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(60% 80% at 0% 100%, rgba(212, 169, 88, 0.18), transparent 60%);
    pointer-events: none;
}

.experience-strip > * {
    position: relative;
}

.experience-strip h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 1.8vw + 1rem, 2.4rem);
}

.experience-strip p {
    color: var(--text-2);
    font-size: 1.0625rem;
    line-height: 1.7;
}

@media (max-width: 720px) {
    .experience-strip {
        grid-template-columns: 1fr;
        padding: var(--s-9) var(--s-6);
        gap: var(--s-6);
    }
}

/* -------------------------------------------------------------------------
   12. Stats grid (dashboard)
   ------------------------------------------------------------------------- */
.stat-grid {
    display: grid;
    /* 280px : laisse assez de chasse pour une typo display ~26px sans wrap
       cassé sur des noms longs comme "Randrianarivony Razafimalala". */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--s-5);
}

.stat-card {
    position: relative;
    padding: var(--s-6);
    background: linear-gradient(180deg,
                  rgba(244, 234, 210, 0.025),
                  rgba(244, 234, 210, 0)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    /* min-width: 0 indispensable pour que les enfants en flex column
       respectent l'overflow:hidden + line-clamp. Sans ça, le strong peut
       déborder en largeur au lieu de wrapper. */
    min-width: 0;
    overflow: hidden;
    transition: border-color var(--t-base) var(--ease-out),
                transform var(--t-base) var(--ease-out);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -40%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, var(--gold-soft), transparent 60%);
    opacity: 0;
    transition: opacity var(--t-slow) var(--ease-out);
    pointer-events: none;
}

.stat-card:hover {
    border-color: var(--gold-soft);
    transform: translateY(-2px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card > * {
    position: relative;
}

.stat-card span {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-3);
}

.stat-card strong {
    font-family: var(--font-display);
    /* Tuning final : 1.125rem → 1.375rem (18 → 22px). Les noms malgaches
       longs ("Randrianarivony Razafimalala") tiennent en 2 lignes dans
       une carte de 280px sans déborder, même quand le grid descend à
       sa min-width. */
    font-size: clamp(1.125rem, 0.5vw + 1rem, 1.375rem);
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: -0.01em;
    line-height: 1.25;
    /* break-word + overflow-wrap:anywhere : autorise la coupure en
       milieu de mot quand un nom dépasse la largeur de la carte (cas
       extrême). Sans ça, "Randrianarivony" peut overflow à droite. */
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    /* Cap dur à 2 lignes avec ellipsis. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.stat-card p {
    font-size: 0.8125rem;
    color: var(--text-2);
    line-height: 1.5;
}

/* -------------------------------------------------------------------------
   13. Card grid (trees, persons)
   ------------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--s-5);
}

.tree-card,
.person-card {
    position: relative;
    padding: var(--s-6);
    background: linear-gradient(180deg,
                  rgba(244, 234, 210, 0.025),
                  rgba(244, 234, 210, 0)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    transition: border-color var(--t-base) var(--ease-out),
                transform var(--t-base) var(--ease-out),
                box-shadow var(--t-base) var(--ease-out);
}

.tree-card:hover,
.person-card:hover {
    border-color: var(--gold-soft);
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3),
                0 0 0 1px var(--gold-soft);
}

.tree-card__topline,
.person-card__topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    color: var(--text-3);
    font-size: 0.8125rem;
}

.tree-card h2,
.person-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin: 0;
}

.tree-card > p,
.person-card > p {
    color: var(--text-2);
    font-size: 0.9375rem;
    line-height: 1.55;
    flex: 1;
}

.tree-card__meta,
.person-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-4);
    color: var(--text-3);
    font-size: 0.8125rem;
    padding-top: var(--s-3);
    border-top: 1px dashed var(--line-1);
}

.tree-card__actions {
    display: flex;
    gap: var(--s-3);
    align-items: center;
    margin-top: var(--s-2);
    flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   14. Empty state — invitation discrète à enrichir l'arbre.

   Un état vide n'est pas un cul-de-sac : c'est un appel doux à raconter
   une histoire. La feuille Genora signe la zone, le titre est chaleureux,
   le `prompt` (optionnel) propose une question guidée pour amorcer le
   geste de transmission.
   ------------------------------------------------------------------------- */
.empty-state {
    position: relative;
    padding: var(--s-12) var(--s-7);
    text-align: center;
    background:
        radial-gradient(420px 200px at 50% 0%, rgba(212, 169, 88, 0.06), transparent 70%),
        linear-gradient(180deg,
                  rgba(244, 234, 210, 0.025),
                  rgba(244, 234, 210, 0)),
                var(--ink-2);
    border: 1px dashed var(--line-3);
    border-radius: var(--r-5);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    align-items: center;
    overflow: hidden;
}

.empty-state--whisper {
    padding: var(--s-9) var(--s-6);
    background: linear-gradient(180deg,
                  rgba(244, 234, 210, 0.018),
                  rgba(244, 234, 210, 0)),
                var(--ink-1);
    border-style: dashed;
    border-color: var(--line-2);
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gold-2);
    background: linear-gradient(180deg,
                  rgba(212, 169, 88, 0.12),
                  rgba(212, 169, 88, 0.02));
    border: 1px solid var(--gold-soft);
    border-radius: 50%;
    margin-bottom: var(--s-2);
    box-shadow:
        0 0 0 1px rgba(212, 169, 88, 0.10),
        0 8px 24px rgba(212, 169, 88, 0.10),
        inset 0 1px 0 rgba(255, 220, 160, 0.18);
}

.empty-state__icon svg {
    display: block;
}

.empty-state h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-1);
    margin: 0;
    letter-spacing: -0.018em;
}

.empty-state > p {
    color: var(--text-2);
    max-width: 52ch;
    margin: 0 auto;
    line-height: 1.6;
}

/* Question guidée — lue comme une voix douce qui invite au souvenir. */
.empty-state__prompt {
    position: relative;
    margin: var(--s-3) auto 0;
    padding: var(--s-4) var(--s-6);
    max-width: 56ch;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.0625rem;
    color: var(--text-1);
    background: rgba(212, 169, 88, 0.05);
    border-left: 2px solid var(--gold-1);
    border-radius: 0 var(--r-3) var(--r-3) 0;
    line-height: 1.55;
}

.empty-state__prompt-mark {
    font-family: var(--font-display);
    font-size: 1.5em;
    color: var(--gold-1);
    line-height: 0;
    margin-right: 4px;
    vertical-align: -0.15em;
}

.empty-state__prompt-text {
    color: var(--text-1);
}

.empty-state__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--s-4);
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--s-2);
}

.empty-state__secondary {
    font-size: 0.875rem;
}

/* -------------------------------------------------------------------------
   15. Forms
   ------------------------------------------------------------------------- */
.stack-form {
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-5);
}

.form-grid--triple {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 720px) {
    .form-grid,
    .form-grid--triple {
        grid-template-columns: 1fr;
    }
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.form-field label,
.form-field .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: -0.005em;
}

.form-field label.required::after {
    content: '·';
    margin-left: 6px;
    color: var(--gold-1);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="date"],
.form-field input[type="number"],
.form-field input[type="search"],
.form-field input[type="url"],
.form-field input[type="tel"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--text-1);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
    transition: border-color var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-out),
                box-shadow var(--t-fast) var(--ease-out);
    appearance: none;
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.55;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--text-4);
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
    border-color: var(--line-3);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--gold-1);
    background: var(--ink-2);
    box-shadow: 0 0 0 4px var(--gold-soft);
}

.form-field select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23B7B0A0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-field input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--line-3);
    background: var(--ink-1);
    border-radius: var(--r-1);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out);
    position: relative;
    flex-shrink: 0;
}

.form-field input[type="checkbox"]:checked {
    background: linear-gradient(180deg, #E5C78A, #C8A24B);
    border-color: var(--gold-3);
}

.form-field input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 9px;
    border: solid #1A1810;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ── File input — dark theme adjustments ─────────────────────────── */
.form-field input[type="file"] {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-2);
    background: var(--ink-1);
    border: 1px dashed var(--line-2);
    border-radius: var(--r-2);
    cursor: pointer;
    transition: border-color var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-out);
}

.form-field input[type="file"]:hover {
    border-color: var(--line-3);
    background: var(--ink-2);
}

.form-field input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 6px 12px;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-1);
    background: var(--ink-3);
    border: 1px solid var(--line-3);
    border-radius: var(--r-1);
    cursor: pointer;
    transition: background var(--t-fast) var(--ease-out);
}

.form-field input[type="file"]::file-selector-button:hover {
    background: var(--gold-soft);
    color: var(--gold-1);
}

/* ── Form-field variants ──────────────────────────────────────────── */
.form-field--inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form-field--inline label {
    margin: 0;
    cursor: pointer;
}

/* Help text — Symfony default theme renders <div id="..._help"> with no class */
.form-field [id$="_help"] {
    font-size: 0.75rem;
    color: var(--text-3);
    font-weight: 400;
    margin-top: -2px;
}

/* ── Form actions row (buttons aligned at bottom of form) ─────────── */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: center;
    margin-top: var(--s-2);
}

/* ── Profile identity header (avatar + email/displayName) ────────── */
.profile-identity {
    display: flex;
    gap: var(--s-5);
    align-items: center;
    margin-bottom: var(--s-5);
    padding-bottom: var(--s-5);
    border-bottom: 1px solid var(--line-2);
}

.profile-identity__avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line-2);
    flex: 0 0 auto;
}

.profile-identity__avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-2);
    color: var(--text-3);
    font-family: var(--font-display, var(--font-body));
    font-size: 36px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid var(--line-2);
}

.profile-identity__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.profile-identity__meta strong {
    font-size: 1.0625rem;
    color: var(--text-1);
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .profile-identity {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s-3);
    }
}

/* ── Account link bar (Phase 2 — hub d'identité) ─────────────────── */
.account-link-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--s-3);
    padding: 14px 18px;
    margin: 0 0 var(--s-5);
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
}

.account-link-bar--approved {
    border-color: rgba(120, 200, 140, 0.30);
    background: rgba(120, 200, 140, 0.06);
}

.account-link-bar--pending {
    border-color: rgba(212, 169, 88, 0.35);
    background: rgba(212, 169, 88, 0.06);
}

.account-link-bar__main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.account-link-bar__main strong {
    display: block;
    color: var(--text-1);
    font-size: 0.9375rem;
}

.account-link-bar__main .text-muted {
    font-size: 0.8125rem;
}

.account-link-bar__badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.account-link-bar__badge--verified {
    background: rgba(120, 200, 140, 0.18);
    color: #7AC890;
    border: 1px solid rgba(120, 200, 140, 0.40);
}

.account-link-bar__badge--pending {
    background: var(--gold-soft);
    color: var(--gold-1);
    border: 1px solid rgba(212, 169, 88, 0.40);
}

.account-link-bar__badge--none {
    background: var(--ink-3);
    color: var(--text-3);
    border: 1px solid var(--line-2);
}

.account-link-bar__form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.form-field--inline {
    flex-direction: row;
    align-items: center;
    gap: var(--s-3);
}

.form-field--inline label {
    font-size: 0.9375rem;
    color: var(--text-1);
    font-weight: 500;
    margin: 0;
    cursor: pointer;
}

.form-field .form-help,
.form-field small {
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.4;
}

.form-field ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-field ul li {
    font-size: 0.8125rem;
    color: var(--rose);
    padding: 4px 8px;
    background: var(--rose-soft);
    border-radius: var(--r-1);
    border-left: 2px solid var(--rose);
}

.form-actions {
    display: flex;
    gap: var(--s-3);
    align-items: center;
    flex-wrap: wrap;
    padding-top: var(--s-5);
    border-top: 1px solid var(--line-2);
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    padding-bottom: var(--s-5);
    border-bottom: 1px dashed var(--line-1);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section__title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--gold-2);
    margin: 0;
}

.form-current-photo {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: var(--s-3);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
}

.form-current-photo img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--gold-soft);
}

.form-current-photo small {
    color: var(--text-3);
    font-size: 0.8125rem;
}

/* -------------------------------------------------------------------------
   16. Auth pages
   ------------------------------------------------------------------------- */
.auth-shell {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-9) var(--s-5);
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: var(--s-12) var(--s-9);
    background: linear-gradient(180deg,
                  rgba(244, 234, 210, 0.04),
                  rgba(244, 234, 210, 0.005)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-5);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45),
                inset 0 1px 0 var(--line-2);
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-1), transparent);
}

.auth-card h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem);
    color: var(--text-1);
    margin: 0;
}

.auth-card > p {
    color: var(--text-2);
    font-size: 0.9375rem;
}

.auth-card .stack-form {
    margin-top: var(--s-3);
}

.auth-card .button {
    width: 100%;
    margin-top: var(--s-3);
}

.auth-footer {
    margin-top: var(--s-3);
    text-align: center;
    color: var(--text-2);
    font-size: 0.875rem;
    padding-top: var(--s-5);
    border-top: 1px solid var(--line-1);
}

/* OAuth social login buttons + divider */
.oauth-stack {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-top: var(--s-2);
}

.oauth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    padding: 12px 18px;
    min-height: 46px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--r-2);
    border: 1px solid var(--line-3);
    background: var(--ink-1);
    color: var(--text-1);
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-out),
                border-color var(--t-fast) var(--ease-out);
}

.oauth-button:hover {
    transform: translateY(-1px);
    background: var(--ink-2);
    border-color: var(--ink-5);
    color: var(--text-1);
}

.oauth-button svg {
    flex-shrink: 0;
}

.oauth-button--facebook {
    background: #1877F2;
    border-color: #1877F2;
    color: #fff;
}

.oauth-button--facebook:hover {
    background: #1666D4;
    border-color: #1666D4;
    color: #fff;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--text-3);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: var(--s-2) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line-2);
}

/* -------------------------------------------------------------------------
   17. Flash messages
   ------------------------------------------------------------------------- */
.flash-stack {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin-bottom: var(--s-6);
}

.flash {
    padding: 14px 18px;
    border-radius: var(--r-2);
    border: 1px solid var(--line-2);
    background: var(--ink-2);
    color: var(--text-1);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    box-shadow: var(--shadow-1);
    animation: flash-in var(--t-slow) var(--ease-out);
}

.flash::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.flash-success {
    color: #9CCFB8;
    background: rgba(107, 144, 128, 0.12);
    border-color: rgba(107, 144, 128, 0.4);
}

.flash-danger,
.flash-error {
    color: #E59A85;
    background: rgba(197, 111, 88, 0.12);
    border-color: rgba(197, 111, 88, 0.4);
}

.flash-warning {
    color: var(--gold-2);
    background: var(--gold-soft);
    border-color: rgba(212, 169, 88, 0.35);
}

.flash-info {
    color: #B7BCC9;
    background: rgba(92, 101, 115, 0.16);
    border-color: rgba(92, 101, 115, 0.4);
}

@keyframes flash-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------------------------------------------------------------
   18. Share box, copy feedback
   ------------------------------------------------------------------------- */
.share-box {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
    flex-wrap: wrap;
}

.share-box code {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.8125rem;
    color: var(--text-2);
    word-break: break-all;
    font-family: var(--font-mono);
}

.copy-feedback {
    font-size: 0.75rem;
    color: var(--moss);
    font-weight: 600;
    transition: opacity var(--t-fast) var(--ease-out);
}

.copy-feedback:empty {
    opacity: 0;
}

/* -------------------------------------------------------------------------
   19. Invitations
   ------------------------------------------------------------------------- */
.invitation-list {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.invitation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-5);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
    transition: border-color var(--t-base) var(--ease-out);
}

.invitation-item:hover {
    border-color: var(--gold-soft);
}

.invitation-item > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.invitation-item strong {
    color: var(--text-1);
    font-size: 0.9375rem;
}

.invitation-item p {
    font-size: 0.8125rem;
    color: var(--text-3);
    margin: 0;
}

.invitation-item__actions {
    display: flex;
    gap: var(--s-3);
    align-items: center;
}

/* -------------------------------------------------------------------------
   20. Danger zone
   ------------------------------------------------------------------------- */
.danger-zone {
    padding: var(--s-7);
    background: linear-gradient(180deg,
                  rgba(197, 111, 88, 0.06),
                  rgba(197, 111, 88, 0.01));
    border: 1px solid rgba(197, 111, 88, 0.25);
    border-radius: var(--r-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    align-items: flex-start;
    position: relative;
}

.danger-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--rose);
    border-radius: var(--r-4) 0 0 var(--r-4);
    opacity: 0.5;
}

.danger-zone h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--rose);
    margin: 0;
}

.danger-zone p {
    color: var(--text-2);
    font-size: 0.9375rem;
}

/* -------------------------------------------------------------------------
   21. Tables
   ------------------------------------------------------------------------- */
.table-panel {
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table thead th {
    text-align: left;
    padding: var(--s-4) var(--s-5);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
    background: var(--ink-3);
    border-bottom: 1px solid var(--line-2);
}

.data-table tbody td {
    padding: var(--s-4) var(--s-5);
    color: var(--text-2);
    border-bottom: 1px solid var(--line-1);
    vertical-align: middle;
}

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

.data-table tbody tr {
    transition: background var(--t-fast) var(--ease-out);
}

.data-table tbody tr:hover {
    background: rgba(244, 234, 210, 0.025);
}

.data-table tbody td strong {
    color: var(--text-1);
    font-weight: 600;
}

.data-table tbody td > div {
    font-size: 0.8125rem;
    color: var(--text-3);
    margin-top: 2px;
}

/* -------------------------------------------------------------------------
   22. Notes box
   ------------------------------------------------------------------------- */
.notes-box {
    margin-top: var(--s-4);
    padding: var(--s-5);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-left: 3px solid var(--gold-1);
    border-radius: var(--r-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.notes-box h3 {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    color: var(--gold-2);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    margin: 0;
}

.notes-box p {
    color: var(--text-2);
    font-size: 0.9375rem;
    line-height: 1.6;
    font-style: italic;
}

/* -------------------------------------------------------------------------
   23. Tree visualization
   ------------------------------------------------------------------------- */
.tree-visual {
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
    padding: var(--s-5);
    background: linear-gradient(180deg,
                  rgba(244, 234, 210, 0.02),
                  rgba(244, 234, 210, 0)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
}

.tree-visual__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-5);
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--line-1);
}

.tree-visual__stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
}

.tree-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 16px;
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
    min-width: 88px;
}

.tree-stat strong {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-1);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
}

.tree-stat span {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}

.tree-visual__actions {
    display: flex;
    gap: var(--s-5);
    align-items: center;
    flex-wrap: wrap;
}

.tree-legend {
    display: flex;
    gap: var(--s-4);
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-3);
}

.tree-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tree-legend__line {
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--gold-1);
    border-radius: 2px;
}

.tree-legend__line--spouse {
    background: linear-gradient(90deg, var(--gold-1) 50%, transparent 50%);
    background-size: 4px 100%;
}

.tree-visual__buttons {
    display: flex;
    gap: var(--s-2);
}

.tree-filter-group {
    display: inline-flex;
    padding: 4px;
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
}

.tree-filter-btn {
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-3);
    background: transparent;
    border: none;
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out);
}

.tree-filter-btn:hover {
    color: var(--text-1);
}

.tree-filter-btn.is-active {
    background: var(--gold-1);
    color: var(--ink-on-paper);
}

.is-hidden-by-filter {
    display: none !important;
}

.tree-visual__canvas {
    position: relative;
    overflow: auto;
    max-height: 70vh;
    border-radius: var(--r-3);
    background:
        radial-gradient(circle at 20% 20%, rgba(212, 169, 88, 0.04), transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(107, 144, 128, 0.03), transparent 60%),
        var(--ink-1);
    border: 1px solid var(--line-1);
}

.tree-visual__canvas::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.tree-visual__canvas::-webkit-scrollbar-track {
    background: var(--ink-1);
}

.tree-visual__canvas::-webkit-scrollbar-thumb {
    background: var(--ink-4);
    border-radius: 6px;
    border: 2px solid var(--ink-1);
}

.tree-visual__scene {
    position: relative;
    min-width: 100%;
    padding: var(--s-7);
    display: flex;
    flex-direction: column;
    gap: var(--s-9);
}

.tree-visual__svg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.tree-visual__lanes {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--s-12);
}

.tree-lane {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}

.tree-lane__header {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding-bottom: var(--s-3);
    border-bottom: 1px dashed var(--line-2);
}

.tree-lane__header strong {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-2);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.tree-lane__grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-7);
    justify-content: center;
}

.tree-couple-group {
    display: flex;
    gap: var(--s-3);
    align-items: stretch;
}

.person-node {
    width: 240px;
    padding: var(--s-4);
    background: linear-gradient(180deg,
                  rgba(244, 234, 210, 0.04),
                  rgba(244, 234, 210, 0)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    position: relative;
    transition: border-color var(--t-base) var(--ease-out),
                transform var(--t-base) var(--ease-out);
}

.person-node:hover {
    border-color: var(--gold-soft);
    transform: translateY(-2px);
    z-index: 2;
}

.person-node--male {
    border-top: 2px solid #6BA0CF;
}

.person-node--female {
    border-top: 2px solid #D9849C;
}

.person-node--unknown {
    border-top: 2px solid var(--ash);
}

.person-node__topline {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.person-node__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--gold-2), var(--gold-3));
    color: var(--ink-on-paper);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 8px rgba(212, 169, 88, 0.3);
    flex-shrink: 0;
    overflow: hidden;
}

.person-node__avatar--photo {
    background: var(--ink-3);
    box-shadow: 0 0 0 1px var(--gold-soft), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.person-node__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.person-node__identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.person-node__life {
    font-size: 0.75rem;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.person-node__role {
    font-size: 0.6875rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.person-node h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin: 0;
    color: var(--text-1);
    line-height: 1.2;
}

.person-node > p {
    font-size: 0.8125rem;
    color: var(--text-2);
    margin: 0;
}

.person-node__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.person-chip {
    font-size: 0.6875rem;
    padding: 3px 8px;
    background: var(--ink-3);
    border: 1px solid var(--line-1);
    border-radius: var(--r-pill);
    color: var(--text-3);
}

.person-chip--spouse {
    color: var(--gold-2);
    background: var(--gold-soft);
    border-color: rgba(212, 169, 88, 0.25);
}

.person-node__meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-2);
    margin: 0;
    padding-top: var(--s-3);
    border-top: 1px dashed var(--line-1);
}

.person-node__meta div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.person-node__meta dt {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    font-weight: 600;
}

.person-node__meta dd {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-1);
}

.person-node .text-link {
    align-self: flex-start;
    font-size: 0.8125rem;
}

/* Surnom (italique doré, comme dans la vue spatiale) */
.person-node__nickname {
    color: var(--gold-1);
    font-style: italic;
    font-size: 0.875rem;
    margin: -2px 0 6px !important;
}

/* Distinction vivant / décédé — tons or atténués (le rose code le féminin, pas le décès) */
.person-node.is-deceased {
    opacity: 0.92;
    border-color: rgba(212, 169, 88, 0.12);
}
.person-node.is-deceased h3 {
    color: var(--text-2);
}
.person-node.is-deceased .person-node__life {
    color: rgba(212, 169, 88, 0.7);
}
.person-node.is-deceased .person-node__life::before {
    content: '† ';
    color: rgba(212, 169, 88, 0.85);
    font-weight: 600;
}
/* Avatar décédé sans photo : fond SOMBRE + initiales or (sinon or sur or = invisible) */
.person-node.is-deceased .person-node__avatar:not(.person-node__avatar--photo) {
    background: var(--ink-3);
    color: rgba(212, 169, 88, 0.9);
    box-shadow: 0 0 0 1.5px rgba(212, 169, 88, 0.4), 0 2px 8px rgba(0, 0, 0, 0.4);
}
/* Avatar décédé avec photo : désaturation modérée — toujours lisible */
.person-node.is-deceased .person-node__avatar--photo {
    box-shadow: 0 0 0 1.5px rgba(212, 169, 88, 0.4), 0 2px 8px rgba(0, 0, 0, 0.4);
}
.person-node.is-deceased .person-node__avatar img {
    filter: grayscale(0.4) brightness(0.92);
}

/* Footer (Voir la fiche + Éditer) */
.person-node__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-2);
    margin-top: auto;
}
.person-node__quick-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.person-node__quick-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    color: var(--text-2);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out);
    text-decoration: none;
    line-height: 1;
}
.person-node__quick-action:hover {
    color: var(--ink-1);
    background: var(--gold-1);
    border-color: var(--gold-1);
    transform: translateY(-1px);
}

/* Bouton "+ Ajouter un enfant" entre conjoints */
.tree-couple-group--couple {
    position: relative;
}
.tree-couple-add-child {
    flex: 0 0 auto;
    align-self: stretch;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 calc(var(--s-2) * -1);
    padding: var(--s-3) var(--s-4);
    background: transparent;
    border: 1px dashed rgba(212, 169, 88, 0.35);
    border-radius: var(--r-3);
    color: var(--text-3);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out);
    min-width: 64px;
}
.tree-couple-add-child:hover {
    background: var(--gold-1);
    border-color: var(--gold-1);
    border-style: solid;
    color: var(--ink-1);
    transform: scale(1.04);
    box-shadow: 0 8px 20px rgba(212, 169, 88, 0.35);
}
.tree-couple-add-child__icon {
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 600;
    color: var(--gold-1);
    transition: color var(--t-fast) var(--ease-out);
}
.tree-couple-add-child:hover .tree-couple-add-child__icon {
    color: var(--ink-1);
}
/* Variant "ajout conjoint" : pointillé plus marqué (place vide) puis plein au hover */
.tree-couple-add-spouse {
    border-style: dashed;
    border-color: rgba(212, 169, 88, 0.5);
}
.tree-couple-add-spouse:hover {
    border-style: solid;
}
.tree-couple-add-child__label {
    text-align: center;
    line-height: 1.2;
    max-width: 80px;
}
@media (max-width: 720px) {
    .tree-couple-add-child {
        flex-direction: row;
        align-self: center;
        margin: var(--s-2) 0;
    }
    .tree-couple-add-child__icon { font-size: 1.125rem; }
    .tree-couple-add-child__label { max-width: none; }
}

/* SVG link styles */
.tree-link {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tree-link--parent {
    stroke: rgba(212, 169, 88, 0.55);
    stroke-width: 1.5;
}

.tree-link--spouse {
    stroke: rgba(107, 144, 128, 0.6);
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
}

/* -------------------------------------------------------------------------
   24. Footer
   ------------------------------------------------------------------------- */
.site-footer {
    margin-top: var(--s-14);
    border-top: 1px solid var(--line-1);
}

.site-footer__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-6) var(--s-7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
    flex-wrap: wrap;
}

.brand--footer {
    color: var(--text-1);
    align-items: center;
    text-decoration: none;
}

.brand--footer:hover {
    color: var(--text-1);
}

.brand--footer .brand__mark {
    height: 32px;
    width: auto;
    color: var(--gold-1);
}

.brand--footer .brand__wordmark {
    height: 20px;
}

.site-footer small {
    color: var(--text-4);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.site-footer small a {
    color: var(--text-3);
    text-decoration: none;
    transition: color var(--t-fast) var(--ease-out);
}

.site-footer small a:hover {
    color: var(--gold-2);
}

@media (max-width: 540px) {
    .site-footer__inner {
        padding: var(--s-5) var(--s-6);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s-3);
    }
    /* Header très compact : seulement le sceau, plus de wordmark */
    .site-header__inner {
        padding: var(--s-3);
        gap: 6px;
    }
    .brand__wordmark { display: none; }
    .brand__mark { height: 38px; }
    /* Bouton "Créer mon compte" devient compact */
    .site-header__actions .button {
        padding: 8px 12px;
        font-size: 0.8125rem;
        min-height: 36px;
    }
    .site-nav__toggle {
        width: 36px;
        height: 36px;
        padding: 9px;
    }
    /* Logo footer aussi en sceau seul */
    .brand--footer .brand__wordmark { display: none; }
}

/* Encore plus court : on remplace "Créer mon compte" par "S'inscrire" via JS-safe data-attr */
@media (max-width: 400px) {
    .site-header__actions .button-compact-on-mobile {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

/* -------------------------------------------------------------------------
   Focus banner (mode pivot) — affiché au-dessus du canvas/lanes
   ------------------------------------------------------------------------- */
.focus-banner {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: 10px 18px;
    margin-bottom: var(--s-4);
    background: linear-gradient(180deg,
                  rgba(212, 169, 88, 0.08),
                  rgba(212, 169, 88, 0.02)),
                var(--ink-2);
    border: 1px solid rgba(212, 169, 88, 0.25);
    border-radius: var(--r-pill);
    font-size: 0.8125rem;
    color: var(--text-2);
    flex-wrap: wrap;
}

.focus-banner__home,
.focus-banner__up {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    color: var(--text-2);
    background: var(--ink-3);
    border: 1px solid var(--line-2);
    transition: all var(--t-fast) var(--ease-out);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.focus-banner__home:hover,
.focus-banner__up:hover {
    color: var(--ink-1);
    background: var(--gold-1);
    border-color: var(--gold-1);
    transform: translateY(-1px);
}

.focus-banner__center {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}
.focus-banner__label {
    color: var(--text-3);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.focus-banner__center strong {
    color: var(--gold-1);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.focus-banner__right {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
}

.focus-banner__stats {
    color: var(--text-3);
    font-size: 0.75rem;
    white-space: nowrap;
}
.focus-banner__stats strong {
    color: var(--text-1);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.focus-banner__hidden {
    color: rgba(212, 169, 88, 0.7);
}

/* Bouton "Copier le lien" + feedback "Lien copié" */
.focus-banner__copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.focus-banner__copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    color: var(--text-2);
    background: var(--ink-3);
    border: 1px solid var(--line-2);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out);
    white-space: nowrap;
}
.focus-banner__copy-btn:hover {
    color: var(--ink-1);
    background: var(--gold-1);
    border-color: var(--gold-1);
    transform: translateY(-1px);
}
.focus-banner__copy-feedback {
    color: var(--gold-1);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    min-width: 0;
    transition: opacity var(--t-fast) var(--ease-out);
}
.focus-banner__copy-feedback:empty {
    opacity: 0;
}

@media (max-width: 720px) {
    .focus-banner {
        padding: 10px 14px;
        gap: var(--s-2);
        border-radius: var(--r-3);
    }
    .focus-banner__center {
        order: 1;
        flex: 1 1 100%;
        justify-content: center;
        padding: 4px 0;
    }
    .focus-banner__home { order: 2; }
    .focus-banner__right { order: 3; flex: 1; justify-content: flex-end; }
}

/* Utilities génériques pour swap responsive */
.show-on-mobile { display: none; }
@media (max-width: 540px) {
    .hide-on-mobile { display: none !important; }
    .show-on-mobile { display: inline; }
}

/* -------------------------------------------------------------------------
   25. Responsive helpers
   ------------------------------------------------------------------------- */
@media (max-width: 720px) {
    .panel {
        padding: var(--s-5);
    }
    .stat-card,
    .feature-card {
        padding: var(--s-5);
    }
    .auth-card {
        padding: var(--s-9) var(--s-6);
    }
    .person-node {
        width: 100%;
        max-width: 320px;
    }
    .tree-couple-group {
        flex-direction: column;
    }
    .data-table {
        font-size: 0.8125rem;
    }
    .data-table thead th,
    .data-table tbody td {
        padding: var(--s-3) var(--s-4);
    }
    .invitation-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .share-box {
        flex-direction: column;
        align-items: stretch;
    }
    /* Demo strip: stack credentials column on mobile */
    .demo-strip__creds {
        padding: var(--s-4);
    }
    /* Person hero: fit tightly on phone */
    .person-hero {
        padding: var(--s-5);
    }
    .person-hero__copy h1 {
        font-size: 1.4rem;
    }
    /* Page header buttons go full-width on small screens */
    .page-header__actions .button {
        width: 100%;
        justify-content: center;
    }
    /* Hero section: stack and reduce logo */
    .hero-section {
        padding: var(--s-5) 0;
    }
    .hero-logo {
        height: 90px;
    }
    /* Footer: stack vertically */
    .site-footer__inner {
        padding: var(--s-5) var(--s-5);
    }
    /* Tables overflow horizontally rather than crushing */
    .table-panel {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    /* Make the eyebrow not overflow */
    .eyebrow {
        font-size: 0.625rem;
        letter-spacing: 0.14em;
    }
    /* Reduce hero h1 even more */
    .hero-section__copy h1 {
        font-size: 2rem;
    }
    /* Compact person cards */
    .person-card,
    .tree-card {
        padding: var(--s-5);
    }
}

/* -------------------------------------------------------------------------
   24d. Timeline (historical events on person page)
   ------------------------------------------------------------------------- */

/* — Couleurs catégories (variables locales pour cohérence dot/légende/bulle) — */
:root {
    --tl-war: #D9849C;
    --tl-politics: #6BA0CF;
    --tl-science: #5A8C7A;
    --tl-culture: var(--gold-1);
    --tl-economy: #B5C49E;
}

/* — Légende — */
.timeline-legend {
    list-style: none;
    padding: 0;
    margin: var(--s-2) 0 var(--s-5);
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    font-size: 0.75rem;
    color: var(--text-3);
    letter-spacing: 0.04em;
}
.timeline-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.timeline-legend__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
}
.timeline-legend__item--war .timeline-legend__dot      { background: var(--tl-war); }
.timeline-legend__item--politics .timeline-legend__dot { background: var(--tl-politics); }
.timeline-legend__item--science .timeline-legend__dot  { background: var(--tl-science); }
.timeline-legend__item--culture .timeline-legend__dot  { background: var(--tl-culture); }
.timeline-legend__item--economy .timeline-legend__dot  { background: var(--tl-economy); }

/* — Container — */
.timeline {
    padding: 80px var(--s-6) 60px;   /* room above for bubbles, below for decade ticks */
    overflow-x: auto;
    overflow-y: visible;
}

/* — Track : ligne fine avec dégradé subtil — */
.timeline__track {
    position: relative;
    height: 2px;
    background: linear-gradient(90deg,
        rgba(212, 169, 88, 0.15),
        rgba(212, 169, 88, 0.55) 50%,
        rgba(212, 169, 88, 0.15));
    border-radius: 2px;
    min-width: 600px;
    margin: 0;
}

/* — Repères décennaux — */
.timeline__decade {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    pointer-events: none;
}
.timeline__decade-tick {
    display: block;
    width: 1px;
    height: 6px;
    background: rgba(212, 169, 88, 0.3);
    margin: 0 auto;
}
.timeline__decade-label {
    display: block;
    margin-top: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    text-align: center;
}

/* — Marqueurs de vie (naissance, décès, aujourd'hui) — */
.timeline__milestone {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}
.timeline__milestone-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ink-1);
    border: 2px solid var(--gold-1);
    color: var(--gold-1);
    font-size: 0.75rem;
    font-weight: bold;
    line-height: 1;
}
.timeline__milestone--birth .timeline__milestone-icon {
    border-color: var(--gold-1);
    background: var(--gold-1);
    color: var(--ink-1);
}
.timeline__milestone--death .timeline__milestone-icon {
    border-color: var(--tl-war);
    color: var(--tl-war);
}
.timeline__milestone--today .timeline__milestone-icon {
    border-color: var(--tl-science);
    color: var(--tl-science);
    animation: tl-pulse 2.4s ease-in-out infinite;
}
@keyframes tl-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(90, 140, 122, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(90, 140, 122, 0); }
}
.timeline__milestone-label {
    position: absolute;
    top: calc(100% + 6px);
    white-space: nowrap;
    font-size: 0.6875rem;
    color: var(--text-2);
    letter-spacing: 0.04em;
    pointer-events: none;
    background: rgba(10, 12, 17, 0.85);
    padding: 2px 8px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-2);
}
.timeline__milestone--birth .timeline__milestone-label { left: 0; transform: none; }
.timeline__milestone--death .timeline__milestone-label,
.timeline__milestone--today .timeline__milestone-label { right: 0; left: auto; transform: none; }

/* — Événements (dot + tige verticale + bulle) — */
.timeline__event {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    cursor: pointer;
    outline: none;
}
.timeline__event:hover,
.timeline__event:focus-visible {
    z-index: 20;
}

/* Tige fine qui part de la ligne et monte vers le dot */
.timeline__stem {
    display: block;
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 18px;
    background: linear-gradient(to top, rgba(212, 169, 88, 0.6), transparent);
    pointer-events: none;
}

.timeline__dot {
    display: block;
    position: relative;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--text-2);
    border: 2px solid var(--ink-2);
    box-shadow: 0 0 0 1px rgba(212, 169, 88, 0.2), 0 2px 6px rgba(0, 0, 0, 0.4);
    margin: -22px auto 0;
    transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.timeline__event:hover .timeline__dot,
.timeline__event:focus-visible .timeline__dot {
    transform: scale(1.4);
    box-shadow: 0 0 0 4px rgba(212, 169, 88, 0.18), 0 4px 12px rgba(0, 0, 0, 0.5);
}
.timeline__event--war .timeline__dot      { background: var(--tl-war); }
.timeline__event--politics .timeline__dot { background: var(--tl-politics); }
.timeline__event--science .timeline__dot  { background: var(--tl-science); }
.timeline__event--culture .timeline__dot  { background: var(--tl-culture); }
.timeline__event--economy .timeline__dot  { background: var(--tl-economy); }

/* — Bulles tooltip — */
.timeline__bubble {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--ink-1);
    border: 1px solid var(--line-3);
    border-radius: var(--r-3);
    padding: 10px 14px;
    min-width: 200px;
    max-width: 260px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
    z-index: 30;
}
.timeline__bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-top-color: var(--line-3);
}
.timeline__bubble::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-1px);
    width: 0;
    height: 0;
    border: 5px solid transparent;
    border-top-color: var(--ink-1);
    z-index: 1;
}
/* Variantes alignement (évite que la bulle dépasse aux extrémités) */
.timeline__event--bubble-left  .timeline__bubble { left: auto; right: -10px; transform: translateY(4px); }
.timeline__event--bubble-left  .timeline__bubble::after,
.timeline__event--bubble-left  .timeline__bubble::before { left: auto; right: 16px; transform: translateY(0); }
.timeline__event--bubble-left  .timeline__bubble::before { transform: translateY(-1px); }

.timeline__event--bubble-right .timeline__bubble { left: -10px; transform: translateY(4px); }
.timeline__event--bubble-right .timeline__bubble::after,
.timeline__event--bubble-right .timeline__bubble::before { left: 16px; transform: translateY(0); }
.timeline__event--bubble-right .timeline__bubble::before { transform: translateY(-1px); }

.timeline__event:hover .timeline__bubble,
.timeline__event:focus-visible .timeline__bubble {
    opacity: 1;
    pointer-events: auto;
}
.timeline__event--bubble-center:hover .timeline__bubble,
.timeline__event--bubble-center:focus-visible .timeline__bubble {
    transform: translateX(-50%) translateY(0);
}
.timeline__event--bubble-left:hover .timeline__bubble,
.timeline__event--bubble-left:focus-visible .timeline__bubble,
.timeline__event--bubble-right:hover .timeline__bubble,
.timeline__event--bubble-right:focus-visible .timeline__bubble {
    transform: translateY(0);
}

.timeline__bubble-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-2);
    margin-bottom: 4px;
}
.timeline__bubble-head strong {
    color: var(--gold-1);
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1;
}
.timeline__bubble-age {
    color: var(--text-3);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--ink-3);
    padding: 2px 8px;
    border-radius: var(--r-pill);
    white-space: nowrap;
}
.timeline__bubble-label {
    display: block;
    color: var(--text-1);
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* Bordure colorée selon catégorie sur la bulle */
.timeline__event--war .timeline__bubble      { border-left: 3px solid var(--tl-war); }
.timeline__event--politics .timeline__bubble { border-left: 3px solid var(--tl-politics); }
.timeline__event--science .timeline__bubble  { border-left: 3px solid var(--tl-science); }
.timeline__event--culture .timeline__bubble  { border-left: 3px solid var(--tl-culture); }
.timeline__event--economy .timeline__bubble  { border-left: 3px solid var(--tl-economy); }

/* -------------------------------------------------------------------------
   24e. Family calendar (dashboard widget)
   ------------------------------------------------------------------------- */
.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.event-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--s-4);
    align-items: center;
    padding: var(--s-3) var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-left: 3px solid var(--gold-1);
    border-radius: var(--r-2);
}

.event-item--memorial {
    border-left-color: var(--ash);
}

.event-item__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    width: 44px;
    flex-shrink: 0;
}

.event-item__date strong {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-1);
}

.event-item__date span {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-3);
    margin-top: 2px;
}

.event-item__body a {
    color: var(--text-1);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
}

.event-item__body a:hover {
    color: var(--gold-2);
}

.event-item__body p {
    font-size: 0.8125rem;
    color: var(--text-2);
    margin: 2px 0 0 0;
}

.event-item__when {
    font-size: 0.8125rem;
    color: var(--text-3);
    text-align: right;
    white-space: nowrap;
}

/* Legal pages (privacy, data-deletion, terms) */
.legal-page {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--s-7);
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
}
.legal-page h1 {
    font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem);
    margin: var(--s-3) 0 var(--s-2);
}
.legal-page h2 {
    font-size: 1.25rem;
    margin: var(--s-7) 0 var(--s-3);
    color: var(--gold-2);
}
.legal-page p, .legal-page li {
    color: var(--text-2);
    line-height: 1.7;
    font-size: 0.9375rem;
}
.legal-page ul, .legal-page ol {
    padding-left: var(--s-6);
    margin: var(--s-3) 0;
}
.legal-page li { margin-bottom: var(--s-2); }
.legal-page__updated {
    font-size: 0.8125rem;
    color: var(--text-3);
    font-style: italic;
    margin-bottom: var(--s-5) !important;
}
.legal-page a { color: var(--gold-2); }
.legal-page code {
    background: var(--ink-3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Audit log badges */
.audit-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-2);
}
.audit-badge--create { color: #9CCFB8; background: rgba(107, 144, 128, 0.16); border-color: rgba(107, 144, 128, 0.4); }
.audit-badge--update { color: var(--gold-2); background: var(--gold-soft); border-color: rgba(212, 169, 88, 0.35); }
.audit-badge--delete { color: #E59A85; background: rgba(197, 111, 88, 0.14); border-color: rgba(197, 111, 88, 0.4); }

/* -------------------------------------------------------------------------
   24c. Bar chart (statistics)
   ------------------------------------------------------------------------- */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: var(--s-3);
    font-size: 0.875rem;
}

.bar-row__label {
    color: var(--text-2);
    font-weight: 500;
}

.bar-row__track {
    height: 14px;
    background: var(--ink-1);
    border-radius: var(--r-pill);
    overflow: hidden;
    border: 1px solid var(--line-1);
}

.bar-row__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-3), var(--gold-1));
    border-radius: var(--r-pill);
    min-width: 4px;
    transition: width var(--t-slow) var(--ease-out);
}

.bar-row__value {
    text-align: right;
    color: var(--text-1);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------
   25a. Access banner (share view) + accent panel (pending requests)
   ------------------------------------------------------------------------- */
.access-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
    padding: var(--s-5) var(--s-7);
    background: linear-gradient(135deg,
                  rgba(212, 169, 88, 0.10),
                  rgba(212, 169, 88, 0.02)),
                var(--ink-2);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-4);
}

.access-banner > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.access-banner strong {
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: var(--gold-2);
    font-weight: 600;
}

.access-banner p {
    color: var(--text-2);
    font-size: 0.9375rem;
    margin: 0;
}

.access-banner__actions {
    display: flex;
    gap: var(--s-3);
    flex-shrink: 0;
}

.access-banner--info {
    background: linear-gradient(135deg,
                  rgba(92, 101, 115, 0.16),
                  rgba(92, 101, 115, 0.04)),
                var(--ink-2);
    border-color: var(--line-3);
}

.access-banner--info strong {
    color: var(--text-1);
}

.access-banner--success {
    background: linear-gradient(135deg,
                  rgba(107, 144, 128, 0.16),
                  rgba(107, 144, 128, 0.04)),
                var(--ink-2);
    border-color: rgba(107, 144, 128, 0.4);
}

.access-banner--success strong {
    color: #9CCFB8;
}

@media (max-width: 720px) {
    .access-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--s-5);
    }
}

.panel--accent {
    border-color: var(--gold-soft);
    background: linear-gradient(180deg,
                  rgba(212, 169, 88, 0.08),
                  rgba(212, 169, 88, 0.01)),
                var(--ink-2);
}

.panel--accent .panel__header h2 {
    color: var(--gold-2);
}

/* -------------------------------------------------------------------------
   25b. Person hero (fiche personne) + social pills
   ------------------------------------------------------------------------- */
.person-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--s-7);
    align-items: center;
    padding: var(--s-7);
    background: linear-gradient(180deg,
                  rgba(244, 234, 210, 0.025),
                  rgba(244, 234, 210, 0)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    box-shadow: var(--shadow-card);
}

.person-hero__avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--gold-2), var(--gold-3));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 0 4px var(--ink-1),
                0 0 0 5px var(--gold-soft),
                0 12px 32px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.person-hero__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.person-hero__initials {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--ink-on-paper);
}

.person-hero__copy {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    min-width: 0;
}

.person-hero__copy h1 {
    margin: 0;
    font-size: clamp(1.6rem, 1.4vw + 1rem, 2.4rem);
    line-height: 1.1;
}

.person-hero__copy p {
    color: var(--text-2);
    font-size: 1rem;
    margin: 0;
}

.person-hero__nickname {
    color: var(--gold-1) !important;
    font-style: italic;
    font-size: 1.05rem !important;
    margin: 4px 0 0 !important;
    letter-spacing: 0.01em;
}

.person-hero__nickname strong {
    font-weight: 600;
    color: var(--gold-1);
}

.person-card__nickname,
.person-node__nickname {
    color: var(--gold-1) !important;
    font-style: italic;
    font-size: 0.85rem !important;
    margin: -2px 0 6px !important;
    letter-spacing: 0.01em;
}

.person-hero__actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .person-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: var(--s-6);
    }
    .person-hero__avatar {
        margin: 0 auto;
        width: 96px;
        height: 96px;
    }
    .person-hero__copy {
        align-items: center;
    }
    .person-hero__actions {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

.social-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    list-style: none;
    padding: 0;
    margin: var(--s-2) 0 0 0;
}

.social-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-1);
    background: var(--ink-3);
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    text-decoration: none;
    transition: all var(--t-fast) var(--ease-out);
}

.social-pill:hover {
    color: var(--text-1);
    border-color: var(--gold-soft);
    background: var(--ink-4);
    transform: translateY(-1px);
}

.social-pill svg {
    flex-shrink: 0;
    transition: color var(--t-fast) var(--ease-out);
}

.social-pill--instagram:hover { color: #E1306C; }
.social-pill--instagram:hover svg { color: #E1306C; }
.social-pill--linkedin:hover { color: #5BA0FF; }
.social-pill--linkedin:hover svg { color: #5BA0FF; }
.social-pill--facebook:hover { color: #6BA0EF; }
.social-pill--facebook:hover svg { color: #6BA0EF; }
.social-pill--twitter:hover { color: #F4EEDF; }
.social-pill--twitter:hover svg { color: #F4EEDF; }
.social-pill--website:hover { color: var(--gold-2); }
.social-pill--website:hover svg { color: var(--gold-2); }

/* -------------------------------------------------------------------------
   26. Print
   ------------------------------------------------------------------------- */
@media print {
    body {
        background: white;
        color: black;
    }
    .site-header,
    .danger-zone,
    .form-actions,
    .page-header__actions,
    .tree-visual__buttons {
        display: none;
    }
}

/* -------------------------------------------------------------------------
   27. Dashboard — moments émotionnels (memory prompt, recents, suggestions)

   Le dashboard n'est plus un simple tableau de bord : c'est l'entrée
   chaleureuse vers la mémoire familiale. La carte "moment de mémoire"
   ouvre la journée par une question douce. Les listes "récemment
   ajoutés" et "à compléter" suggèrent en discrétion les prochains gestes.
   ------------------------------------------------------------------------- */

/* Variante de l'eyebrow pour les contextes déjà "or-fond-or" — on retire
   le fond et la bordure pour qu'il ne soit plus qu'une étiquette flottante. */
.eyebrow--ghost {
    background: transparent;
    border-color: transparent;
    padding: 0;
    color: var(--gold-2);
}
.eyebrow--ghost::before {
    box-shadow: none;
}

/* ── Memory moment — la carte signature du dashboard. ─────────────── */
.memory-moment {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-5);
    padding: var(--s-6) var(--s-7);
    background:
        radial-gradient(640px 200px at 0% 0%, rgba(212, 169, 88, 0.10), transparent 70%),
        linear-gradient(135deg, rgba(212, 169, 88, 0.06), rgba(107, 144, 128, 0.04)),
        var(--ink-2);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-5);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32),
                inset 0 1px 0 rgba(244, 234, 210, 0.06);
    overflow: hidden;
}

.memory-moment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(212, 169, 88, 0.0),
        var(--gold-1) 25%,
        var(--gold-1) 75%,
        rgba(212, 169, 88, 0.0));
}

.memory-moment__leaf {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-1);
    background: linear-gradient(180deg,
        rgba(212, 169, 88, 0.16),
        rgba(212, 169, 88, 0.04));
    border: 1px solid var(--gold-soft);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.20);
}

.memory-moment__body {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    min-width: 0;
}

.memory-moment__question {
    font-family: var(--font-display);
    font-size: clamp(1.125rem, 0.7vw + 1rem, 1.5rem);
    font-style: italic;
    color: var(--text-1);
    line-height: 1.35;
    margin: 0;
    letter-spacing: -0.01em;
}

.memory-moment__hint {
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .memory-moment {
        grid-template-columns: 1fr;
        padding: var(--s-5) var(--s-5);
        gap: var(--s-3);
        text-align: left;
    }
    .memory-moment__leaf {
        width: 44px;
        height: 44px;
    }
    .memory-moment__leaf svg {
        width: 20px;
        height: 20px;
    }
}

/* ── Recently added persons — visages au fil des ajouts. ───────────── */
.recent-list,
.suggestion-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.recent-item__link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-1);
    border-radius: var(--r-3);
    color: var(--text-1);
    text-decoration: none;
    transition: border-color var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-out),
                transform var(--t-fast) var(--ease-out);
}

.recent-item__link:hover {
    color: var(--text-1);
    border-color: var(--gold-soft);
    background: var(--ink-2);
    transform: translateY(-1px);
}

.recent-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--ink-3);
    color: var(--text-1);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 0 0 1px rgba(212, 169, 88, 0.20),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.recent-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-item__avatar--male    { background: linear-gradient(180deg, rgba(122, 179, 229, 0.30), rgba(122, 179, 229, 0.05)); color: #C0DBF1; }
.recent-item__avatar--female  { background: linear-gradient(180deg, rgba(214, 144, 172, 0.30), rgba(214, 144, 172, 0.05)); color: #ECBED0; }
.recent-item__avatar--unknown { background: var(--ink-3); color: var(--text-2); }

.recent-item__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.recent-item__copy strong {
    color: var(--text-1);
    font-size: 0.9375rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-item__copy span {
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-item__chevron {
    color: var(--text-3);
    font-size: 0.875rem;
    transition: transform var(--t-fast) var(--ease-out),
                color var(--t-fast) var(--ease-out);
}
.recent-item__link:hover .recent-item__chevron {
    color: var(--gold-1);
    transform: translateX(2px);
}

/* ── Suggestion list — fiches à compléter, douces et discrètes. ───── */
.suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-1);
    border-radius: var(--r-3);
    transition: border-color var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-out);
}

.suggestion-item:hover {
    border-color: var(--gold-soft);
    background: var(--ink-2);
}

.suggestion-item__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.suggestion-item__main strong {
    color: var(--text-1);
    font-size: 0.9375rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.suggestion-item__main span {
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* -------------------------------------------------------------------------
   28. Person show — souvenirs, liens familiaux, relations.

   La fiche personne devient le territoire de la mémoire : un panneau
   "souvenirs et histoire" mis en avant comme un récit, et une liste de
   liens familiaux cliquable, chaleureuse, pas une dl/dd anonyme.
   ------------------------------------------------------------------------- */
.memory-panel__content {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    color: var(--text-1);
    line-height: 1.75;
    letter-spacing: -0.005em;
    padding: var(--s-3) var(--s-2) 0;
    border-left: 2px solid var(--gold-soft);
    padding-left: var(--s-5);
}

.memory-panel__empty {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    align-items: flex-start;
    padding: var(--s-3) 0 var(--s-1);
}

.memory-panel__prompt {
    position: relative;
    margin: 0;
    padding: var(--s-4) var(--s-6);
    background: rgba(212, 169, 88, 0.05);
    border-left: 2px solid var(--gold-1);
    border-radius: 0 var(--r-3) var(--r-3) 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.0625rem;
    color: var(--text-1);
    line-height: 1.5;
}

.memory-panel__prompt-mark {
    font-family: var(--font-display);
    font-size: 1.4em;
    color: var(--gold-1);
    line-height: 0;
    margin-right: 4px;
    vertical-align: -0.15em;
}

/* Liste des relations familiales — chaque ligne est un pont vers une
   autre fiche, jamais un libellé mort. */
.relations-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.relations-list__item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: var(--s-3);
    align-items: center;
    padding: var(--s-3) var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-1);
    border-radius: var(--r-2);
    transition: border-color var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-out);
}

.relations-list__item:hover {
    border-color: var(--gold-soft);
    background: var(--ink-2);
}

.relations-list__item--spouse {
    border-left: 2px solid var(--gold-1);
}

.relations-list__role {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}

.relations-list__name {
    color: var(--text-1);
    font-weight: 600;
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
    transition: border-color var(--t-fast) var(--ease-out),
                color var(--t-fast) var(--ease-out);
}

.relations-list__name:hover {
    color: var(--gold-2);
    border-bottom-color: currentColor;
}

.relations-list__years {
    font-size: 0.8125rem;
    color: var(--text-3);
    font-feature-settings: 'tnum' 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.relations-list__actions {
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px dashed var(--line-1);
}

@media (max-width: 520px) {
    .relations-list__item {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        row-gap: 2px;
    }
    .relations-list__role {
        grid-column: 1 / -1;
    }
}


/* =============================================================================
   29. BACKOFFICE — poste de pilotage Genora
   ============================================================================= */

.admin-body { background: var(--ink-0); }

.admin-shell {
    display: grid;
    grid-template-columns: 264px 1fr;
    min-height: calc(100vh - 200px);
    gap: 0;
    margin: 0 auto;
    max-width: 1480px;
    padding: 0;
    width: 100%;
}

@media (max-width: 1024px) {
    .admin-shell { grid-template-columns: 1fr; }
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.admin-sidebar {
    background: linear-gradient(180deg, var(--ink-1), var(--ink-0) 60%);
    border-right: 1px solid var(--line-2);
    padding: var(--s-5) var(--s-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
    position: sticky;
    top: 78px;
    align-self: start;
    height: calc(100vh - 78px);
    overflow-y: auto;
}

.admin-sidebar__head {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2) var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line-1);
}

.admin-sidebar__crest {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-1);
    background: linear-gradient(180deg, rgba(212, 169, 88, 0.16), rgba(212, 169, 88, 0.04));
    border: 1px solid var(--gold-soft);
    border-radius: 50%;
    flex-shrink: 0;
}

.admin-sidebar__title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}
.admin-sidebar__overline {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-2);
}
.admin-sidebar__title strong {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    color: var(--text-1);
    letter-spacing: -0.01em;
}

.admin-sidebar__close {
    display: none;
    width: 36px;
    height: 36px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    color: var(--text-1);
}
.admin-sidebar__close span {
    width: 16px;
    height: 1.5px;
    background: currentColor;
    transform-origin: center;
}
.admin-sidebar__close span:first-child { transform: rotate(45deg) translate(2.4px, 2.4px); }
.admin-sidebar__close span:last-child { transform: rotate(-45deg) translate(2.4px, -2.4px); }

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    flex: 1;
    overflow-y: auto;
}

.admin-nav__group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-nav__group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 0 12px 6px;
}

.admin-nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-nav__item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 8px 12px;
    border-radius: var(--r-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: all var(--t-fast) var(--ease-out);
    border: 1px solid transparent;
}
.admin-nav__item:hover {
    color: var(--text-1);
    background: var(--ink-2);
}
.admin-nav__item.is-active {
    color: var(--text-1);
    background: rgba(212, 169, 88, 0.12);
    border-color: var(--gold-soft);
    box-shadow: inset 0 1px 0 rgba(244, 234, 210, 0.06);
}
.admin-nav__icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    color: var(--gold-2);
    opacity: 0.85;
}
.admin-nav__item.is-active .admin-nav__icon { opacity: 1; }

.admin-sidebar__foot {
    border-top: 1px solid var(--line-1);
    padding-top: var(--s-3);
}
.admin-sidebar__exit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--r-2);
    color: var(--text-3);
    font-size: 0.8125rem;
    font-weight: 500;
}
.admin-sidebar__exit:hover { color: var(--gold-2); }

/* ── Mobile trigger ──────────────────────────────────────────────── */
.admin-mobile-trigger {
    display: none;
}

@media (max-width: 1024px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        width: 280px;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform var(--t-base) var(--ease-out);
    }
    .admin-shell--mobile-open .admin-sidebar { transform: translateX(0); }
    .admin-sidebar__close { display: inline-flex; }

    .admin-mobile-trigger {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        bottom: 24px;
        left: 24px;
        z-index: 55;
        padding: 10px 16px;
        background: var(--ink-2);
        border: 1px solid var(--line-3);
        border-radius: var(--r-pill);
        color: var(--text-1);
        font-size: 0.8125rem;
        font-weight: 600;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
        cursor: pointer;
    }
    .admin-mobile-trigger span:not(:last-child) {
        width: 16px;
        height: 1.5px;
        background: currentColor;
        display: block;
    }
    .admin-mobile-trigger span:nth-child(2) { width: 12px; }
    .admin-mobile-trigger span:nth-child(3) { width: 14px; }

    .admin-shell--mobile-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(8, 9, 14, 0.55);
        backdrop-filter: blur(6px);
        z-index: 59;
    }
}

/* ── Content container ──────────────────────────────────────────── */
.admin-content {
    padding: var(--s-7) var(--s-7) var(--s-12);
    display: flex;
    flex-direction: column;
    gap: var(--s-7);
    min-width: 0;
}
@media (max-width: 720px) {
    .admin-content { padding: var(--s-5) var(--s-4) var(--s-12); gap: var(--s-5); }
}

.admin-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-6);
    flex-wrap: wrap;
    padding-bottom: var(--s-5);
    border-bottom: 1px solid var(--line-1);
}
.admin-header h1 {
    font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem);
    margin: 0;
    line-height: 1.15;
}
.admin-header p {
    color: var(--text-2);
    max-width: 64ch;
    margin-top: 8px;
}
.admin-header__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
}

.admin-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-3);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--t-fast) var(--ease-out);
}
.admin-back:hover { color: var(--gold-2); }

.admin-section {
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
}
.admin-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.admin-section__head h2 {
    font-size: 1.5rem;
    margin: 6px 0 0;
}

.eyebrow--alert {
    color: #E59A85;
    background: rgba(197, 111, 88, 0.08);
    border-color: rgba(197, 111, 88, 0.30);
}
.eyebrow--alert::before { background: #E59A85; box-shadow: 0 0 10px rgba(197,111,88,0.5); }

/* ── KPI cards ──────────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--s-4);
}
.kpi-grid--secondary {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.kpi-card {
    position: relative;
    padding: var(--s-5) var(--s-5) var(--s-4);
    background: linear-gradient(180deg, rgba(244, 234, 210, 0.025), rgba(244, 234, 210, 0)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    transition: border-color var(--t-fast) var(--ease-out);
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gold-1);
    opacity: 0.65;
}
.kpi-card--moss::before { background: var(--moss); }
.kpi-card--rose::before { background: var(--rose); }
.kpi-card--soft::before { background: var(--line-3); opacity: 0.6; }
.kpi-card--soft { background: var(--ink-1); }
.kpi-card:hover { border-color: var(--gold-soft); }

.kpi-card__label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-3);
}
.kpi-card__value {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 1.4vw + 1rem, 2.2rem);
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: -0.02em;
    line-height: 1.05;
}
.kpi-card__hint {
    font-size: 0.8125rem;
    color: var(--text-2);
    line-height: 1.5;
    margin: 0;
}
.kpi-card__sparkline {
    margin-top: var(--s-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    color: var(--gold-2);
}
.kpi-card--moss .kpi-card__sparkline { color: var(--moss); }
.kpi-card--rose .kpi-card__sparkline { color: var(--rose); }
.kpi-card__sparkline-caption {
    font-size: 0.6875rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    flex-shrink: 0;
}

.completion-bar {
    margin-top: 6px;
    height: 6px;
    background: var(--ink-3);
    border-radius: 999px;
    overflow: hidden;
}
.completion-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--gold-3), var(--gold-1), var(--gold-2));
    border-radius: 999px;
}

.sparkline { display: block; }

/* ── Two column layout for panels ───────────────────────────────── */
.admin-twocol {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: var(--s-5);
}

.admin-panel {
    padding: var(--s-6);
    background: linear-gradient(180deg, rgba(244, 234, 210, 0.025), rgba(244, 234, 210, 0)),
                var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}
.admin-panel--danger {
    border-color: rgba(197, 111, 88, 0.28);
    background: linear-gradient(180deg, rgba(197, 111, 88, 0.05), rgba(244, 234, 210, 0)), var(--ink-2);
}
.admin-panel--warn {
    border-color: rgba(212, 169, 88, 0.30);
    background: linear-gradient(180deg, rgba(212, 169, 88, 0.05), rgba(244, 234, 210, 0)), var(--ink-2);
}
.admin-panel__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-3);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--line-1);
    flex-wrap: wrap;
}
.admin-panel__head h2 {
    font-size: 1.125rem;
    margin: 4px 0 0;
}

.admin-prose {
    color: var(--text-1);
    line-height: 1.7;
    font-size: 0.9375rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Filters bar ────────────────────────────────────────────────── */
.admin-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, auto));
    gap: var(--s-3);
    align-items: end;
    padding: var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
}
.admin-filters__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.admin-filters__field--grow {
    grid-column: span 2;
}
.admin-filters__field input,
.admin-filters__field select {
    padding: 9px 12px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
    color: var(--text-1);
    font-size: 0.875rem;
}
.admin-filters__field input:focus,
.admin-filters__field select:focus {
    outline: none;
    border-color: var(--gold-1);
    box-shadow: 0 0 0 3px var(--gold-soft);
}
.admin-filters__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
}
.admin-filters .form-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
}
@media (max-width: 720px) {
    .admin-filters { grid-template-columns: 1fr; }
    .admin-filters__field--grow { grid-column: auto; }
}

/* ── Tables ─────────────────────────────────────────────────────── */
.admin-table-wrap {
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
    overflow: hidden;
    background: var(--ink-2);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 720px;
}
.admin-table thead {
    background: var(--ink-1);
}
.admin-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    border-bottom: 1px solid var(--line-2);
}
.admin-table th.admin-table__num { text-align: right; }
.admin-table th.admin-table__action { text-align: right; width: 1%; white-space: nowrap; }
.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-1);
    vertical-align: middle;
    color: var(--text-1);
}
.admin-table td.admin-table__num { text-align: right; font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums; }
.admin-table td.admin-table__action { text-align: right; }
.admin-table tbody tr:hover { background: rgba(212, 169, 88, 0.04); }
.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-cell-identity {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--text-1);
    text-decoration: none;
    min-width: 0;
}
.admin-cell-identity:hover { color: var(--gold-2); }
.admin-cell-avatar,
.admin-cell-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--ink-3);
    color: var(--text-1);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 0 0 1px rgba(212, 169, 88, 0.20);
}
.admin-cell-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-cell-avatar--male    { background: linear-gradient(180deg, rgba(122, 179, 229, 0.30), rgba(122, 179, 229, 0.05)); color: #C0DBF1; }
.admin-cell-avatar--female  { background: linear-gradient(180deg, rgba(214, 144, 172, 0.30), rgba(214, 144, 172, 0.05)); color: #ECBED0; }
.admin-cell-icon {
    color: var(--gold-2);
    background: linear-gradient(180deg, rgba(212, 169, 88, 0.16), rgba(212, 169, 88, 0.04));
}
.admin-cell-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}
.admin-cell-text strong {
    font-size: 0.9375rem;
    color: var(--text-1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-cell-text span {
    font-size: 0.75rem;
    color: var(--text-3);
}

.admin-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--ink-3);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
}
.admin-pill--gold { background: rgba(212, 169, 88, 0.12); border-color: var(--gold-soft); color: var(--gold-2); }
.admin-pill--soft { background: rgba(244, 234, 210, 0.04); border-color: var(--line-1); color: var(--text-3); }
.admin-pill--accent { background: rgba(212, 169, 88, 0.18); border-color: rgba(212, 169, 88, 0.45); color: var(--gold-2); }
.admin-pill--success { background: rgba(120, 200, 140, 0.10); border-color: rgba(120, 200, 140, 0.35); color: #A0DDB5; }
.admin-pill--warn { background: rgba(212, 169, 88, 0.10); border-color: rgba(212, 169, 88, 0.35); color: var(--gold-2); }

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    padding: var(--s-4) 0;
}
.admin-pagination__count {
    font-size: 0.8125rem;
    color: var(--text-3);
    font-feature-settings: 'tnum' 1;
}

/* ── Empty states admin ─────────────────────────────────────────── */
.admin-empty {
    padding: var(--s-9) var(--s-7);
    text-align: center;
    background: linear-gradient(180deg, rgba(244, 234, 210, 0.025), rgba(244, 234, 210, 0)), var(--ink-2);
    border: 1px dashed var(--line-3);
    border-radius: var(--r-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    align-items: center;
}
.admin-empty--soft {
    padding: var(--s-7) var(--s-5);
    background: var(--ink-1);
}
.admin-empty > span[aria-hidden] {
    display: inline-flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    background: rgba(120, 200, 140, 0.10);
    color: #A0DDB5;
    border-radius: 50%;
    font-size: 1.5rem;
    border: 1px solid rgba(120, 200, 140, 0.30);
}
.admin-empty h2 { margin: 0; font-size: 1.25rem; }
.admin-empty p { color: var(--text-2); max-width: 56ch; margin: 0 auto; }

/* ── Detail hero (user/tree/person admin show pages) ────────────── */
.admin-detail-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-5);
    padding: var(--s-6);
    background: linear-gradient(180deg, rgba(244, 234, 210, 0.04), rgba(244, 234, 210, 0)), var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
}
.admin-detail-hero__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--ink-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-1);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--gold-soft);
}
.admin-detail-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-detail-hero__avatar--male    { background: linear-gradient(180deg, rgba(122, 179, 229, 0.30), rgba(122, 179, 229, 0.05)); color: #C0DBF1; }
.admin-detail-hero__avatar--female  { background: linear-gradient(180deg, rgba(214, 144, 172, 0.30), rgba(214, 144, 172, 0.05)); color: #ECBED0; }
.admin-detail-hero__avatar--icon {
    background: linear-gradient(180deg, rgba(212, 169, 88, 0.18), rgba(212, 169, 88, 0.04));
    color: var(--gold-2);
}
.admin-detail-hero__copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.admin-detail-hero__copy h1 { margin: 0; font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem); line-height: 1.1; }
.admin-detail-hero__pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.admin-detail-hero__actions {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    flex-shrink: 0;
}
@media (max-width: 720px) {
    .admin-detail-hero { grid-template-columns: 1fr; text-align: left; }
    .admin-detail-hero__actions { flex-direction: row; flex-wrap: wrap; }
}

/* ── Activity list ──────────────────────────────────────────────── */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.activity-list__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) 0;
    border-bottom: 1px dashed var(--line-1);
}
.activity-list__item:last-child { border-bottom: none; }
.activity-list__dot {
    width: 8px;
    height: 8px;
    background: var(--gold-1);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(212, 169, 88, 0.5);
}
.activity-list__item--update .activity-list__dot { background: #7AB3E5; box-shadow: 0 0 8px rgba(122, 179, 229, 0.5); }
.activity-list__item--delete .activity-list__dot { background: var(--rose); box-shadow: 0 0 8px rgba(197, 111, 88, 0.5); }
.activity-list__body { min-width: 0; }
.activity-list__body strong { display: block; color: var(--text-1); font-size: 0.875rem; }
.activity-list__detail { font-size: 0.8125rem; color: var(--text-3); }
.activity-list__when { font-size: 0.75rem; color: var(--text-3); white-space: nowrap; font-feature-settings: 'tnum' 1; }

/* ── Alert tiles (dashboard) ────────────────────────────────────── */
.alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--s-3);
}
.alert-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--s-4);
    background: linear-gradient(180deg, rgba(212, 169, 88, 0.05), rgba(244, 234, 210, 0)), var(--ink-2);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-3);
    text-decoration: none;
    color: var(--text-1);
    transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.alert-tile:hover { transform: translateY(-2px); border-color: rgba(212, 169, 88, 0.45); color: var(--text-1); }
.alert-tile strong {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold-2);
    line-height: 1;
}
.alert-tile span { font-size: 0.875rem; color: var(--text-1); font-weight: 600; }
.alert-tile em { font-size: 0.8125rem; color: var(--text-3); font-style: normal; }
.alert-tile--warn { border-color: rgba(197, 111, 88, 0.35); background: linear-gradient(180deg, rgba(197, 111, 88, 0.06), rgba(244, 234, 210, 0)), var(--ink-2); }
.alert-tile--warn strong { color: #E59A85; }
.alert-tile--soft { border-color: var(--line-2); background: var(--ink-1); }
.alert-tile--soft strong { color: var(--text-1); }

/* ── Quality / health grids ─────────────────────────────────────── */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--s-3);
}
.health-tile {
    padding: var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-1);
    border-radius: var(--r-3);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.health-tile__label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
}
.health-tile strong {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-1);
}
.health-tile em { font-size: 0.75rem; color: var(--text-3); font-style: normal; }

/* ── Quality tabs ──────────────────────────────────────────────── */
.admin-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    align-self: flex-start;
}
.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--r-pill);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
}
.admin-tab:hover { color: var(--text-1); background: var(--ink-3); }
.admin-tab.is-active { color: var(--ink-1); background: var(--gold-1); }
.admin-tab__badge {
    display: inline-flex;
    padding: 0 7px;
    background: rgba(0, 0, 0, 0.18);
    color: inherit;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.7;
}
.admin-tab.is-active .admin-tab__badge { background: rgba(0, 0, 0, 0.25); }

.quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--s-4);
}
.quality-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--s-5);
    background: linear-gradient(180deg, rgba(212, 169, 88, 0.05), rgba(244, 234, 210, 0)), var(--ink-2);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-4);
    text-decoration: none;
    color: var(--text-1);
    transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.quality-card:hover { transform: translateY(-3px); border-color: rgba(212, 169, 88, 0.5); color: var(--text-1); }
.quality-card__count { font-family: var(--font-display); font-size: 2rem; color: var(--gold-2); line-height: 1; }
.quality-card strong { font-size: 0.9375rem; color: var(--text-1); }
.quality-card p { font-size: 0.875rem; color: var(--text-2); margin: 0; line-height: 1.5; }
.quality-card em { font-size: 0.75rem; color: var(--text-3); font-style: normal; }
.quality-card--warn { border-color: rgba(197, 111, 88, 0.30); background: linear-gradient(180deg, rgba(197, 111, 88, 0.06), rgba(244, 234, 210, 0)), var(--ink-2); }
.quality-card--warn .quality-card__count { color: #E59A85; }
.quality-card--soft { border-color: var(--line-2); background: var(--ink-1); }
.quality-card--soft .quality-card__count { color: var(--text-1); }

.issue-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}
.issue-list__link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-1);
    border-radius: var(--r-3);
    color: var(--text-1);
    text-decoration: none;
}
.issue-list__link:hover { border-color: var(--gold-soft); background: var(--ink-2); }
.issue-list__copy { display: flex; flex-direction: column; min-width: 0; }
.issue-list__copy strong { font-size: 0.9375rem; }
.issue-list__copy span { font-size: 0.8125rem; }
.issue-list__chevron { color: var(--text-3); }
.issue-list__link:hover .issue-list__chevron { color: var(--gold-2); }

/* ── Memory list ───────────────────────────────────────────────── */
.memory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: var(--s-4);
}
.memory-list__item {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding: var(--s-5);
    background: linear-gradient(180deg, rgba(244, 234, 210, 0.025), rgba(244, 234, 210, 0)), var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-4);
    border-left: 3px solid var(--gold-soft);
}
.memory-list__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
}
.memory-list__excerpt {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.9375rem;
    color: var(--text-1);
    line-height: 1.6;
    margin: 0;
}
.memory-list__foot { display: flex; justify-content: flex-end; }

/* ── Action rows (admin show pages) ─────────────────────────────── */
.admin-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
}
.admin-action-row__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-action-row__copy strong { font-size: 0.9375rem; }
.admin-action-row__copy span { font-size: 0.8125rem; }
.admin-action-row--danger {
    border-color: rgba(197, 111, 88, 0.30);
    background: linear-gradient(180deg, rgba(197, 111, 88, 0.04), rgba(244, 234, 210, 0)), var(--ink-1);
    flex-direction: column;
    align-items: stretch;
}
details.admin-action-row { display: block; }
details.admin-action-row > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    list-style: none;
    cursor: pointer;
}
details.admin-action-row > summary::-webkit-details-marker { display: none; }
.admin-confirm-form {
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px dashed var(--line-2);
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    align-items: flex-start;
}
.admin-confirm-form input {
    width: 100%;
    max-width: 400px;
    padding: 9px 12px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
    color: var(--text-1);
    font-size: 0.9375rem;
}

/* ── Issues / success ──────────────────────────────────────────── */
.admin-issues {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-issues li {
    padding: 8px 12px;
    background: rgba(212, 169, 88, 0.06);
    border-left: 2px solid var(--gold-1);
    color: var(--text-1);
    font-size: 0.875rem;
    border-radius: 0 var(--r-2) var(--r-2) 0;
}
.admin-success {
    color: #A0DDB5;
    font-weight: 500;
}

/* ── Rank list (statistics) ────────────────────────────────────── */
.rank-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.rank-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) 0;
    border-bottom: 1px dashed var(--line-1);
}
.rank-list li:last-child { border-bottom: none; }
.rank-list__num {
    font-family: var(--font-display);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-1);
    background: rgba(212, 169, 88, 0.10);
    border: 1px solid var(--gold-soft);
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 600;
    flex-shrink: 0;
}
.rank-list__copy {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-1);
    min-width: 0;
}
.rank-list__copy strong { font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list__copy span { font-size: 0.75rem; }
.rank-list__copy:hover strong { color: var(--gold-2); }
.rank-list__value {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-1);
    font-feature-settings: 'tnum' 1;
}

/* ── Period switcher (statistics) ──────────────────────────────── */
.admin-period {
    display: inline-flex;
    padding: 4px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
}
.admin-period__option {
    padding: 6px 12px;
    border-radius: var(--r-pill);
    font-size: 0.8125rem;
    color: var(--text-2);
    text-decoration: none;
    transition: all var(--t-fast) var(--ease-out);
}
.admin-period__option:hover { color: var(--text-1); background: var(--ink-3); }
.admin-period__option.is-active { color: var(--ink-1); background: var(--gold-1); }

/* ── Cmd list (maintenance) ────────────────────────────────────── */
.admin-cmd-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-cmd-list li {
    padding: 10px 14px;
    background: var(--ink-1);
    border: 1px solid var(--line-1);
    border-radius: var(--r-2);
    color: var(--text-2);
    font-size: 0.875rem;
}
.admin-cmd-list code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--gold-2);
}


/* Discreet admin chip in the public header — visible only to ROLE_ADMIN. */
.site-nav__admin {
    color: var(--gold-2) !important;
    background: rgba(212, 169, 88, 0.10);
    border: 1px solid var(--gold-soft);
}
.site-nav__admin:hover {
    background: rgba(212, 169, 88, 0.20);
    color: var(--gold-1) !important;
}


/* -------------------------------------------------------------------------
   30. Admin — liaison compte ↔ fiche personne (panneau dans /admin/persons/{id})
   ------------------------------------------------------------------------- */
.admin-link-panel {
    border-color: var(--gold-soft);
    background: linear-gradient(180deg, rgba(212, 169, 88, 0.04), rgba(244, 234, 210, 0)), var(--ink-2);
}

.admin-link-current {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
}
.admin-link-current__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.admin-link-current__copy strong { color: var(--text-1); font-size: 0.9375rem; }
.admin-link-current__copy span { font-size: 0.8125rem; }
.admin-link-current__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
}

.admin-link-form {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px dashed var(--line-2);
}
.admin-link-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-link-form__field label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}
.admin-link-form__combobox {
    position: relative;
}
.admin-link-form__combobox input {
    width: 100%;
    padding: 11px 14px;
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
    color: var(--text-1);
    font-size: 0.9375rem;
    transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.admin-link-form__combobox input:focus {
    outline: none;
    border-color: var(--gold-1);
    box-shadow: 0 0 0 3px var(--gold-soft);
}
.admin-link-form__suggestions {
    list-style: none;
    margin: 4px 0 0;
    padding: 4px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 360px;
    overflow-y: auto;
}
.admin-link-form__suggestion {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--s-3);
    padding: 8px 10px;
    border-radius: var(--r-2);
    cursor: pointer;
    transition: background var(--t-fast) var(--ease-out);
}
.admin-link-form__suggestion:hover,
.admin-link-form__suggestion:focus {
    background: rgba(212, 169, 88, 0.10);
    outline: none;
}
.admin-link-form__suggestion-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}
.admin-link-form__suggestion-copy strong { color: var(--text-1); font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-link-form__suggestion-copy span { font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-link-form__actions {
    display: inline-flex;
    align-self: flex-start;
}

@media (max-width: 720px) {
    .admin-link-current { grid-template-columns: auto 1fr; }
    .admin-link-current__actions { grid-column: 1 / -1; }
}


/* -------------------------------------------------------------------------
   31. Person card — version "complète" pour la grille de l'arbre.

   On garde la coque héritée (.person-card du §13) — bordure, padding,
   hover doré — et on ajoute par-dessus une vraie zone d'identité avec
   avatar circulaire, lignes faits clairement libellées, et chips pour
   les marqueurs émotionnels (souvenir, nom de naissance).

   Les classes ici suffisent pour la nouvelle structure ; aucune règle
   du §13 n'est cassée.
   ------------------------------------------------------------------------- */
.person-card__head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--s-3);
    align-items: center;
    padding-bottom: var(--s-3);
    border-bottom: 1px dashed var(--line-1);
}

.person-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--ink-3);
    color: var(--text-1);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.0625rem;
    box-shadow:
        0 0 0 1px rgba(212, 169, 88, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: box-shadow var(--t-base) var(--ease-out);
}
.person-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.person-card__avatar--male    { background: linear-gradient(180deg, rgba(122, 179, 229, 0.30), rgba(122, 179, 229, 0.05)); color: #C0DBF1; }
.person-card__avatar--female  { background: linear-gradient(180deg, rgba(214, 144, 172, 0.30), rgba(214, 144, 172, 0.05)); color: #ECBED0; }
.person-card:hover .person-card__avatar {
    box-shadow:
        0 0 0 1.5px rgba(212, 169, 88, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.person-card__identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* On garde .person-card h3 du §13 mais on assouplit un peu pour cette
   variante : 1.125rem laisse plus de place au reste de la carte. */
.person-card__identity h3 {
    font-size: 1.125rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
    /* line-clamp 2 pour ne pas casser la grille avec un nom très long. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.person-card__years {
    color: var(--text-3);
    font-size: 0.8125rem;
    font-feature-settings: 'tnum' 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.person-card__rest {
    color: var(--text-3);
    font-size: 0.875em;
    margin-left: 2px;
}

.person-card__role {
    color: var(--text-2);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin: 0;
}

/* Liste de faits — chaque ligne a un libellé "key" en uppercase doré
   pour la scannabilité, suivi du contenu en typo normale. */
.person-card__facts {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-2);
    font-size: 0.8125rem;
    line-height: 1.45;
}
.person-card__facts li {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.person-card__fact-key {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-right: 4px;
}
/* Le conjoint mérite un petit accent doré — il symbolise la branche. */
.person-card__fact-spouse .person-card__fact-key { color: var(--gold-2); }

/* Chips en bas de carte — émotionnels et discrets. */
.person-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.person-card__chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: var(--ink-3);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.person-card__chip--memory {
    color: var(--gold-2);
    background: rgba(212, 169, 88, 0.10);
    border-color: var(--gold-soft);
}
.person-card__chip--memory svg {
    color: var(--gold-1);
    flex-shrink: 0;
}

.person-card__actions {
    margin-top: auto;
    padding-top: var(--s-3);
    border-top: 1px dashed var(--line-1);
}

/* Variante défunt — désaturation très subtile + cross gold. */
.person-card--deceased .person-card__avatar img {
    filter: saturate(0.7) brightness(0.96);
}
.person-card--deceased .person-card__rest {
    color: var(--gold-1);
}


/* -------------------------------------------------------------------------
   32. People bar — recherche + tri pour la liste des membres d'un arbre.
   Pensée comme une barre d'outils discrète : le tri se déclenche à la
   sélection (auto-submit), la recherche se valide par Entrée ou bouton.
   ------------------------------------------------------------------------- */
.people-bar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: var(--s-3);
    align-items: center;
    padding: var(--s-3) var(--s-4);
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
}

.people-bar__search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}
.people-bar__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    line-height: 0;
    pointer-events: none;
}
.people-bar__search input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
    color: var(--text-1);
    font-size: 0.9375rem;
    transition: border-color var(--t-fast) var(--ease-out),
                box-shadow var(--t-fast) var(--ease-out);
}
.people-bar__search input::placeholder { color: var(--text-3); }
.people-bar__search input:focus {
    outline: none;
    border-color: var(--gold-1);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.people-bar__sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-3);
    font-size: 0.8125rem;
    white-space: nowrap;
}
.people-bar__sort-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.people-bar__sort select {
    padding: 8px 32px 8px 12px;
    background: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-2);
    color: var(--text-1);
    font-size: 0.875rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23B7B0A0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
}
.people-bar__sort select:focus {
    outline: none;
    border-color: var(--gold-1);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.people-bar__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
}

@media (max-width: 720px) {
    .people-bar {
        grid-template-columns: 1fr;
        gap: var(--s-2);
    }
    .people-bar__sort,
    .people-bar__actions {
        justify-content: space-between;
    }
}


/* -------------------------------------------------------------------------
   33. People directory — /trees/{slug}/people
   Variante riche de la people-bar (4 contrôles au lieu de 2) + table
   visuelle où chaque ligne respire et expose les marqueurs essentiels.
   ------------------------------------------------------------------------- */
.people-bar--rich {
    grid-template-columns: 1fr auto auto auto auto;
}
@media (max-width: 980px) {
    .people-bar--rich {
        grid-template-columns: 1fr 1fr;
    }
    .people-bar--rich .people-bar__search { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .people-bar--rich {
        grid-template-columns: 1fr;
    }
}

/* ── Table "annuaire" ───────────────────────────────────────────────── */
.people-table-wrap {
    border: 1px solid var(--line-2);
    border-radius: var(--r-3);
    background: var(--ink-2);
    overflow: hidden;
    overflow-x: auto;
}

.people-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 760px;
}
.people-table thead {
    background: var(--ink-1);
}
.people-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    border-bottom: 1px solid var(--line-2);
}
.people-table th.people-table__action { width: 1%; white-space: nowrap; }
.people-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-1);
    vertical-align: middle;
    color: var(--text-1);
}
.people-table tbody tr:last-child td { border-bottom: none; }
.people-row:hover td {
    background: rgba(212, 169, 88, 0.04);
}
.people-row--deceased .people-row__avatar img {
    filter: saturate(0.7) brightness(0.96);
}

/* Identité — avatar + colonne de texte multi-lignes */
.people-row__identity {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    color: var(--text-1);
    text-decoration: none;
    min-width: 0;
}
.people-row__identity:hover { color: var(--gold-2); }

.people-row__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--ink-3);
    color: var(--text-1);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 0 0 1px rgba(212, 169, 88, 0.20),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.people-row__avatar img { width: 100%; height: 100%; object-fit: cover; }
.people-row__avatar--male    { background: linear-gradient(180deg, rgba(122, 179, 229, 0.30), rgba(122, 179, 229, 0.05)); color: #C0DBF1; }
.people-row__avatar--female  { background: linear-gradient(180deg, rgba(214, 144, 172, 0.30), rgba(214, 144, 172, 0.05)); color: #ECBED0; }

.people-row__name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.people-row__name strong {
    font-size: 0.9375rem;
    color: var(--text-1);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.people-row__nick {
    color: var(--gold-2);
    font-style: italic;
    font-size: 0.8125rem;
}
.people-row__role,
.people-row__parents {
    font-size: 0.75rem;
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.people-row__parents { font-style: italic; }

/* Vie — dates + lieu en deux lignes */
.people-row__life {
    line-height: 1.3;
    font-feature-settings: 'tnum' 1;
    font-variant-numeric: tabular-nums;
}
.people-row__life strong { color: var(--text-1); font-size: 0.9375rem; font-weight: 600; }
.people-row__life .people-row__place {
    display: block;
    font-size: 0.75rem;
    color: var(--text-3);
    margin-top: 2px;
}
.people-row__rest { color: var(--gold-1); margin-left: 2px; }

.people-row__spouse {
    color: var(--text-2);
    font-size: 0.875rem;
}

/* Colonne « État » — largeur contrainte pour ne pas écarteler la table.
   Le chip s'adapte au contenu, la colonne reste compacte et l'action « Voir → »
   reste à proximité du contenu de la ligne. */
.people-row__chips {
    width: 1%;
    white-space: nowrap;
    text-align: left;
}
.people-row__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--ink-3);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.5;
    cursor: help;
}
.people-row__chip--memory {
    color: var(--gold-2);
    background: rgba(212, 169, 88, 0.10);
    border-color: var(--gold-soft);
}
.people-row__chip--memory svg { color: var(--gold-1); }
.people-row__chip--ok {
    color: #9CCFB8;
    background: rgba(107, 144, 128, 0.10);
    border-color: rgba(107, 144, 128, 0.30);
}
.people-row__chip--neutral {
    color: var(--text-3);
    background: var(--ink-3);
    border-color: var(--line-2);
}
.people-row__chip--warn {
    color: #E59A85;
    background: rgba(197, 111, 88, 0.08);
    border-color: rgba(197, 111, 88, 0.30);
}

