/* ==========================================================
   Oukebdane Family — public site
   Marble & Bordeaux luxury theme
   ========================================================== */

:root {
    --bg:          #f2efe9;
    --bg-soft:     #f7f4ee;
    --surface:     #fffefb;
    --line:        rgba(124, 34, 51, 0.26);
    --line-soft:   rgba(124, 34, 51, 0.13);

    --wine:        #7c2233;
    --wine-2:      #9c3546;
    --wine-deep:   #5a1622;
    --wine-dim:    rgba(124, 34, 51, 0.09);

    --ink:         #25211a;
    --muted:       #8c8271;

    /* Gender colors */
    --boy:         #33312c;   /* graphite */
    --boy-glow:    rgba(51, 49, 44, 0.22);
    --girl:        #bf7f8d;   /* dusty rose */
    --girl-glow:   rgba(191, 127, 141, 0.30);

    --serif: 'Cormorant Garamond', 'Amiri', Georgia, serif;
    --display: 'Playfair Display', 'Amiri', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The `hidden` attribute must always win: author rules such as
   `.bio-portfolio { display: inline-block }` would otherwise override
   the UA's `[hidden] { display: none }` and show the portfolio button
   for people who have no portfolio link. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    background:
        radial-gradient(120% 80% at 10% 0%, rgba(255, 255, 255, 0.92), transparent 40%),
        radial-gradient(120% 90% at 90% 100%, rgba(214, 201, 178, 0.50), transparent 45%),
        linear-gradient(115deg, transparent 0 38%, rgba(124, 34, 51, 0.05) 38.4% 39%, transparent 39.4%),
        linear-gradient(160deg, transparent 0 62%, rgba(150, 150, 160, 0.08) 62.3% 62.7%, transparent 63%),
        var(--bg);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 17px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

[dir="rtl"] body { font-family: 'Amiri', var(--serif); }

::selection { background: var(--wine); color: #fff; }

/* ----------------------------------------------------------
   Focus mode — header & footer collapse so the tree owns the
   screen; they slide back on edge-hover or via the toggle tab.
   ---------------------------------------------------------- */
.hero, .site-footer {
    transition: max-height 0.5s ease, opacity 0.4s ease,
                padding 0.45s ease, margin 0.45s ease;
    overflow: hidden;
}

.hero { max-height: 640px; }
.site-footer { max-height: 420px; }

body.chrome-hidden .hero,
body.chrome-hidden .site-footer {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    pointer-events: none;
}

.chrome-toggle {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    width: 48px;
    height: 22px;
    border: none;
    border-radius: 0 0 12px 12px;
    background: var(--wine);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(90, 22, 34, 0.35);
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.chrome-toggle:hover { opacity: 1; }

.chrome-toggle::before {
    content: '⌃';
    font-size: 1.05rem;
    line-height: 1;
    margin-top: 3px;
}

body.chrome-hidden .chrome-toggle::before { content: '⌄'; margin-top: 0; }

/* ----------------------------------------------------------
   Hero
   ---------------------------------------------------------- */
.hero {
    text-align: center;
    padding: 3.4rem 1.2rem 1.6rem;
    position: relative;
}

.lang-switch {
    position: absolute;
    top: 1.1rem;
    inset-inline-end: 1.3rem;
    display: flex;
    gap: 0.4rem;
}

.lang-switch a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    padding: 0.34rem 0.62rem;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: all 0.25s ease;
    font-family: var(--display);
}

.lang-switch a:hover { color: var(--wine); }

.lang-switch a.active {
    color: var(--wine);
    border-color: var(--line);
    background: var(--wine-dim);
}

.kicker {
    font-size: 0.86rem;
    letter-spacing: 0.5em;
    text-indent: 0.5em;
    text-transform: uppercase;
    color: var(--wine);
}

[dir="rtl"] .kicker { letter-spacing: 0.2em; text-indent: 0.2em; }

.family-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.6rem, 8vw, 5rem);
    letter-spacing: 0.09em;
    text-indent: 0.09em;
    margin-top: 0.4rem;
    background: linear-gradient(180deg, var(--wine-2) 0%, var(--wine) 58%, var(--wine-deep) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[dir="rtl"] .family-name { letter-spacing: 0.02em; text-indent: 0.02em; }

.hero-ornament, .footer-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 1.1rem auto 0.9rem;
    max-width: 460px;
}

.hero-ornament span:not(.diamond), .footer-ornament span:not(.diamond) {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line));
}

.hero-ornament span:last-child, .footer-ornament span:last-child {
    background: linear-gradient(90deg, var(--line), transparent);
}

.diamond {
    width: 8px;
    height: 8px;
    background: var(--wine);
    transform: rotate(45deg);
    box-shadow: 0 0 0 3px rgba(124, 34, 51, 0.14);
    flex: 0 0 auto !important;
}

.subtitle {
    color: var(--muted);
    font-style: italic;
    font-size: 1.06rem;
    max-width: 560px;
    margin: 0 auto;
}

.stats {
    display: flex;
    justify-content: center;
    gap: clamp(1.2rem, 5vw, 3.4rem);
    margin-top: 1.7rem;
    flex-wrap: wrap;
}

.stat strong {
    display: block;
    font-family: var(--display);
    font-size: 1.75rem;
    color: var(--wine);
    line-height: 1.1;
}

.stat span {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

.legend {
    display: flex;
    justify-content: center;
    gap: 1.6rem;
    margin-top: 1.35rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.legend-item { display: inline-flex; align-items: center; gap: 0.45rem; }

.legend-item i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

.legend-item.male i   { background: var(--boy); }
.legend-item.female i { background: var(--girl); }

/* ----------------------------------------------------------
   Tree viewport (pan & zoom stage)
   ---------------------------------------------------------- */
main { flex: 1; display: flex; flex-direction: column; transition: padding-top 0.45s ease; }

/* When the header is collapsed, clear the toggle tab at the top. */
body.chrome-hidden main { padding-top: 26px; }

.drag-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.tree-viewport {
    position: relative;
    flex: 1;
    min-height: 520px;
    overflow: hidden;
    cursor: grab;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    background: radial-gradient(700px 350px at 50% 0%, rgba(255, 255, 255, 0.55), transparent 70%);
    touch-action: none;

    /* Dragging the tree must never start a text selection. */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

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

.tree-canvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    direction: ltr;          /* connector geometry is physical; node text sets its own dir */
    padding: 44px 60px 80px;
    width: max-content;
}

.empty-tree {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--muted);
    font-style: italic;
    font-size: 1.15rem;
}

/* ----------------------------------------------------------
   The tree — classic CSS connector pattern
   ---------------------------------------------------------- */
.tree ul {
    display: flex;
    justify-content: center;
    padding-top: 46px;
    position: relative;
}

.tree > ul { padding-top: 0; }

.tree li {
    list-style: none;
    text-align: center;
    position: relative;
    padding: 46px 14px 0;
}

.tree > ul > li { padding-top: 0; }

/* horizontal + vertical connectors above every child */
.tree li::before,
.tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 1px solid var(--line);
    width: 50%;
    height: 46px;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 1px solid var(--line);
}

.tree li:only-child::before,
.tree li:only-child::after { display: none; }

.tree li:only-child { padding-top: 46px; }

.tree > ul > li:only-child { padding-top: 0; }

/* single vertical drop for an only child */
.tree ul li:only-child::before {
    display: block;
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    right: auto;
    width: 0;
    height: 46px;
    border-top: none;
    border-left: 1px solid var(--line);
}

.tree li:first-child::before,
.tree li:last-child::after { border: 0 none; }

.tree li:last-child::before {
    border-right: 1px solid var(--line);
    border-radius: 0 10px 0 0;
}

.tree li:first-child::after { border-radius: 10px 0 0 0; }

/* vertical stem dropping from the parent node */
.tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 1px solid var(--line);
    width: 0;
    height: 46px;
}

/* ----------------------------------------------------------
   Person node
   ---------------------------------------------------------- */
.node {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.42rem;
    padding: 0.55rem 0.9rem 0.7rem;
    border-radius: 14px;
    position: relative;
    transition: transform 0.22s ease, background 0.22s ease;
    max-width: 150px;
    outline: none;
}

.node:hover, .node:focus-visible {
    background: rgba(255, 255, 255, 0.72);
    transform: translateY(-3px);
}

.node.has-link { cursor: pointer; }

.ring {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--surface);
    position: relative;
    flex: 0 0 auto;
}

.node.male .ring {
    border: 2px solid var(--boy);
    box-shadow: 0 0 0 4px rgba(51, 49, 44, 0.07), 0 8px 22px rgba(90, 22, 34, 0.13);
}

.node.female .ring {
    border: 2px solid var(--girl);
    box-shadow: 0 0 0 4px rgba(191, 127, 141, 0.12), 0 8px 22px rgba(90, 22, 34, 0.12);
}

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

.initial {
    font-family: var(--display);
    font-size: 2rem;
    line-height: 1;
}

.node.male .initial   { color: var(--boy); }
.node.female .initial { color: var(--girl); }

.node-name {
    font-family: var(--display);
    font-size: 1rem;
    letter-spacing: 0.03em;
    line-height: 1.25;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.node.male .node-name   { color: var(--ink); }
.node.female .node-name { color: var(--girl); }

.node-years {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--muted);
}

/* ----------------------------------------------------------
   Zoom controls
   ---------------------------------------------------------- */
.zoom-controls {
    position: absolute;
    bottom: 1.1rem;
    inset-inline-end: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    z-index: 20;
}

.zoom-controls button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    color: var(--wine);
    font-size: 1.25rem;
    font-family: var(--serif);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 14px rgba(90, 22, 34, 0.10);
}

.zoom-controls button:hover {
    background: var(--wine);
    color: #fff;
    border-color: var(--wine);
}

/* ----------------------------------------------------------
   Bio hover card
   ---------------------------------------------------------- */
.bio-card {
    position: absolute;
    z-index: 40;
    width: min(330px, calc(100vw - 2rem));
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.15rem 1.2rem 1.05rem;
    box-shadow: 0 24px 60px rgba(90, 22, 34, 0.18), 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: bio-in 0.22s ease;
    pointer-events: auto;
}

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

.bio-card::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(124, 34, 51, 0.16);
    border-radius: 11px;
    pointer-events: none;
}

.bio-close {
    position: absolute;
    top: 0.5rem;
    inset-inline-end: 0.6rem;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    display: none;
}

.bio-close:hover { color: var(--wine); }

.bio-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.7rem;
}

.bio-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 1.6rem;
    background: var(--bg-soft);
}

.bio-card.male .bio-photo   { border: 2px solid var(--boy);  color: var(--boy); }
.bio-card.female .bio-photo { border: 2px solid var(--girl); color: var(--girl); }

.bio-photo img { width: 100%; height: 100%; object-fit: cover; }

.bio-head h3 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.2;
}

.bio-card.male h3   { color: var(--ink); }
.bio-card.female h3 { color: var(--girl); }

.bio-alt {
    color: var(--muted);
    font-size: 0.92rem;
    font-style: italic;
}

.bio-alt:empty { display: none; }

.bio-tag {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 0.15rem;
}

.bio-rows { display: grid; gap: 0.28rem; margin-bottom: 0.55rem; }

.bio-rows div {
    display: flex;
    gap: 0.55rem;
    font-size: 0.9rem;
    align-items: baseline;
}

.bio-rows dt {
    color: var(--wine);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    flex: 0 0 auto;
    min-width: 86px;
}

[dir="rtl"] .bio-rows dt { letter-spacing: 0; min-width: 70px; }

.bio-rows dd { color: var(--ink); }

.bio-text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #4a453c;
    border-top: 1px solid var(--line-soft);
    padding-top: 0.55rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bio-text:empty { display: none; border: none; padding: 0; }

.bio-portfolio {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1.05rem;
    border: 1px solid var(--wine);
    border-radius: 999px;
    color: var(--wine);
    text-decoration: none;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: all 0.22s ease;
}

.bio-portfolio:hover {
    background: var(--wine);
    color: #fff;
}

.bio-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.bio-suggest {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 0.95rem;
    border: 1px dashed var(--line);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.22s ease;
}

.bio-suggest:hover {
    border-style: solid;
    border-color: var(--wine);
    color: var(--wine);
    background: rgba(124, 34, 51, 0.05);
}

.bio-private-note {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--muted);
    font-style: italic;
    border-top: 1px solid var(--line-soft);
    padding-top: 0.55rem;
}

.bio-add {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--wine);
    border-radius: 999px;
    color: var(--wine);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.22s ease;
}

.bio-add:hover {
    background: var(--wine);
    color: #fff;
}

/* ----------------------------------------------------------
   ＋ "add a child" affordance on every node
   ---------------------------------------------------------- */
.node-add {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--wine);
    color: var(--wine);
    font-size: 1.15rem;
    font-family: var(--serif);
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(90, 22, 34, 0.18);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease;
    z-index: 6;
}

.node:hover .node-add,
.node:focus-within .node-add,
.node-add:focus-visible {
    opacity: 1;
    transform: scale(1);
}

.node-add:hover {
    background: var(--wine);
    color: #fff;
}

/* On touch devices there is no hover — keep it always visible. */
@media (hover: none) {
    .node-add { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------
   Tree tools — search + expand/collapse
   ---------------------------------------------------------- */
.tree-tools {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 0.4rem;
}

.tree-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 280px;
    max-width: 440px;
}

.tree-search .search-ico {
    width: 18px;
    height: 18px;
    position: absolute;
    inset-inline-start: 12px;
    fill: var(--muted);
    pointer-events: none;
}

.tree-search input {
    width: 100%;
    padding: 0.6rem 2.4rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1rem;
}

.tree-search input:focus {
    outline: none;
    border-color: var(--wine);
    box-shadow: 0 0 0 3px rgba(124, 34, 51, 0.1);
}

#search-clear {
    position: absolute;
    inset-inline-end: 8px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.4rem;
}

.search-status {
    position: absolute;
    inset-inline-end: 36px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    pointer-events: none;
    white-space: nowrap;
}

/* Search highlight */
.node.search-hit .ring {
    box-shadow: 0 0 0 4px rgba(124, 34, 51, 0.28), 0 0 22px rgba(124, 34, 51, 0.4) !important;
    animation: pulse-hit 1.2s ease 2;
}

@keyframes pulse-hit {
    50% { box-shadow: 0 0 0 8px rgba(124, 34, 51, 0.12), 0 0 30px rgba(124, 34, 51, 0.55); }
}

/* ----------------------------------------------------------
   Private members — branch visible, identity withheld
   ---------------------------------------------------------- */
.node.is-private .ring {
    border-style: dashed;
    background: repeating-linear-gradient(
        45deg,
        rgba(140, 130, 113, 0.06) 0 6px,
        rgba(140, 130, 113, 0.12) 6px 12px
    );
}

.node.is-private .initial {
    color: var(--muted);
    font-size: 1.6rem;
}

.node-private {
    color: var(--muted) !important;
    font-style: italic;
    font-size: 0.9rem !important;
}

/* Admin viewing a member that is hidden from the public */
.node.admin-private .ring {
    border-style: dashed;
}

.private-badge {
    position: absolute;
    top: -2px;
    inset-inline-start: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--wine);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    box-shadow: 0 2px 6px rgba(90, 22, 34, 0.2);
    z-index: 4;
}

.bio-admin-note {
    background: rgba(124, 34, 51, 0.08);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.7rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--wine);
}

.bio-admin-note::before {
    content: '🔒 ';
}

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */
.site-footer {
    text-align: center;
    padding: 2.2rem 1.2rem 1.9rem;
}

.footer-ornament { margin-bottom: 1.1rem; }

.credit {
    color: var(--muted);
    font-size: 0.98rem;
}

.credit strong, .credit a {
    color: var(--wine);
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.credit a:hover { color: var(--wine-2); }

.credit-secondary {
    margin-top: 0.35rem;
    font-size: 0.88rem;
}

.rights {
    margin-top: 0.45rem;
    font-size: 0.78rem;
    color: rgba(140, 130, 113, 0.75);
    letter-spacing: 0.06em;
}

/* ----------------------------------------------------------
   Touch devices — bio card becomes a tap sheet
   ---------------------------------------------------------- */
@media (hover: none) {
    .bio-close { display: block; }
}

@media (max-width: 760px) {
    /* Give the tree the tallest possible stage on a phone. */
    .tree-viewport { min-height: 66vh; }
    .drag-hint { font-size: 0.72rem; letter-spacing: 0.08em; }
}

@media (max-width: 640px) {
    /* Keep the header compact so the tree gets most of the screen. */
    .hero { padding: 2.6rem 1rem 0.6rem; }
    .kicker { font-size: 0.62rem; letter-spacing: 0.34em; text-indent: 0.34em; }
    .family-name { font-size: clamp(1.9rem, 10vw, 2.6rem); }
    .hero-ornament { margin: 0.5rem auto 0.4rem; }
    .subtitle { font-size: 0.92rem; }
    .stats {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.3rem;
        margin-top: 0.8rem;
    }
    .stat strong { font-size: 1.15rem; }
    .stat span { font-size: 0.55rem; letter-spacing: 0.08em; }
    .legend { margin-top: 0.7rem; font-size: 0.78rem; gap: 1rem; }
    .ring { width: 66px; height: 66px; }
    .node { max-width: 116px; padding: 0.4rem 0.5rem 0.7rem; }
    .node-name { font-size: 0.9rem; max-width: 106px; }
    /* Bigger, always-visible touch target for the add-child control. */
    .node-add { width: 30px; height: 30px; font-size: 1.3rem; opacity: 1; transform: none; }

    /* Lay the map controls out along the bottom so all four stay on
       screen and sit within easy thumb reach. */
    .zoom-controls {
        flex-direction: row;
        bottom: 0.8rem;
        inset-inline-end: 50%;
        transform: translateX(50%);
        gap: 0.6rem;
    }
    [dir="rtl"] .zoom-controls { transform: translateX(-50%); }
    .zoom-controls button { width: 44px; height: 44px; }
}
