:root{
    --bg-top:#0f8c93;
    --bg-mid:#0b6f75;
    --bg-bottom:#e8f5f5;
    --sheet:#f7fbfb;
    --text:#15232c;
    --muted:#6b8189;
    --line:#41a9af;
    --accent:#168e94;
    --accent-strong:#0f757a;
    --accent-soft:#dff3f3;
    --danger:#b84848;
    --shadow:0 18px 48px rgba(12, 36, 43, .14);
    --shadow-soft:0 12px 28px rgba(12, 36, 43, .10);
    --card-width:208px;
    --card-width-mobile:158px;
    --avatar-size:74px;
    --family-gap:34px;
    --row-gap:84px;
    --canvas-pad-x:64px;
    --canvas-pad-y:44px;
    --stroke-width:3;
}

*{box-sizing:border-box;}
html,body{min-height:100%;}

body{
    margin:0;
    font-family:Arial, Helvetica, sans-serif;
    color:var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(255,255,255,.22), transparent 18%),
        radial-gradient(circle at 88% 10%, rgba(255,255,255,.16), transparent 20%),
        radial-gradient(circle at 50% 0%, rgba(255,255,255,.10), transparent 26%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 22%, #d7eded 22%, var(--bg-bottom) 100%);
    background-attachment:fixed;
}

a{color:inherit;text-decoration:none;}
button,input{font:inherit;}

.home-splash{
    position:fixed;
    inset:0;
    z-index:1000;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:20px;
    background:radial-gradient(circle at top, rgba(255,255,255,.18), transparent 40%), linear-gradient(180deg, #15989f 0%, #0d7379 100%);
    transition:opacity .45s ease, visibility .45s ease, transform .45s ease;
}
.home-splash.is-hidden{
    opacity:0;
    visibility:hidden;
    transform:scale(1.03);
}

.home-splash-logo,
.home-brand,
.icon-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:none;
    color:#fff;
    backdrop-filter:blur(10px);
}

.home-splash-logo{
    width:124px;
    height:124px;
    border-radius:36px;
    background:rgba(255,255,255,.12);
    box-shadow:0 18px 40px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.16);
}

.home-splash-logo svg,
.home-brand svg{width:72px;height:72px;}

.home-splash-dots{display:flex;gap:8px;}
.home-splash-dots span{
    width:10px;
    height:10px;
    border-radius:50%;
    background:rgba(255,255,255,.92);
    animation:homeBounce 1s infinite ease-in-out;
}
.home-splash-dots span:nth-child(2){animation-delay:.12s;}
.home-splash-dots span:nth-child(3){animation-delay:.24s;}

@keyframes homeBounce{
    0%,80%,100%{transform:scale(.72);opacity:.55;}
    40%{transform:scale(1);opacity:1;}
}

.home-app{
    min-height:100vh;
    display:flex;
    flex-direction:column;
}

.home-topbar{
    position:relative;
    z-index:5;
    padding:16px 12px 14px;
}

.home-topbar-inner,
.home-shell{
    width:min(1760px, calc(100vw - 24px));
    margin:0 auto;
}

.home-topbar-inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

.home-brand-wrap{
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0;
}

.home-brand{
    width:58px;
    height:58px;
    flex:0 0 auto;
    border-radius:20px;
    background:rgba(255,255,255,.14);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.14);
}

.home-brand-copy{
    min-width:0;
    color:#fff;
}
.home-brand-copy strong{
    display:block;
    font-size:18px;
    line-height:1.15;
    letter-spacing:.01em;
}
.home-brand-copy span{
    display:block;
    margin-top:3px;
    font-size:13px;
    color:rgba(255,255,255,.82);
}

.home-top-actions{
    display:flex;
    align-items:center;
    gap:10px;
}

.home-nav-pill{
    min-height:52px;
    padding:0 18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:18px;
    color:#fff;
    background:rgba(255,255,255,.16);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.16);
    backdrop-filter:blur(10px);
    font-weight:700;
    transition:transform .18s ease, background .18s ease;
}
.home-nav-pill:hover,
.home-nav-pill:focus-visible{
    transform:translateY(-1px);
    background:rgba(255,255,255,.22);
    outline:none;
    text-decoration:none;
}

.icon-btn{
    width:52px;
    height:52px;
    border-radius:18px;
    background:rgba(255,255,255,.16);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.16);
    transition:transform .18s ease, background .18s ease, box-shadow .18s ease;
    cursor:pointer;
}

.icon-btn:hover,
.icon-btn:focus-visible{
    transform:translateY(-1px);
    background:rgba(255,255,255,.22);
    outline:none;
}

.icon-btn.is-active{
    background:#ffffff;
    color:var(--accent-strong);
    box-shadow:0 10px 20px rgba(0,0,0,.12);
}

.icon-btn-light{background:rgba(255,255,255,.18);}
.icon-btn-soft{
    width:42px;
    height:42px;
    border-radius:14px;
    color:var(--accent-strong);
    background:var(--accent-soft);
    box-shadow:none;
}
.icon-btn svg,
.home-search-icon svg{width:22px;height:22px;}

.home-shell{
    flex:1;
    display:flex;
    flex-direction:column;
    gap:14px;
    padding:0 0 14px;
}

.home-search-panel{
    position:relative;
    z-index:6;
}
.home-search-panel[hidden]{display:none !important;}

.home-search-row{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 12px 12px 16px;
    border:1px solid rgba(74,174,178,.16);
    border-radius:22px;
    background:rgba(255,255,255,.96);
    box-shadow:var(--shadow-soft);
}

.home-search-icon{
    color:var(--accent-strong);
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.home-search-row input{
    flex:1;
    min-width:0;
    background:transparent;
    border:none;
    outline:none;
    font-size:16px;
    color:var(--text);
}

.home-search-results{
    display:none;
    position:absolute;
    left:0;
    right:0;
    top:calc(100% + 10px);
    max-height:min(56vh, 420px);
    overflow:auto;
    padding:8px;
    background:#fff;
    border:1px solid rgba(74,174,178,.16);
    border-radius:22px;
    box-shadow:var(--shadow-soft);
}
.home-search-results.show{display:block;}

.home-search-item{
    width:100%;
    border:none;
    background:#fff;
    border-radius:16px;
    padding:12px 14px;
    text-align:left;
    cursor:pointer;
}
.home-search-item:hover,
.home-search-item:focus-visible{
    background:#f0f8f8;
    outline:none;
}
.home-search-item strong{
    display:block;
    font-size:15px;
    margin-bottom:4px;
}
.home-search-item small{
    display:block;
    color:var(--muted);
    font-size:12px;
    line-height:1.45;
}

.home-tree-shell{
    position:relative;
    flex:1;
    min-height:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) 360px;
    gap:0;
    background:linear-gradient(180deg, rgba(255,255,255,.98) 0%, var(--sheet) 100%);
    border:1px solid rgba(74,174,178,.16);
    border-radius:32px;
    overflow:hidden;
    box-shadow:
        0 24px 60px rgba(9, 38, 44, .16),
        inset 0 1px 0 rgba(255,255,255,.75);
}

.home-tree-scroll{
    position:relative;
    min-width:0;
    min-height:0;
    overflow:auto hidden;
    scroll-behavior:smooth;
    background-image:
        radial-gradient(circle at 18% 20%, rgba(86, 201, 206, .18), transparent 22%),
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, .72), transparent 18%),
        radial-gradient(circle at 50% 78%, rgba(86, 201, 206, .10), transparent 26%),
        linear-gradient(180deg, rgba(240,250,250,.96) 0%, rgba(247,252,252,.98) 100%),
        radial-gradient(rgba(74,174,178,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74,174,178,.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(74,174,178,.04) 1px, transparent 1px);
    background-size:
        auto,
        auto,
        auto,
        auto,
        18px 18px,
        36px 36px,
        36px 36px;
}

.home-tree-scroll::before,
.home-tree-scroll::after{
    content:"";
    position:absolute;
    pointer-events:none;
    z-index:0;
    display:block;
}

.home-tree-scroll::before{
    width:420px;
    height:420px;
    top:-140px;
    left:-120px;
    border-radius:50%;
    background:
        radial-gradient(circle, rgba(72, 196, 201, .18) 0%, rgba(72, 196, 201, .08) 38%, transparent 72%);
}

.home-tree-scroll::after{
    width:380px;
    height:380px;
    right:-120px;
    bottom:-120px;
    border-radius:50%;
    background:
        radial-gradient(circle, rgba(20, 164, 170, .12) 0%, rgba(20, 164, 170, .05) 40%, transparent 74%);
}

.home-tree-canvas{
    position:relative;
    z-index:1;
    min-width:100%;
    min-height:100%;
    padding:var(--canvas-pad-y) var(--canvas-pad-x) 52px;
    display:flex;
    flex-direction:column;
    gap:var(--row-gap);
}

.home-tree-canvas.is-compact-centered{
    min-width:100%;
}

.home-tree-canvas.is-compact-centered .home-tree-row{
    width:100%;
    min-width:100%;
    justify-content:center;
}

.home-tree-svg{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    overflow:visible;
    pointer-events:none;
}

.home-tree-svg path,
.home-tree-svg line{
    stroke:var(--line);
    stroke-width:var(--stroke-width);
    fill:none;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.home-tree-svg circle{
    fill:var(--line);
    stroke:rgba(255,255,255,.96);
    stroke-width:2;
}

.home-tree-row{
    position:relative;
    z-index:2;
    width:max-content;
    min-width:100%;
    display:flex;
    justify-content:center;
    align-items:flex-start;
    gap:28px;
    padding:0 32px;
}
.home-tree-row-focus{z-index:3;}

.home-empty{
    min-width:260px;
    padding:18px 22px;
    border:1px dashed rgba(74,174,178,.28);
    border-radius:20px;
    background:rgba(255,255,255,.8);
    color:var(--muted);
    text-align:center;
    font-size:14px;
}

.home-family-group{
    position:relative;
    flex:0 0 auto;
    display:flex;
    align-items:flex-start;
    justify-content:center;
}

.home-family-group.is-couple{
    padding-bottom:22px;
}

.home-couple{
    display:flex;
    align-items:flex-start;
    justify-content:center;
    gap:var(--family-gap);
}

.home-couple-member,
.home-person-slot{
    flex:0 0 auto;
}

.home-person-card{
    width:var(--card-width);
    min-height:162px;
    border:none;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
    padding:16px 14px 14px;
    border-radius:24px;
    background:linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
    box-shadow:0 10px 28px rgba(16, 34, 40, .10);
    text-align:center;
    color:var(--text);
    cursor:pointer;
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.home-person-card.is-male{
    background:linear-gradient(180deg, #f4fbff 0%, #eefbf6 100%);
    box-shadow:0 10px 28px rgba(58, 128, 157, .12);
}

.home-person-card.is-female{
    background:linear-gradient(180deg, #fffdfd 0%, #fff8fa 100%);
    box-shadow:0 10px 28px rgba(198, 107, 144, .06);
}

.home-person-card:hover,
.home-person-card:focus-visible{
    transform:translateY(-2px);
    box-shadow:0 16px 32px rgba(16, 34, 40, .14);
    outline:none;
}

.home-person-card.is-male.is-focus{
    background:linear-gradient(180deg, #eef9ff 0%, #e4f8ee 100%);
    box-shadow:0 16px 34px rgba(53, 138, 154, .20);
    outline:2px solid rgba(53, 138, 154, .18);
    outline-offset:0;
}

.home-person-card.is-female.is-focus{
    background:linear-gradient(180deg, #fffbfd 0%, #fff5f8 100%);
    box-shadow:0 16px 34px rgba(205, 102, 150, .11);
    outline:2px solid rgba(205, 102, 150, .08);
    outline-offset:0;
}

.home-person-card.is-focus{
    background:linear-gradient(180deg, #ffffff 0%, #f2fbfb 100%);
    box-shadow:0 16px 34px rgba(22, 142, 148, .18);
    outline:2px solid rgba(22, 142, 148, .18);
    outline-offset:0;
}

.home-person-card.dead{opacity:.86;}
.home-avatar{
    width:var(--avatar-size);
    height:var(--avatar-size);
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-size:24px;
    font-weight:800;
    letter-spacing:.04em;
    overflow:hidden;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.28);
}
.home-avatar.is-photo{
    background:#ecf4f4 !important;
    color:transparent;
}
.home-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.home-person-copy{
    width:100%;
    min-height:72px;
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
    align-items:center;
    gap:4px;
}

.home-person-name{
    min-height:40px;
    font-size:17px;
    font-weight:700;
    line-height:1.22;
    text-align:center;
    word-break:normal;
    overflow-wrap:anywhere;
    margin:0;
}

.home-person-name.is-long{
    font-size:15.5px;
    line-height:1.18;
}

.home-person-name.is-xlong{
    font-size:14px;
    line-height:1.14;
    letter-spacing:.01em;
}

.home-person-father{
    min-height:30px;
    font-size:12.5px;
    line-height:1.24;
    color:var(--accent-strong);
    font-weight:400;
    margin:0;
    text-align:center;
    overflow-wrap:anywhere;
    word-break:break-word;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
}

.home-person-father.is-empty{
    visibility:hidden;
}

.home-focus-dock{
    min-width:0;
    background:linear-gradient(180deg, rgba(11,95,101,.98) 0%, rgba(14,117,122,.98) 100%);
    color:#fff;
    padding:28px 24px;
    display:flex;
    align-items:flex-start;
    justify-content:flex-start;
    border-left:1px solid rgba(255,255,255,.10);
}

.home-focus-copy{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.home-focus-copy strong{
    display:block;
    font-size:24px;
    line-height:1.18;
    margin:0 0 2px;
}

.home-focus-copy p{
    margin:0;
    font-size:15px;
    line-height:1.38;
    color:rgba(255,255,255,.92);
}
.home-focus-copy p#homeFocusLineage{
    font-weight:600;
    color:#fff;
}

.home-branch-gap{
    flex:0 0 20px;
    width:20px;
    min-height:1px;
}

.home-branch-gap.is-children{
    flex-basis:28px;
    width:28px;
}

.home-tree-scroll::-webkit-scrollbar,
.home-search-results::-webkit-scrollbar{height:10px;width:10px;}
.home-tree-scroll::-webkit-scrollbar-thumb,
.home-search-results::-webkit-scrollbar-thumb{
    background:rgba(22,142,148,.24);
    border-radius:999px;
}
.home-tree-scroll::-webkit-scrollbar-track,
.home-search-results::-webkit-scrollbar-track{background:transparent;}

@media (max-width: 1280px){
    .home-tree-shell{
        grid-template-columns:minmax(0,1fr) 320px;
    }
    .home-brand-copy span{display:none;}
}

@media (max-width: 1024px){
    :root{
        --card-width:186px;
        --avatar-size:68px;
        --family-gap:26px;
        --row-gap:72px;
        --canvas-pad-x:38px;
        --canvas-pad-y:34px;
    }

    .home-topbar-inner,
    .home-shell{
        width:min(100vw - 16px, 1600px);
    }

    .home-tree-shell{
        grid-template-columns:1fr;
    }

    .home-focus-dock{
        border-left:none;
        border-top:1px solid rgba(255,255,255,.10);
        padding:20px 18px;
    }

    .home-focus-copy strong{font-size:22px;}
}

@media (max-width: 768px){
    :root{
        --card-width:var(--card-width-mobile);
        --avatar-size:58px;
        --family-gap:18px;
        --row-gap:58px;
        --canvas-pad-x:18px;
        --canvas-pad-y:22px;
        --stroke-width:2.6;
    }

    .home-topbar{padding:12px 8px 12px;}

    .home-topbar-inner,
    .home-shell{
        width:calc(100vw - 16px);
    }

    .home-brand{
        width:46px;
        height:46px;
        border-radius:16px;
    }

    .home-brand svg{width:56px;height:56px;}
    .home-brand-copy strong{font-size:16px;}
    .home-brand-copy span{display:none;}

    .home-top-actions{gap:8px;}

    .icon-btn{
        width:44px;
        height:44px;
        border-radius:15px;
    }
    .icon-btn svg,
    .home-search-icon svg{width:20px;height:20px;}

    .home-search-row{
        padding:10px 10px 10px 12px;
        border-radius:18px;
    }

    .home-tree-shell{
        min-height:calc(100vh - 154px);
        border-radius:24px;
    }

    .home-tree-row{
        padding:0 8px;
        gap:16px;
    }

    .home-family-group.is-couple{
        padding-bottom:18px;
    }

.home-person-card{
    width:var(--card-width);
    min-height:142px;
    border-radius:20px;
    padding:12px 10px 10px;
    gap:7px;
}

    .home-avatar{
        border-radius:50%;
        font-size:20px;
    }

.home-person-copy{
    min-height:62px;
    gap:3px;
}

.home-person-name{
    min-height:34px;
    font-size:15px;
    line-height:1.2;
}

.home-person-name.is-long{
    font-size:13.5px;
    line-height:1.16;
}

.home-person-name.is-xlong{
    font-size:12.5px;
    line-height:1.12;
}

.home-person-father{
    min-height:24px;
    font-size:11px;
    font-weight:400;
    line-height:1.16;
}

    .home-focus-dock{padding:16px 14px;}
.home-focus-copy{gap:7px;}
.home-focus-copy strong{
    font-size:18px;
    line-height:1.16;
}
.home-focus-copy p{
    font-size:13px;
    line-height:1.34;
}
}

@media (max-width: 520px){
    :root{
        --card-width:148px;
        --family-gap:14px;
    }

    .home-topbar-inner{align-items:flex-start;}
    .home-brand-wrap{gap:10px;}

    .home-brand-copy strong{
        max-width:132px;
        font-size:15px;
    }

    .home-tree-shell{min-height:calc(100vh - 146px);}
    .home-tree-canvas{padding-bottom:28px;}

    .home-empty{
        min-width:220px;
        padding:14px 16px;
        font-size:13px;
    }
}
.page-mode-section[hidden]{
    display:none !important;
}

.combined-home-shell{
    gap:18px;
}

.page-mode-hubungan #homeBtnRelationship{
    background:#ffffff;
    color:var(--accent-strong);
    box-shadow:0 10px 20px rgba(0,0,0,.12);
}

.page-mode-hubungan #homeSearchToggle,
.page-mode-hubungan #homeBtnRoot{
    background:rgba(255,255,255,.16);
    color:#ffffff;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.16);
}
