/* ═══════════════════════════════════════════════════════
   JAMAL AWANG LEGACY — MODERN FAMILY HERITAGE SYSTEM (v7.0)
   Clean, Elegant, Focus & Expand Interactive Family Tree
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Design System Tokens ────────────────────────────── */
:root {
    --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Light Theme (Warm Slate & Clean Cream) */
    --bg-main: #f4f6fb;
    --bg-secondary: #ffffff;
    --bg-surface: rgba(255, 255, 255, 0.92);
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-accent: rgba(79, 70, 229, 0.35);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    /* Semantic Brand Accents */
    --accent-primary: #4f46e5;
    --accent-primary-hover: #4338ca;
    --accent-primary-light: #eef2ff;

    --badge-focal-bg: #e0e7ff;
    --badge-focal-text: #3730a3;
    --badge-parent-bg: #fef3c7;
    --badge-parent-text: #92400e;
    --badge-partner-bg: #ffe4e6;
    --badge-partner-text: #9f1239;
    --badge-child-bg: #e0f2fe;
    --badge-child-text: #0369a1;
    --badge-grandchild-bg: #f3e8ff;
    --badge-grandchild-text: #6b21a8;

    --status-live: #10b981;
    --status-deceased: #94a3b8;

    --edge-stroke: rgba(148, 163, 184, 0.55);
    --edge-couple: rgba(244, 63, 94, 0.5);

    /* Elevation Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
    --shadow-focal: 0 8px 24px -2px rgba(79, 70, 229, 0.22);
}

/* Dark Theme (Deep Midnight Slate) */
body.night {
    --bg-main: #090d16;
    --bg-secondary: #0f172a;
    --bg-surface: rgba(15, 23, 42, 0.92);
    --bg-glass: rgba(15, 23, 42, 0.8);
    --bg-card: #1e293b;
    --bg-card-hover: #27354f;

    --border-subtle: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);
    --border-accent: rgba(99, 102, 241, 0.45);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;

    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-primary-light: rgba(99, 102, 241, 0.15);

    --badge-focal-bg: rgba(99, 102, 241, 0.25);
    --badge-focal-text: #a5b4fc;
    --badge-parent-bg: rgba(245, 158, 11, 0.2);
    --badge-parent-text: #fcd34d;
    --badge-partner-bg: rgba(244, 63, 94, 0.2);
    --badge-partner-text: #fda4af;
    --badge-child-bg: rgba(56, 189, 248, 0.2);
    --badge-child-text: #7dd3fc;
    --badge-grandchild-bg: rgba(168, 85, 247, 0.2);
    --badge-grandchild-text: #d8b4fe;

    --edge-stroke: rgba(148, 163, 184, 0.4);
    --edge-couple: rgba(244, 63, 94, 0.55);

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.65);
    --shadow-focal: 0 8px 28px rgba(99, 102, 241, 0.35);
}

/* ── Base & Reset ─────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

/* ═══════════════════════════════════════════════════════
   HEADER & TOP NAVIGATION
   ═══════════════════════════════════════════════════════ */

.topbar {
    position: relative;
    z-index: 100;
    width: min(1360px, calc(100% - 2rem));
    margin: 0.75rem auto 0;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-badge {
    padding: 0.25rem 0.6rem;
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.brand-subtitle {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.live-pill {
    padding: 0.25rem 0.6rem;
    background: rgba(16, 185, 129, 0.12);
    color: var(--status-live);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-live);
    animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.nav-btn--active {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-color: var(--border-accent);
}

/* ═══════════════════════════════════════════════════════
   QUICK BRANCH SELECTOR CONTAINER & DROPDOWN
   ═══════════════════════════════════════════════════════ */

.branch-selector-container {
    width: min(1360px, calc(100% - 2rem));
    margin: 0.65rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.branch-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.2rem 0.25rem;
}

.branch-select-dropdown {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    max-width: 320px;
}

.branch-select-dropdown:hover, .branch-select-dropdown:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.branch-chips-bar {
    width: 100%;
    padding: 0.45rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.branch-chips-bar::-webkit-scrollbar {
    display: none;
}

.chips-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 0.4rem;
    white-space: nowrap;
}

.branch-chip {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.branch-chip:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-color: var(--border-accent);
    transform: translateY(-1px);
}

.branch-chip--active {
    background: var(--accent-primary);
    color: #ffffff !important;
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.chip-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    font-size: 0.68rem;
    font-weight: 800;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}

.branch-chip--active .chip-count-badge {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════
   BREADCRUMB & SEARCH CONTROL BAR
   ═══════════════════════════════════════════════════════ */

.control-bar {
    width: min(1360px, calc(100% - 2rem));
    margin: 0.65rem auto 0;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
}

.bc-crumb-btn {
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bc-crumb-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
    border-color: var(--border-subtle);
}

.bc-home {
    color: var(--accent-primary);
    font-weight: 700;
}

.bc-sep {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.bc-crumb-current {
    font-weight: 700;
    color: var(--text-primary);
    padding: 0.25rem 0.55rem;
    background: var(--accent-primary-light);
    border-radius: 6px;
}

/* Search Bar */
.tree-search-bar {
    position: relative;
    width: 280px;
}

.tree-search-input {
    width: 100%;
    padding: 0.45rem 0.85rem 0.45rem 2.2rem;
    font-size: 0.82rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-main);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.tree-search-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-icon-svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 320px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
}

.search-item {
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s ease;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: var(--accent-primary-light);
}

.search-item-photo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
}

.search-item-info {
    display: flex;
    flex-direction: column;
}

.search-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.search-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.search-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.add-person-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
    white-space: nowrap;
}

.add-person-btn:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

/* ═══════════════════════════════════════════════════════
   MAIN CANVAS & TREE VIEWER
   ═══════════════════════════════════════════════════════ */

.tree-container-wrapper {
    position: relative;
    width: min(1360px, calc(100% - 2rem));
    height: calc(100vh - 200px);
    min-height: 560px;
    margin: 0.75rem auto 1.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

#family-tree-container {
    width: 100%;
    height: 100%;
    cursor: grab;
}

.tree-loading, .tree-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   MODERN CLEAN HERITAGE CARDS (Idea 1)
   ═══════════════════════════════════════════════════════ */

.ft-clean-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 0.55rem 0.65rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    z-index: 10;
}

.ft-clean-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    z-index: 20;
}

.ft-card--selected {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25), var(--shadow-lg) !important;
    z-index: 30 !important;
}

.ft-card--focal {
    border-color: var(--accent-primary) !important;
    border-width: 2px;
    box-shadow: var(--shadow-focal) !important;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
}

.ft-card--partner {
    border-color: rgba(244, 63, 94, 0.4);
}

.ft-card-inner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.ft-card-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.ft-card-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-subtle);
    background: var(--bg-main);
}

.ft-live-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-live);
    border: 2px solid var(--bg-card);
}

.ft-deceased-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-deceased);
    border: 2px solid var(--bg-card);
}

.ft-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.ft-card-role {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 0.15rem;
}

.badge-focal { background: var(--badge-focal-bg); color: var(--badge-focal-text); }
.badge-parent { background: var(--badge-parent-bg); color: var(--badge-parent-text); }
.badge-partner { background: var(--badge-partner-bg); color: var(--badge-partner-text); }
.badge-child { background: var(--badge-child-bg); color: var(--badge-child-text); }
.badge-grandchild { background: var(--badge-grandchild-bg); color: var(--badge-grandchild-text); }

.ft-card-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.ft-card-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

.ft-status-archived {
    color: #94a3b8;
    font-style: italic;
}

.ft-card-action-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-main);
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ft-clean-card:hover .ft-card-action-btn {
    opacity: 1;
}

.ft-card-action-btn:hover {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
}

/* Branch Expand Button Pill */
.ft-branch-pill {
    margin-top: 0.4rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.ft-branch-pill:hover {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.pill-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.ft-branch-pill:hover .pill-arrow {
    transform: translateY(1px);
}

/* Marriage Union Icon Badge */
.ft-union-badge {
    background: var(--bg-card);
    border: 1px solid rgba(244, 63, 94, 0.4);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 5;
}

/* ═══════════════════════════════════════════════════════
   ZOOM CONTROLS FLOATING WIDGET
   ═══════════════════════════════════════════════════════ */

.zoom-controls {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.35rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    z-index: 50;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.zoom-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

/* ═══════════════════════════════════════════════════════
   PROFILE SIDEBAR DOSSIER PANEL
   ═══════════════════════════════════════════════════════ */

.profile-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--bg-surface);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-left: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.profile-panel.pp-visible {
    transform: translateX(0);
}

.pp-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.pp-header h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pp-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.pp-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pp-hero {
    padding: 1.5rem 1.25rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

.pp-avatar-wrap {
    width: 84px;
    height: 84px;
    margin: 0 auto 0.75rem;
}

.pp-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
}

.pp-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pp-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.pp-details {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
}

.pp-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pp-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.pp-val {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.pp-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pp-btn {
    width: 100%;
    padding: 0.55rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.pp-btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
}

.pp-btn-primary:hover {
    background: var(--accent-primary-hover);
}

.pp-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.pp-btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pp-btn-danger {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pp-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ═══════════════════════════════════════════════════════
   INLINE EDIT MODAL
   ═══════════════════════════════════════════════════════ */

.edit-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(500px, 94vw);
    max-height: 85vh;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.2s ease;
}

.edit-panel.ep-visible {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
}

.ep-header {
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.ep-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
}

.ep-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
}

.ep-body {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.ep-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ep-field label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.ep-field input, .ep-field textarea {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.ep-field input:focus, .ep-field textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.ep-field--inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.ep-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════
   THEME TOGGLE SWITCH
   ═══════════════════════════════════════════════════════ */

.theme-toggle-wrap {
    display: flex;
    align-items: center;
}

.theme-toggle {
    appearance: none;
    width: 60px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    position: relative;
    cursor: pointer;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle::before {
    content: "☀️";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body.night .theme-toggle {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-color: rgba(255, 255, 255, 0.15);
}

body.night .theme-toggle::before {
    content: "🌙";
    transform: translateX(30px);
    background: #0f172a;
}

/* ═══════════════════════════════════════════════════════
   ARKIB GAMBAR & MEMORI WARISAN (MODERN GALLERY SYSTEM)
   ═══════════════════════════════════════════════════════ */

.gallery-page-shell {
    width: min(1360px, calc(100% - 2rem));
    margin: 1rem auto 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Gallery Hero Panel */
.gallery-hero-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    backdrop-filter: blur(20px);
}

.gallery-hero-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    border-radius: 6px;
    margin-bottom: 0.4rem;
}

.gallery-hero-title {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.gallery-hero-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin-top: 0.35rem;
}

.gallery-upload-btn {
    padding: 0.65rem 1.25rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.gallery-upload-btn:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* Gallery Filter Bar */
.gallery-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 0.65rem 1rem;
    box-shadow: var(--shadow-sm);
}

.gallery-chips-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.g-chip {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.18s ease;
}

.g-chip:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-color: var(--border-accent);
}

.g-chip--active {
    background: var(--accent-primary) !important;
    color: #ffffff !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.gallery-search-wrap {
    min-width: 240px;
}

.gallery-search-input {
    width: 100%;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    transition: all 0.2s ease;
}

.gallery-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Gallery Grid */
.gallery-grid-wrapper {
    min-height: 400px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.gallery-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.gallery-card-media-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-main);
}

.gallery-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-card-img {
    transform: scale(1.06);
}

.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(15, 23, 42, 0.85) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    color: #ffffff;
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

.g-overlay-badge {
    align-self: flex-start;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.g-overlay-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.g-overlay-date {
    font-size: 0.72rem;
    opacity: 0.8;
    margin-top: 0.15rem;
}

.video-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(0,0,0,0.65);
    color: #ffffff;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.gallery-empty-state {
    text-align: center;
    padding: 5rem 1rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    margin-top: 1rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.gallery-empty-state h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gallery-empty-state p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ═══════════════════════════════════════════════════════
   FULLSCREEN LIGHTBOX MODAL
   ═══════════════════════════════════════════════════════ */

.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 16, 0.92);
    backdrop-filter: blur(16px);
}

.lightbox-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1010;
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1010;
}

.lightbox-nav-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.lightbox-nav--prev { left: 1.5rem; }
.lightbox-nav--next { right: 1.5rem; }

.lightbox-content-box {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1005;
}

.lightbox-media-wrap {
    max-width: 85vw;
    max-height: 75vh;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.lightbox-media-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
}

.lightbox-media-video {
    max-width: 100%;
    max-height: 75vh;
    display: block;
}

.lightbox-caption-bar {
    width: 100%;
    margin-top: 1rem;
    padding: 0.85rem 1.25rem;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #ffffff;
}

.lightbox-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.lightbox-category-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    background: var(--accent-primary);
    border-radius: 4px;
    margin-top: 0.2rem;
}

.lightbox-action-link {
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.lightbox-action-link:hover {
    background: #ffffff;
    color: #0f172a;
}

/* ═══════════════════════════════════════════════════════
   UPLOAD MODAL & DROPZONE
   ═══════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    width: min(540px, 94vw);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.upload-dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: 14px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--bg-main);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.upload-dropzone:hover, .dropzone--dragover {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.dropzone-input {
    display: none;
}

.dropzone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.dropzone-prompt h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dropzone-prompt p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.dropzone-browse-link {
    color: var(--accent-primary);
    font-weight: 700;
    text-decoration: underline;
}

.dropzone-hints {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.upload-preview-item {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: var(--bg-main);
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-video-badge {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--bg-main);
    color: var(--text-secondary);
}

.upload-selection-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.modal-form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.modal-form-select, .modal-form-input {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.modal-form-select:focus, .modal-form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.upload-status-msg {
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 1.2rem;
}

.modal-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-btn-primary {
    padding: 0.55rem 1.15rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-primary:hover {
    background: var(--accent-primary-hover);
}

.modal-btn-secondary {
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
}

.modal-btn-secondary:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .topbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .control-bar { flex-direction: column; align-items: stretch; }
    .tree-search-bar { width: 100%; }
    .tree-container-wrapper { height: calc(100vh - 280px); }
    .gallery-hero-panel { flex-direction: column; align-items: flex-start; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════
   VIEW MODE SWITCHER & FULL TREE GENERATION LABELS
   ═══════════════════════════════════════════════════════ */

.view-mode-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--bg-main);
    border: 1.5px solid var(--border-subtle);
    border-radius: 12px;
    padding: 3px;
    gap: 4px;
    box-shadow: var(--shadow-sm);
}

.vms-btn {
    padding: 0.4rem 0.95rem;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.vms-btn:hover {
    color: var(--text-primary);
    background: var(--accent-primary-light);
}

.vms-btn--active {
    background: var(--accent-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.vms-icon {
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════
   BRANCH SUMMARY BANNER (Per-Family Branch View)
   ═══════════════════════════════════════════════════════ */

.branch-summary-banner {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, calc(100% - 2rem));
    padding: 0.75rem 1.25rem;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 50;
    transition: all 0.3s ease;
}

.bsb-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.bsb-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border: 1px solid var(--border-accent);
    white-space: nowrap;
}

.bsb-title-wrap {
    min-width: 0;
}

.bsb-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bsb-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bsb-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 0.75rem;
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
}

.bsb-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bsb-stat-num {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1.1;
}

.bsb-stat-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bsb-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.bsb-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bsb-btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.bsb-btn-primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
}

.bsb-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.bsb-btn-ghost:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

/* Branch Jump Pill Button on cards in full tree */
.ft-branch-pill--jump {
    margin-top: 0.35rem;
    width: 100%;
    padding: 0.25rem 0.45rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border: 1px solid var(--border-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.ft-branch-pill--jump:hover {
    background: var(--accent-primary);
    color: #ffffff;
}

/* Pulse animation on card focus */
@keyframes cardPulseHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(79, 70, 229, 0);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
        transform: scale(1);
    }
}

.ft-card--pulse {
    animation: cardPulseHighlight 0.85s ease-out;
}

/* Generation Tier Labels (Full Tree Canvas) */
.gen-tier-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 5;
    opacity: 0.85;
}

/* Mobile responsive adjustments */
@media (max-width: 900px) {
    .branch-summary-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        top: 8px;
        padding: 0.65rem 0.85rem;
    }
    .bsb-stats {
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        border-bottom: 1px solid var(--border-subtle);
        padding: 0.35rem 0;
        justify-content: space-around;
    }
    .branch-selector-header {
        flex-direction: column;
        align-items: stretch;
    }
    .branch-select-dropdown {
        max-width: 100%;
    }
}


