:root {
    --bg: #f7f8fb;
    --card-bg: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e5e7eb;
    --ring: #cbd5e1;
    --shadow: 0 6px 18px rgba(15, 23, 42, .06);
    --primary: #2563eb;
    --tech0: #ef4444;
    --radius-card: 14px;
    --radius-item: 10px;
}

body {
    background: var(--bg);
    color: var(--text);
}

.appbar {
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.appbar input[type="search"] {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .6rem .8rem;
    outline: none;
}

.appbar input[type="search"]:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .08);
}

#resultCount {
    font-size: .85rem;
    color: var(--muted);
}

.section-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    height: 100%;
}

.section-card .card-header {
    border: 0;
    border-top-left-radius: var(--radius-card);
    border-top-right-radius: var(--radius-card);
    padding: .9rem 1rem;
    background: var(--card-bg);
    color: var(--text);
    border-bottom: 1px solid var(--line);
    border-left: 4px solid var(--tech0);
}

.section-card .title {
    font-weight: 800;
}

.section-card .sub {
    color: var(--muted);
    font-weight: 600;
}

.tree {
    margin: 0;
    padding-left: 0;
    list-style: none;
    position: relative;
}

.tree > li {
    margin-bottom: .85rem;
}

.branch {
    position: relative;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-item);
    background: color-mix(in oklab, var(--card-bg), var(--bg) 12%);
    transition: border-color .15s ease, transform .08s ease;
}

.branch:hover {
    border-color: var(--ring);
    transform: translateY(-1px);
}

.branch:not(.root)::before {
    content: "";
    position: absolute;
    left: -18px;
    top: calc(50% - 1px);
    width: 18px;
    height: 2px;
    background: var(--line);
    border-radius: 2px;
}

.children {
    list-style: none;
    margin: .55rem 0 0 1.25rem;
    padding-left: 1.25rem;
    border-left: 2px dashed var(--line);
}

.children > li {
    margin: .5rem 0;
}

.title {
    font-weight: 700;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.sub {
    opacity: .95;
    color: var(--muted);
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .children {
        margin-left: .35rem;
        padding-left: .6rem;
    }

    .branch:not(.root)::before {
        left: -10px;
        width: 10px;
    }

    .branch {
        padding: .45rem .55rem;
        font-size: .88rem;
    }

    .tree {
        padding-left: 0;
    }

    .appbar input[type="search"] {
        min-width: 0 !important;
        width: 100%;
    }

    .appbar .d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }

    .appbar .ms-auto {
        margin-left: 0 !important;
    }
}

@media (max-width: 480px) {
    .children {
        margin-left: .15rem;
        padding-left: .4rem;
    }

    .branch:not(.root)::before {
        left: -7px;
        width: 7px;
    }

    .branch {
        padding: .35rem .4rem;
        font-size: .82rem;
    }
}
