/* ==========================================================
   AI MIND MAP — PREMIUM THPT STYLE
   Đồng bộ tone màu / phong cách với INDEX
   ========================================================== */

:root{
    --blue-main:#2563eb;
    --blue-dark:#1d4ed8;
    --blue-soft:#eff6ff;
    --blue-border:#dbeafe;

    --text-main:#0f172a;
    --text-soft:#64748b;
    --white:#ffffff;

    --green:#10b981;
    --purple:#7c3aed;
    --orange:#f59e0b;

    --bg-main:#f4f8ff;
    --bg-radius:28px;

    --shadow-soft:
        0 10px 30px rgba(37,99,235,0.08);

    --shadow-hover:
        0 20px 45px rgba(37,99,235,0.14);

    --hero-gradient:
        linear-gradient(
            135deg,
            #0f172a 0%,
            #162d63 50%,
            #2563eb 100%
        );
}

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    min-height:100vh;

    background:
        radial-gradient(
            circle at top left,
            rgba(37,99,235,0.08),
            transparent 28%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(96,165,250,0.08),
            transparent 32%
        ),
        var(--bg-main);

    color:var(--text-main);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

button,
select,
textarea{
    font:inherit;
}

button{
    -webkit-tap-highlight-color:transparent;
}

.mindmap-page{
    min-height:100vh;
    padding:28px;

    overflow:hidden;

    background:
        radial-gradient(
            circle at top left,
            rgba(37,99,235,0.08),
            transparent 28%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(96,165,250,0.08),
            transparent 32%
        ),
        var(--bg-main);

    border-radius:var(--bg-radius);
}

.mindmap-header,
.mindmap-container{
    width:min(1180px,100%);
    margin:0 auto;
}


/* ==========================================================
   HEADER — COMPACT / ĐỒNG BỘ INDEX
   Không chồng lấn, gọn trên desktop và mobile
   ========================================================== */

.mindmap-header{
    position:relative;
    overflow:hidden;

    min-height:165px;

    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:26px;

    padding:15px 30px;

    border-radius:36px;

    background:var(--hero-gradient);

    border:1px solid rgba(255,255,255,0.08);

    box-shadow:
        0 20px 60px rgba(15,23,42,0.22);

    margin-bottom:20px;
}

.header-glow{
    position:absolute;
    border-radius:50%;
    filter:blur(85px);
    pointer-events:none;
}

.header-glow-1{
    width:280px;
    height:280px;
    right:-90px;
    top:-120px;
    background:rgba(96,165,250,0.20);
}

.header-glow-2{
    width:220px;
    height:220px;
    left:-90px;
    bottom:-130px;
    background:rgba(59,130,246,0.13);
}

.mindmap-header-main{
    position:relative;
    z-index:2;

    min-width:0;
    flex:1;

    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;

    gap:24px;
}

.mindmap-brand{
    display:flex;
    align-items:center;
    gap:10px;

    width:max-content;
    max-width:100%;

    padding:8px 15px 8px 9px;

    border-radius:999px;

    background:rgba(255,255,255,0.10);
    border:1px solid rgba(255,255,255,0.14);

    backdrop-filter:blur(14px);

    box-shadow:
        0 8px 25px rgba(0,0,0,0.08);
}

.mindmap-brand-logo{
    width:52px;
    height:52px;

    display:flex;
    align-items:center;
    justify-content:center;

    flex-shrink:0;
}

.mindmap-brand-logo img{
    width:58px;
    height:58px;

    object-fit:contain;
    display:block;

    filter:drop-shadow(0 5px 12px rgba(0,0,0,0.16));

    transition:transform .22s ease;
}

.mindmap-brand:hover img{
    transform:translateY(-2px) scale(1.04);
}

.mindmap-brand-text{
    display:flex;
    flex-direction:column;
    justify-content:center;

    line-height:1.2;
}

.mindmap-brand-title{
    color:#e0f2fe;

    font-size:16px;
    font-weight:900;

    letter-spacing:.35px;
    white-space:nowrap;

    text-shadow:
        0 2px 10px rgba(0,0,0,0.22);
}

.mindmap-brand-sub{
    margin-top:4px;

    color:#93c5fd;

    font-size:12px;
    font-weight:700;

    letter-spacing:.3px;
    white-space:nowrap;
}

.mindmap-header-content{
    min-width:0;
    max-width:none;

    padding-top:1px;
}

.header-kicker{
    display:inline-flex;
    align-items:center;

    margin-bottom:3px;

    color:#bfdbfe;

    font-size:11px;
    font-weight:900;

    letter-spacing:.7px;
}

.mindmap-header h1{
    margin:0 0 5px;

    color:#ffffff;

    font-size:clamp(26px,2.75vw,34px);
    line-height:1.06;

    font-weight:700;
    letter-spacing:-0.9px;
}

.mindmap-header p{
    max-width:850px;

    margin:0;

    color:#dbeafe;

    font-size:14px;
    line-height:1.5;
}

.header-meta{
    display:flex;
    flex-wrap:wrap;
    gap:7px;

    margin-top:9px;
}

.header-meta span{
    display:inline-flex;
    align-items:center;

    padding:6px 10px;

    border-radius:999px;

    color:#e0f2fe;

    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.10);

    font-size:10.5px;
    font-weight:800;

    line-height:1.2;

    backdrop-filter:blur(10px);
}

.back-button{
    position:relative;
    z-index:3;

    flex:0 0 auto;

    min-height:48px;

    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;

    padding:0 17px;

    border-radius:17px;

    text-decoration:none;

    color:#ffffff;

    background:rgba(255,255,255,0.10);

    border:1px solid rgba(255,255,255,0.16);

    backdrop-filter:blur(14px);

    font-size:13px;
    font-weight:800;

    white-space:nowrap;

    box-shadow:
        0 10px 25px rgba(0,0,0,0.10);

    transition:
        transform .22s ease,
        background .22s ease,
        box-shadow .22s ease;
}

.back-button:hover{
    transform:translateY(-2px);

    background:rgba(255,255,255,0.17);

    box-shadow:
        0 14px 30px rgba(0,0,0,0.14);
}

/* ==========================================================
   MAIN CARD
   ========================================================== */

.input-card,
.result-card,
.tips-card{
    background:rgba(255,255,255,.96);

    border:1px solid rgba(219,234,254,.95);

    border-radius:30px;

    box-shadow:var(--shadow-soft);

    margin-bottom: 22px;
}

.input-card{
    padding:26px;
}

.card-title{
    display:flex;
    align-items:center;
    gap:15px;

    margin-bottom:18px;
}

.title-icon{
    width:62px;
    height:62px;

    display:grid;
    place-items:center;

    flex-shrink:0;

    border-radius:22px;

    background:
        linear-gradient(
            135deg,
            #dbeafe,
            #bfdbfe
        );

    border:1px solid rgba(147,197,253,.45);

    font-size:30px;

    box-shadow:
        0 8px 20px rgba(37,99,235,.08);
}

.section-eyebrow{
    display:inline-flex;
    align-items:center;

    margin-bottom:5px;

    color:var(--blue-dark);

    font-size:11px;
    font-weight:900;

    letter-spacing:.7px;
}

.card-title h2{
    margin:0 0 3px;

    color:var(--text-main);

    font-size:22px;
    line-height:1.25;

    font-weight:900;
}

.card-title p{
    margin:0;

    color:var(--text-soft);

    font-size:14px;
    line-height:1.55;
}

#lessonContent{
    width:100%;

    min-height:250px;

    resize:vertical;

    padding:19px 20px;

    border:1px solid var(--blue-border);
    border-radius:22px;

    outline:none;

    color:var(--text-main);
    background:#fbfdff;

    line-height:1.7;
    font-size:15px;

    box-shadow:
        inset 0 1px 2px rgba(15,23,42,.02);

    transition:
        border .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

#lessonContent::placeholder{
    color:#94a3b8;
}

#lessonContent:hover{
    background:#ffffff;
    border-color:#bfdbfe;
}

#lessonContent:focus{
    background:#ffffff;

    border-color:#60a5fa;

    box-shadow:
        0 0 0 4px rgba(37,99,235,.08),
        0 8px 25px rgba(37,99,235,.05);
}

.input-bottom{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;

    gap:18px;

    margin-top:14px;
}

#charCount{
    color:var(--text-soft);
    font-size:13px;
    font-weight:600;

    padding-bottom:9px;
}

.diagram-select-wrap{
    display:flex;
    flex-direction:column;
    gap:6px;

    min-width:250px;

    color:var(--text-soft);

    font-size:12px;
    font-weight:800;
}

.diagram-select-wrap select{
    width:100%;

    min-height:48px;

    padding:0 40px 0 15px;

    border:1px solid var(--blue-border);
    border-radius:16px;

    outline:none;

    color:var(--text-main);
    background:#ffffff;

    font-size:14px;
    font-weight:800;

    cursor:pointer;

    box-shadow:
        0 6px 18px rgba(37,99,235,.05);

    transition:
        border .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.diagram-select-wrap select:hover{
    border-color:#93c5fd;
    transform:translateY(-1px);
}

.diagram-select-wrap select:focus{
    border-color:#60a5fa;

    box-shadow:
        0 0 0 4px rgba(37,99,235,.08);
}

.generate-button{
    width:100%;

    min-height:58px;

    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;

    border:0;
    border-radius:18px;

    margin-top:18px;

    padding:0 20px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #1d4ed8
        );

    color:#ffffff;

    font-size:15px;
    font-weight:900;

    cursor:pointer;

    box-shadow:
        0 14px 30px rgba(37,99,235,.24);

    transition:
        transform .22s ease,
        box-shadow .22s ease,
        filter .22s ease;
}

.generate-button:hover{
    transform:translateY(-2px);

    filter:brightness(1.03);

    box-shadow:
        0 18px 35px rgba(37,99,235,.30);
}

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

.generate-button.loading{
    opacity:.72;
    pointer-events:none;
}

.input-hint{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:6px;

    margin-top:10px;

    color:#94a3b8;

    font-size:12px;
}

.input-hint strong{
    color:#64748b;
}

.message{
    margin-top:14px;

    border-radius:15px;

    padding:12px 14px;

    line-height:1.5;
}

.error{
    background:#fef2f2;
    border:1px solid #fecaca;
    color:#dc2626;
}

.hidden{
    display:none !important;
}


/* ==========================================================
   RESULT
   ========================================================== */

.result-card{
    margin-top:20px;
    overflow:hidden;
}

.result-head{
    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:20px;

    padding:24px 26px;

    border-bottom:1px solid var(--blue-border);

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fbfdff 100%
        );
}

.result-title-area{
    min-width:0;
}

.result-head h2{
    margin:7px 0 4px;

    color:var(--text-main);

    font-size:27px;
    line-height:1.2;

    font-weight:900;
}

.result-head p{
    max-width:760px;

    margin:0;

    color:var(--text-soft);

    font-size:14px;
    line-height:1.65;
}

.map-actions{
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;

    gap:8px;
}

.map-actions button{
    min-height:42px;

    border:1px solid var(--blue-border);
    border-radius:14px;

    padding:0 13px;

    background:#ffffff;
    color:var(--blue-main);

    font-size:13px;
    font-weight:800;

    cursor:pointer;

    transition:
        transform .2s ease,
        background .2s ease,
        border .2s ease,
        box-shadow .2s ease;
}

.map-actions button:hover{
    transform:translateY(-2px);

    background:var(--blue-soft);
    border-color:#bfdbfe;

    box-shadow:
        0 8px 20px rgba(37,99,235,.08);
}


/* ==========================================================
   SVG CANVAS
   ========================================================== */

.mindmap-canvas{
    position:relative;

    width:100%;

    height:min(690px,70vh);
    min-height:480px;

    overflow:hidden;

    touch-action:none;
    user-select:none;

    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(219,234,254,.55),
            transparent 36%
        ),
        #fbfdff;
}

.mindmap-canvas > svg.mindmap-svg{
    display:block;

    width:100%;
    height:100%;

    min-width:100%;
    min-height:100%;

    cursor:grab;

    touch-action:none;
}

.mindmap-canvas > svg.mindmap-svg.dragging{
    cursor:grabbing;
}

.mindmap-svg .mind-node{
    transition:
        filter .15s ease,
        transform .15s ease;
}

.mindmap-svg .mind-node:hover{
    filter:
        drop-shadow(
            0 8px 16px rgba(30,64,175,.16)
        );
}

.mindmap-svg .mindmap-links path{
    pointer-events:none;
}

.map-note{
    display:flex;
    align-items:center;
    gap:8px;

    padding:13px 20px;

    color:var(--text-soft);

    background:#f8fbff;

    border-top:1px solid var(--blue-border);

    font-size:12px;
    line-height:1.5;
}


/* ==========================================================
   TIPS
   ========================================================== */

.tips-card{
    display:flex;
    align-items:flex-start;

    gap:13px;

    padding:18px 20px;

    margin-top:18px;

    color:var(--text-soft);
}

.tips-icon{
    width:38px;
    height:38px;

    display:grid;
    place-items:center;

    flex-shrink:0;

    border-radius:14px;

    background:
        linear-gradient(
            135deg,
            #dbeafe,
            #bfdbfe
        );

    font-size:19px;
}

.tips-card strong{
    color:var(--text-main);

    font-size:14px;
    font-weight:900;
}

.tips-card p{
    margin:4px 0 0;

    font-size:13px;
    line-height:1.7;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media(max-width:900px){

    .mindmap-header{
        align-items:flex-start;
        flex-direction:column;

        min-height:auto;

        padding:28px;
    }

    .back-button{
        width:100%;
    }

    .mindmap-header-left{
        width:100%;
    }

    .mindmap-header-content{
        max-width:none;
    }

    .header-meta{
        margin-top:0;
    }

    .input-bottom{
        align-items:stretch;
        flex-direction:column;
    }

    #charCount{
        padding-bottom:0;
    }

    .diagram-select-wrap{
        width:100%;
        min-width:0;
    }

    .result-head{
        align-items:stretch;
        flex-direction:column;
    }

    .map-actions{
        justify-content:flex-start;
    }
}

@media(max-width:760px){

    .mindmap-page{
        padding:14px 12px 28px;
    }

    .mindmap-header{
        padding:22px 18px;

        border-radius:28px;

        margin-bottom:14px;
    }

    .mindmap-brand{
        padding:7px 12px 7px 8px;
    }

    .mindmap-brand-logo{
        width:45px;
        height:45px;
    }

    .mindmap-brand-logo img{
        width:49px;
        height:49px;
    }

    .mindmap-brand-title{
        font-size:14px;
    }

    .mindmap-brand-sub{
        font-size:10px;
    }

    .header-kicker{
        font-size:10px;
    }

    .mindmap-header h1{
        font-size:32px;
        letter-spacing:-.8px;
    }

    .mindmap-header p{
        font-size:14px;
        line-height:1.65;
    }

    .header-meta{
        gap:6px;
    }

    .header-meta span{
        padding:6px 8px;
        font-size:10px;
    }

    .input-card{
        padding:16px;

        border-radius:22px;
    }

    .card-title{
        gap:12px;
    }

    .title-icon{
        width:52px;
        height:52px;
        border-radius:18px;
        font-size:25px;
    }

    .card-title h2{
        font-size:19px;
    }

    .card-title p{
        font-size:13px;
    }

    #lessonContent{
        min-height:230px;
        border-radius:18px;
        padding:15px;
        font-size:14px;
    }

    .generate-button{
        min-height:54px;
        border-radius:16px;
    }

    .result-card{
        border-radius:22px;
    }

    .result-head{
        padding:19px 16px;
    }

    .result-head h2{
        font-size:22px;
    }

    .map-actions{
        display:grid;
        grid-template-columns:repeat(3,1fr);
        width:100%;
    }

    .map-actions button{
        min-height:42px;
        padding:0 6px;
        font-size:11px;
    }

    .mindmap-canvas{
        height:620px;
        min-height:620px;
    }

    .map-note{
        align-items:flex-start;
        padding:12px 14px;
        font-size:11px;
    }

    .tips-card{
        padding:15px;
        border-radius:20px;
    }
}

@media(max-width:420px){

    .mindmap-header h1{
        font-size:28px;
    }

    .mindmap-brand-title{
        font-size:13px;
    }

    .mindmap-brand-sub{
        font-size:9px;
    }

    .map-actions button{
        font-size:10px;
    }
}


/* ==========================================================
   HEADER RESPONSIVE OVERRIDES
   ========================================================== */

@media(max-width:1050px){

    .mindmap-header{
        gap:20px;
        padding:22px 24px;
    }

    .mindmap-header-main{
        gap:18px;
    }

    .mindmap-brand-title{
        font-size:14px;
    }

    .mindmap-brand-sub{
        font-size:11px;
    }

    .mindmap-header h1{
        font-size:34px;
    }

    .mindmap-header p{
        font-size:13px;
    }

    .back-button{
        padding:0 14px;
    }
}

@media(max-width:820px){

    .mindmap-header{
        align-items:flex-start;
        flex-direction:column;

        min-height:auto;

        padding:20px;

        border-radius:30px;
    }

    .mindmap-header-main{
        width:100%;

        display:flex;
        flex-direction:column;
        align-items:flex-start;

        gap:12px;
    }

    .mindmap-brand{
        padding:7px 13px 7px 8px;
    }

    .mindmap-brand-logo{
        width:46px;
        height:46px;
    }

    .mindmap-brand-logo img{
        width:50px;
        height:50px;
    }

    .mindmap-brand-title{
        font-size:14px;
    }

    .mindmap-brand-sub{
        font-size:10px;
    }

    .mindmap-header-content{
        width:100%;
    }

    .header-kicker{
        font-size:10px;
    }

    .mindmap-header h1{
        font-size:32px;
        letter-spacing:-.8px;
    }

    .mindmap-header p{
        max-width:680px;
        font-size:13.5px;
    }

    .header-meta{
        margin-top:8px;
    }

    .back-button{
        width:100%;
        min-height:44px;
    }
}

@media(max-width:760px){

    .mindmap-page{
        padding:12px 10px 28px;
    }

    .mindmap-header{
        margin-bottom:14px;
        padding:17px 15px;

        border-radius:25px;
    }

    .mindmap-header-main{
        gap:10px;
    }

    .mindmap-brand{
        max-width:100%;
    }

    .mindmap-brand-title{
        font-size:13px;
    }

    .mindmap-brand-sub{
        font-size:9px;
    }

    .mindmap-header h1{
        font-size:28px;
        line-height:1.06;
    }

    .mindmap-header p{
        font-size:13px;
        line-height:1.55;
    }

    .header-meta{
        gap:5px;
        margin-top:7px;
    }

    .header-meta span{
        padding:5px 8px;
        font-size:9.5px;
    }

    .back-button{
        min-height:43px;
        border-radius:15px;
        font-size:13px;
    }
}

@media(max-width:420px){

    .mindmap-header{
        padding:15px 13px;
    }

    .mindmap-brand{
        padding:6px 10px 6px 7px;
        gap:8px;
    }

    .mindmap-brand-logo{
        width:40px;
        height:40px;
    }

    .mindmap-brand-logo img{
        width:44px;
        height:44px;
    }

    .mindmap-brand-title{
        font-size:11.5px;
        letter-spacing:.1px;
    }

    .mindmap-brand-sub{
        font-size:8.5px;
    }

    .mindmap-header h1{
        font-size:25px;
    }

    .mindmap-header p{
        font-size:12px;
    }

    .header-meta span{
        font-size:9px;
        padding:5px 7px;
    }
}

/* ==========================================================
   FOOTER MINDMAP
   KHỚP TUYỆT ĐỐI CHIỀU NGANG VỚI HEADER + CONTENT
   ========================================================== */

.mindmap-footer{
    width:min(1180px,100%);
    margin:0 auto;

    box-sizing:border-box;

    overflow:hidden;
}


/* FOOTER GỐC */

.mindmap-footer .site-footer{
    width:100% !important;
    max-width:none !important;

    margin:0 !important;

    box-sizing:border-box !important;

    left:auto !important;
    right:auto !important;

    transform:none !important;
}


/* KHUNG BÊN TRONG FOOTER */

.mindmap-footer .footer-inner{
    width:100% !important;
    max-width:none !important;

    margin:0 !important;

    box-sizing:border-box !important;
}


/* FOOTER BOTTOM */

.mindmap-footer .footer-bottom{
    width:100% !important;
    max-width:none !important;

    margin:0 !important;

    box-sizing:border-box !important;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media(max-width:760px){

    .mindmap-footer{
        width:100%;
        margin:0 auto;
    }

    .mindmap-footer .site-footer{
        width:100% !important;
        max-width:none !important;

        margin:0 !important;
    }

    .mindmap-footer .footer-inner{
        width:100% !important;
        max-width:none !important;

        margin:0 !important;
    }

}

/* ==========================================================
   MOBILE — AI MIND MAP
   BỐ CỤC GỌN, CÂN ĐỐI, DỄ ĐỌC
   Chèn cuối file CSS
   ========================================================== */

@media (max-width: 760px) {

    /* KHUNG TOÀN TRANG */
    .mindmap-page {
        padding: 8px 8px 24px !important;
        border-radius: 18px;
    }

    /* =========================
       HEADER
       ========================= */

    .mindmap-header {
        width: 100%;
        min-height: auto !important;

        padding: 16px 14px 14px !important;

        border-radius: 24px !important;

        margin-bottom: 12px !important;

        gap: 14px !important;

        align-items: stretch !important;
    }

    /* Phần header chính */
    .mindmap-header-main {
        width: 100% !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;

        gap: 13px !important;
    }

    /* =========================
       BRAND
       ========================= */

    .mindmap-brand {
        width: 100% !important;
        max-width: 100% !important;

        padding: 7px 12px 7px 7px !important;

        gap: 9px !important;

        border-radius: 18px !important;

        justify-content: flex-start;
    }

    .mindmap-brand-logo {
        width: 43px !important;
        height: 43px !important;
    }

    .mindmap-brand-logo img {
        width: 46px !important;
        height: 46px !important;
    }

    .mindmap-brand-text {
        min-width: 0;
    }

    .mindmap-brand-title {
        font-size: 13px !important;
        line-height: 1.2 !important;
        letter-spacing: .1px !important;

        white-space: normal !important;
    }

    .mindmap-brand-sub {
        margin-top: 3px !important;

        font-size: 9px !important;
        line-height: 1.2 !important;

        white-space: normal !important;
    }

    /* =========================
       NỘI DUNG HEADER
       ========================= */

    .mindmap-header-content {
        width: 100% !important;

        padding: 0 !important;
    }

    .header-kicker {
        margin-bottom: 5px !important;

        font-size: 9.5px !important;
        letter-spacing: .5px !important;
    }

    .mindmap-header h1 {
        margin: 0 0 7px !important;

        font-size: 27px !important;
        line-height: 1.08 !important;

        letter-spacing: -.6px !important;
    }

    .mindmap-header p {
        margin: 0 !important;

        font-size: 12.5px !important;
        line-height: 1.55 !important;
    }

    /* =========================
       CÁC NHÃN TÍNH NĂNG
       ========================= */

    .header-meta {
        width: 100% !important;

        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 6px !important;

        margin-top: 10px !important;
    }

    .header-meta span {
        width: 100% !important;

        min-height: 32px;

        display: flex !important;
        align-items: center;
        justify-content: center;

        padding: 5px 6px !important;

        border-radius: 12px !important;

        font-size: 9.5px !important;
        line-height: 1.2 !important;

        text-align: center;
        white-space: nowrap;
    }

    /* =========================
       NÚT VỀ TRANG CHỦ
       ========================= */

    .back-button {
        width: 100% !important;

        min-height: 43px !important;

        padding: 0 12px !important;

        border-radius: 14px !important;

        font-size: 12.5px !important;

        gap: 6px !important;
    }

    /* =========================
       CARD NHẬP NỘI DUNG
       ========================= */

    .input-card {
        padding: 15px !important;

        border-radius: 20px !important;

        margin-bottom: 14px !important;
    }

    .card-title {
        gap: 10px !important;

        margin-bottom: 14px !important;
    }

    .title-icon {
        width: 46px !important;
        height: 46px !important;

        border-radius: 15px !important;

        font-size: 22px !important;
    }

    .card-title h2 {
        font-size: 18px !important;
    }

    .card-title p {
        font-size: 12px !important;
        line-height: 1.45 !important;
    }

    #lessonContent {
        min-height: 210px !important;

        padding: 13px !important;

        border-radius: 16px !important;

        font-size: 13.5px !important;
        line-height: 1.6 !important;
    }

    .input-bottom {
        gap: 10px !important;
    }

    .diagram-select-wrap {
        width: 100% !important;
    }

    .diagram-select-wrap select {
        min-height: 44px !important;

        border-radius: 14px !important;

        font-size: 13px !important;
    }

    .generate-button {
        min-height: 51px !important;

        margin-top: 13px !important;

        border-radius: 15px !important;

        font-size: 13.5px !important;
    }

    .input-hint {
        font-size: 10.5px !important;

        text-align: center;

        line-height: 1.4;
    }

    /* =========================
       KẾT QUẢ
       ========================= */

    .result-card {
        border-radius: 20px !important;
    }

    .result-head {
        padding: 16px 14px !important;

        gap: 12px !important;
    }

    .result-head h2 {
        font-size: 20px !important;
    }

    .result-head p {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }

    .map-actions {
        grid-template-columns: repeat(3, 1fr) !important;

        gap: 5px !important;
    }

    .map-actions button {
        min-height: 40px !important;

        padding: 0 4px !important;

        border-radius: 11px !important;

        font-size: 10px !important;
    }

    .mindmap-canvas {
        height: 560px !important;
        min-height: 560px !important;
    }

    .map-note {
        padding: 10px 12px !important;

        font-size: 10.5px !important;
    }

    /* =========================
       TIPS
       ========================= */

    .tips-card {
        padding: 13px !important;

        gap: 10px !important;

        border-radius: 18px !important;
    }

    .tips-icon {
        width: 34px !important;
        height: 34px !important;

        border-radius: 11px !important;

        font-size: 17px !important;
    }

    .tips-card strong {
        font-size: 12.5px !important;
    }

    .tips-card p {
        font-size: 11.5px !important;
        line-height: 1.55 !important;
    }
}


/* ==========================================================
   ĐIỆN THOẠI NHỎ — 420PX TRỞ XUỐNG
   ========================================================== */

@media (max-width: 420px) {

    .mindmap-page {
        padding: 6px 6px 20px !important;
    }

    .mindmap-header {
        padding: 14px 12px !important;

        border-radius: 21px !important;
    }

    .mindmap-brand {
        padding: 6px 9px 6px 6px !important;

        gap: 7px !important;
    }

    .mindmap-brand-logo {
        width: 39px !important;
        height: 39px !important;
    }

    .mindmap-brand-logo img {
        width: 42px !important;
        height: 42px !important;
    }

    .mindmap-brand-title {
        font-size: 11.5px !important;
    }

    .mindmap-brand-sub {
        font-size: 8px !important;
    }

    .header-kicker {
        font-size: 9px !important;
    }

    .mindmap-header h1 {
        font-size: 24px !important;
        line-height: 1.08 !important;
    }

    .mindmap-header p {
        font-size: 11.5px !important;
        line-height: 1.5 !important;
    }

    .header-meta span {
        min-height: 30px;

        font-size: 9px !important;

        padding: 4px 5px !important;
    }

    .back-button {
        min-height: 41px !important;

        font-size: 12px !important;
    }

    .input-card {
        padding: 13px !important;
    }

    .card-title h2 {
        font-size: 17px !important;
    }

    #lessonContent {
        min-height: 195px !important;

        font-size: 13px !important;
    }

    .generate-button {
        min-height: 49px !important;

        font-size: 13px !important;
    }

    .map-actions button {
        font-size: 9.5px !important;
    }

    .mindmap-canvas {
        height: 520px !important;
        min-height: 520px !important;
    }
}

/* ==========================================================
   MOBILE — CANH GIỮA TOÀN BỘ HEADER
   ========================================================== */

@media (max-width: 760px) {

    /* Header */
    .mindmap-header {
        align-items: center !important;
        text-align: center !important;
    }

    /* Khối chính */
    .mindmap-header-main {
        width: 100% !important;
        align-items: center !important;
        text-align: center !important;
    }

    /* Brand */
    .mindmap-brand {
        width: auto !important;
        max-width: 100% !important;

        justify-content: center !important;
        text-align: center !important;
    }

    .mindmap-brand-text {
        text-align: left !important;
    }

    /* Nội dung */
    .mindmap-header-content {
        width: 100% !important;
        text-align: center !important;
    }

    .header-kicker {
        justify-content: center !important;
        text-align: center !important;
    }

    .mindmap-header h1 {
        text-align: center !important;
    }

    .mindmap-header p {
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;

        text-align: center !important;
    }

    /* 4 nhãn tính năng */
    .header-meta {
        justify-content: center !important;
        justify-items: center !important;
        text-align: center !important;
    }

    .header-meta span {
        justify-content: center !important;
        text-align: center !important;
    }

    /* Nút về trang chủ */
    .back-button {
        justify-content: center !important;
        text-align: center !important;
    }
}

/* ==========================================================
   TIÊU ĐỀ MINDMAP – ĐỔI NỘI DUNG TRÊN MOBILE
   ========================================================== */

.title-mobile {
    display: none;
}

@media (max-width: 767px) {
    .title-desktop {
        display: none;
    }

    .title-mobile {
        display: inline;
    }
}

/* ==========================================================
   TIÊU ĐỀ KHUNG KẾT QUẢ
   - Chữ cái đầu viết hoa
   - Không xuống dòng
   - Tiêu đề quá dài tự hiện ...
   ========================================================== */

#mapTitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
}

/* =========================================================
   MINDMAP AI — ADVANCED UI
   Dùng đúng với mindmap_ai.js phiên bản nâng cấp
   Hỗ trợ:
   - depth-0, depth-1, depth-2...
   - branch-0 → branch-9
   - node-important
   - node-highlight
   - 50–70 nodes
   - SVG zoom / pan
   ========================================================= */


/* =========================================================
   1. BIẾN GIAO DIỆN
   ========================================================= */

:root {
    --mindmap-bg: #f8fafc;
    --mindmap-surface: #ffffff;
    --mindmap-border: #dbe3ef;

    --mindmap-text: #172033;
    --mindmap-muted: #64748b;

    --mindmap-shadow:
        0 10px 30px rgba(15, 23, 42, 0.08);

    --mindmap-shadow-hover:
        0 16px 40px rgba(15, 23, 42, 0.16);

    --mindmap-radius: 16px;

    --branch-blue: #2563eb;
    --branch-purple: #7c3aed;
    --branch-cyan: #0891b2;
    --branch-orange: #ea580c;
    --branch-pink: #db2777;
    --branch-green: #16a34a;
    --branch-yellow: #ca8a04;
    --branch-teal: #0f766e;
    --branch-indigo: #4f46e5;
    --branch-red: #be123c;
}


/* =========================================================
   2. KHUNG MINDMAP
   ========================================================= */

#mindmap {
    position: relative;

    width: 100%;
    min-height: 620px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(37, 99, 235, 0.045),
            transparent 28%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(124, 58, 237, 0.045),
            transparent 30%
        ),
        linear-gradient(
            180deg,
            #ffffff 0%,
            #f8fafc 100%
        );

    border: 1px solid var(--mindmap-border);
    border-radius: 20px;

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.07);

    user-select: none;
    touch-action: none;

    cursor: grab;

    isolation: isolate;
}


/* Khi đang kéo sơ đồ */

#mindmap:active {
    cursor: grabbing;
}


/* SVG bên trong */

#mindmap svg {
    display: block;

    width: 100%;
    height: 100%;

    min-height: 620px;

    overflow: visible;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}


/* =========================================================
   3. NỀN SVG
   ========================================================= */

#mindmap svg rect[fill="#fff"],
#mindmap svg rect[fill="white"] {
    transition: opacity 0.25s ease;
}


/* =========================================================
   4. CONNECTOR / ĐƯỜNG NỐI
   ========================================================= */

/*
   JS tạo:
   - path connector
   - path glow
*/

#mindmap svg path {
    vector-effect: non-scaling-stroke;

    transition:
        opacity 0.25s ease,
        stroke-width 0.25s ease;
}


/* Đường nối chính */

#mindmap svg path:not([filter]) {
    opacity: 0.82;
}


/* Đường nối phát sáng */

#mindmap svg path[filter] {
    opacity: 0.13;
}


/* Khi hover node → các connector vẫn rõ */

#mindmap:has(.mind-node:hover) svg path {
    opacity: 0.55;
}


/* =========================================================
   5. NODE CƠ BẢN
   ========================================================= */

.mind-node {
    cursor: pointer;

    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        filter 0.22s ease;
}


/*
   Tất cả rectangle node
*/

.mind-node rect {
    transition:
        fill 0.2s ease,
        stroke 0.2s ease,
        stroke-width 0.2s ease,
        filter 0.2s ease,
        opacity 0.2s ease;
}


/* Text */

.mind-node text {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    pointer-events: none;

    dominant-baseline: middle;

    letter-spacing: 0.05px;
}


/* =========================================================
   6. PHÂN CẤP DEPTH
   ========================================================= */

/*
   DEPTH 0
   Root / chủ đề trung tâm
*/

.mind-node.depth-0 {
    filter:
        drop-shadow(
            0 8px 18px rgba(37, 99, 235, 0.22)
        );
}


.mind-node.depth-0 rect {
    stroke-width: 3px;
}


.mind-node.depth-0 text {
    font-size: 17px;
    font-weight: 800;
}


/*
   DEPTH 1
   Nhánh chính
*/

.mind-node.depth-1 {
    filter:
        drop-shadow(
            0 5px 12px rgba(15, 23, 42, 0.12)
        );
}


.mind-node.depth-1 rect {
    stroke-width: 2.2px;
}


.mind-node.depth-1 text {
    font-size: 14px;
    font-weight: 750;
}


/*
   DEPTH 2
   Nội dung cấp 2
*/

.mind-node.depth-2 {
    filter:
        drop-shadow(
            0 3px 8px rgba(15, 23, 42, 0.09)
        );
}


.mind-node.depth-2 rect {
    stroke-width: 1.8px;
}


.mind-node.depth-2 text {
    font-size: 12.5px;
    font-weight: 650;
}


/*
   DEPTH 3+
   Chi tiết
*/

.mind-node.depth-3 rect,
.mind-node.depth-4 rect,
.mind-node.depth-5 rect,
.mind-node.depth-6 rect {
    stroke-width: 1.4px;
}


.mind-node.depth-3 text,
.mind-node.depth-4 text,
.mind-node.depth-5 text,
.mind-node.depth-6 text {
    font-size: 11.5px;
    font-weight: 550;
}


/* =========================================================
   7. HOVER NODE
   ========================================================= */

.mind-node:hover {
    filter:
        drop-shadow(
            0 8px 18px rgba(15, 23, 42, 0.20)
        );

    opacity: 1;
}


.mind-node:hover rect {
    stroke-width: 2.5px;

    filter:
        brightness(1.035);
}


/* Text khi hover */

.mind-node:hover text {
    font-weight: 750;
}


/* =========================================================
   8. NODE IMPORTANT
   ========================================================= */

/*
   JS:
   .node-important
*/

.mind-node.node-important {
    filter:
        drop-shadow(
            0 7px 16px rgba(234, 88, 12, 0.22)
        );
}


.mind-node.node-important rect {
    stroke-width: 3px;
}


.mind-node.node-important text {
    font-weight: 800;
}


/*
   Dấu hiệu trực quan cho node quan trọng
*/

.mind-node.node-important circle {
    stroke-width: 2px;
}


/* Hover important */

.mind-node.node-important:hover {
    filter:
        drop-shadow(
            0 10px 24px rgba(234, 88, 12, 0.30)
        );
}


.mind-node.node-important:hover rect {
    stroke-width: 3.5px;
}


/* =========================================================
   9. NODE HIGHLIGHT
   ========================================================= */

.mind-node.node-highlight {
    filter:
        drop-shadow(
            0 8px 22px rgba(37, 99, 235, 0.28)
        );
}


.mind-node.node-highlight rect {
    stroke-width: 3px;
}


.mind-node.node-highlight text {
    font-weight: 800;
}


/* Highlight + important */

.mind-node.node-highlight.node-important {
    filter:
        drop-shadow(
            0 10px 26px rgba(124, 58, 237, 0.32)
        );
}


/* =========================================================
   10. MÀU THEO BRANCH
   ========================================================= */

/*
   JS tạo branch-0 → branch-9
*/


/* ---------- Branch 0 ---------- */

.mind-node.branch-0 rect {
    stroke: var(--branch-blue);
}


.mind-node.branch-0 circle {
    fill: var(--branch-blue);
}


/* ---------- Branch 1 ---------- */

.mind-node.branch-1 rect {
    stroke: var(--branch-purple);
}


.mind-node.branch-1 circle {
    fill: var(--branch-purple);
}


/* ---------- Branch 2 ---------- */

.mind-node.branch-2 rect {
    stroke: var(--branch-cyan);
}


.mind-node.branch-2 circle {
    fill: var(--branch-cyan);
}


/* ---------- Branch 3 ---------- */

.mind-node.branch-3 rect {
    stroke: var(--branch-orange);
}


.mind-node.branch-3 circle {
    fill: var(--branch-orange);
}


/* ---------- Branch 4 ---------- */

.mind-node.branch-4 rect {
    stroke: var(--branch-pink);
}


.mind-node.branch-4 circle {
    fill: var(--branch-pink);
}


/* ---------- Branch 5 ---------- */

.mind-node.branch-5 rect {
    stroke: var(--branch-green);
}


.mind-node.branch-5 circle {
    fill: var(--branch-green);
}


/* ---------- Branch 6 ---------- */

.mind-node.branch-6 rect {
    stroke: var(--branch-yellow);
}


.mind-node.branch-6 circle {
    fill: var(--branch-yellow);
}


/* ---------- Branch 7 ---------- */

.mind-node.branch-7 rect {
    stroke: var(--branch-teal);
}


.mind-node.branch-7 circle {
    fill: var(--branch-teal);
}


/* ---------- Branch 8 ---------- */

.mind-node.branch-8 rect {
    stroke: var(--branch-indigo);
}


.mind-node.branch-8 circle {
    fill: var(--branch-indigo);
}


/* ---------- Branch 9 ---------- */

.mind-node.branch-9 rect {
    stroke: var(--branch-red);
}


.mind-node.branch-9 circle {
    fill: var(--branch-red);
}


/* =========================================================
   11. BRANCH + DEPTH
   ========================================================= */

/*
   Cấp 1 phải nổi bật hơn cấp 2.
   Cấp càng sâu → màu nhạt và border nhẹ hơn.
*/


.mind-node.depth-1 rect {
    filter: saturate(1.08);
}


.mind-node.depth-2 rect {
    filter: saturate(0.95);
}


.mind-node.depth-3 rect,
.mind-node.depth-4 rect,
.mind-node.depth-5 rect {
    opacity: 0.94;
}


/* =========================================================
   12. ROOT NODE
   ========================================================= */

.mind-node.depth-0 rect {
    rx: 20;
    ry: 20;
}


.mind-node.depth-0 text {
    font-size: 18px;
    font-weight: 800;
}


/* Root marker */

.mind-node.depth-0 circle {
    stroke: #ffffff;
    stroke-width: 2.5px;
}


/* =========================================================
   13. NODE QUAN TRỌNG Ở CẤP 1
   ========================================================= */

.mind-node.depth-1.node-important rect {
    stroke-width: 3px;
}


.mind-node.depth-1.node-important text {
    font-size: 15px;
    font-weight: 800;
}


/* =========================================================
   14. NODE QUAN TRỌNG Ở CẤP 2
   ========================================================= */

.mind-node.depth-2.node-important rect {
    stroke-width: 2.5px;
}


.mind-node.depth-2.node-important text {
    font-size: 13px;
    font-weight: 750;
}


/* =========================================================
   15. HIỆU ỨNG FOCUS
   ========================================================= */

/*
   Khi hover một node,
   các node khác hơi mờ đi.
*/

#mindmap:has(.mind-node:hover) .mind-node {
    opacity: 0.72;
}


#mindmap:has(.mind-node:hover) .mind-node:hover {
    opacity: 1;
}


/*
   Root luôn giữ độ rõ
*/

#mindmap:has(.mind-node:hover) .mind-node.depth-0 {
    opacity: 1;
}


/* =========================================================
   16. TOOLTIP / TITLE
   ========================================================= */

/*
   JS dùng <title> trong SVG.
   Trình duyệt tự hiển thị tooltip.
*/


.mind-node title {
    pointer-events: none;
}


/* =========================================================
   17. SVG CIRCLE MARKER
   ========================================================= */

.mind-node circle {
    transition:
        r 0.2s ease,
        opacity 0.2s ease,
        stroke-width 0.2s ease;
}


.mind-node:hover circle {
    stroke-width: 3px;
}


/* =========================================================
   18. NÚT ĐIỀU KHIỂN MINDMAP
   ========================================================= */

#againBtn,
#fitBtn,
#pngBtn {
    border-radius: 10px;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}


#againBtn:hover,
#fitBtn:hover,
#pngBtn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 5px 14px rgba(15, 23, 42, 0.12);
}


#againBtn:active,
#fitBtn:active,
#pngBtn:active {
    transform: translateY(0);
}


/* =========================================================
   19. KHU VỰC KẾT QUẢ
   ========================================================= */

#resultSection {
    width: 100%;
}


#resultSection .card,
#resultSection .mindmap-card {
    border-radius: 18px;

    border:
        1px solid
        var(--mindmap-border);

    box-shadow:
        0 8px 25px rgba(15, 23, 42, 0.06);
}


/* =========================================================
   20. TITLE + SUMMARY
   ========================================================= */

#mapTitle {
    font-weight: 800;

    color: var(--mindmap-text);

    line-height: 1.3;
}


#mapSummary {
    color: var(--mindmap-muted);

    line-height: 1.6;
}


/* =========================================================
   21. RESPONSIVE TABLET
   ========================================================= */

@media (max-width: 992px) {

    #mindmap {
        min-height: 560px;

        border-radius: 16px;
    }

    #mindmap svg {
        min-height: 560px;
    }

    .mind-node.depth-0 text {
        font-size: 16px;
    }

    .mind-node.depth-1 text {
        font-size: 13px;
    }

    .mind-node.depth-2 text {
        font-size: 11.5px;
    }

    .mind-node.depth-3 text,
    .mind-node.depth-4 text {
        font-size: 10.5px;
    }
}


/* =========================================================
   22. MOBILE
   ========================================================= */

@media (max-width: 768px) {

    #mindmap {
        min-height: 480px;

        border-radius: 14px;

        /*
           Cho phép người dùng thao tác
           bằng touch trên điện thoại.
        */

        touch-action: none;
    }


    #mindmap svg {
        min-height: 480px;
    }


    /*
       Giảm độ nặng của shadow trên mobile
       để tránh lag khi có 50–70 node.
    */

    .mind-node {
        filter: none !important;
    }


    .mind-node:hover {
        filter:
            drop-shadow(
                0 4px 8px rgba(15, 23, 42, 0.14)
            ) !important;
    }


    .mind-node.depth-0 text {
        font-size: 15px;
    }


    .mind-node.depth-1 text {
        font-size: 12px;
    }


    .mind-node.depth-2 text {
        font-size: 10.5px;
    }


    .mind-node.depth-3 text,
    .mind-node.depth-4 text,
    .mind-node.depth-5 text {
        font-size: 9.5px;
    }


    .mind-node.depth-1.node-important text {
        font-size: 13px;
    }


    .mind-node.depth-2.node-important text {
        font-size: 11px;
    }


    #againBtn,
    #fitBtn,
    #pngBtn {
        min-height: 40px;

        padding:
            8px 12px;

        font-size: 13px;
    }
}


/* =========================================================
   23. MOBILE NHỎ
   ========================================================= */

@media (max-width: 480px) {

    #mindmap {
        min-height: 420px;

        border-radius: 12px;
    }


    #mindmap svg {
        min-height: 420px;
    }


    .mind-node.depth-0 text {
        font-size: 13px;
    }


    .mind-node.depth-1 text {
        font-size: 10.5px;
    }


    .mind-node.depth-2 text {
        font-size: 9px;
    }


    .mind-node.depth-3 text,
    .mind-node.depth-4 text,
    .mind-node.depth-5 text {
        font-size: 8.5px;
    }


    .mind-node.depth-0 rect {
        stroke-width: 2px;
    }


    .mind-node.depth-1 rect {
        stroke-width: 1.8px;
    }


    .mind-node.depth-2 rect,
    .mind-node.depth-3 rect {
        stroke-width: 1.2px;
    }
}


/* =========================================================
   24. DARK MODE
   ========================================================= */

@media (prefers-color-scheme: dark) {

    #mindmap {
        background:
            radial-gradient(
                circle at 20% 20%,
                rgba(37, 99, 235, 0.10),
                transparent 30%
            ),
            radial-gradient(
                circle at 80% 80%,
                rgba(124, 58, 237, 0.10),
                transparent 30%
            ),
            #0f172a;

        border-color:
            rgba(148, 163, 184, 0.20);
    }

}


/* =========================================================
   25. GIẢM CHUYỂN ĐỘNG
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .mind-node,
    .mind-node rect,
    .mind-node text,
    .mind-node circle,
    #againBtn,
    #fitBtn,
    #pngBtn {
        transition: none !important;
    }
}


/* =========================================================
   26. TỐI ƯU CHO 50–70 NODE
   ========================================================= */

/*
   SVG nhiều node → tránh các hiệu ứng CSS quá nặng.
*/

.mind-node {
    contain: layout style;
}


/*
   Không để text tạo cảm giác quá nặng.
*/

.mind-node text {
    text-rendering: geometricPrecision;
}


/*
   Giữ connector phía sau node.
*/

#mindmap svg path {
    pointer-events: none;
}


#mindmap svg .mind-node {
    pointer-events: all;
}


/* =========================================================
   27. TRẠNG THÁI NODE ĐƯỢC CHỌN
   ========================================================= */

.mind-node.selected rect {
    stroke-width: 3.5px;

    filter:
        brightness(1.05)
        drop-shadow(
            0 0 10px rgba(37, 99, 235, 0.28)
        );
}


.mind-node.selected text {
    font-weight: 800;
}


/* =========================================================
   28. NODE EVIDENCE
   ========================================================= */

.mind-node[data-evidence] {
    cursor: help;
}


/* =========================================================
   29. BRANCH MARKER
   ========================================================= */

.mind-node.branch-0 circle,
.mind-node.branch-1 circle,
.mind-node.branch-2 circle,
.mind-node.branch-3 circle,
.mind-node.branch-4 circle,
.mind-node.branch-5 circle,
.mind-node.branch-6 circle,
.mind-node.branch-7 circle,
.mind-node.branch-8 circle,
.mind-node.branch-9 circle {
    opacity: 0.95;
}


/* =========================================================
   30. KẾT THÚC
   ========================================================= */

/* =========================================================
   KIỂU 4 — CÂY PHÂN CẤP: NÉT MỎNG / GỌN
   Chỉ áp dụng cho layout hierarchy.
   Không ảnh hưởng short / medium / detailed.
   ========================================================= */

/* Đường nối chính */
#mindmap svg[data-layout="hierarchy"] .mindmap-links path:not([filter]) {
    stroke-width: 1.45px !important;
}

/* Đường glow: mỏng và nhẹ hơn */
#mindmap svg[data-layout="hierarchy"] .mindmap-links path[filter] {
    stroke-width: 2.2px !important;
    opacity: 0.07 !important;
}

/* Node cấp gốc */
#mindmap svg[data-layout="hierarchy"] .mind-node.depth-0 rect {
    stroke-width: 1.35px !important;
}

/* Nhánh cấp 1 */
#mindmap svg[data-layout="hierarchy"] .mind-node.depth-1 rect {
    stroke-width: 1.15px !important;
}

/* Các cấp sâu hơn */
#mindmap svg[data-layout="hierarchy"] .mind-node.depth-2 rect,
#mindmap svg[data-layout="hierarchy"] .mind-node.depth-3 rect,
#mindmap svg[data-layout="hierarchy"] .mind-node.depth-4 rect,
#mindmap svg[data-layout="hierarchy"] .mind-node.depth-5 rect,
#mindmap svg[data-layout="hierarchy"] .mind-node.depth-6 rect {
    stroke-width: 0.9px !important;
}

/* Node quan trọng: vẫn nổi bật nhưng không bị dày */
#mindmap svg[data-layout="hierarchy"] .mind-node.node-important rect {
    stroke-width: 1.3px !important;
}

/* Hover: chỉ tăng rất nhẹ */
#mindmap svg[data-layout="hierarchy"] .mind-node:hover rect {
    stroke-width: 1.45px !important;
}

/* Node được chọn */
#mindmap svg[data-layout="hierarchy"] .mind-node.selected rect {
    stroke-width: 1.8px !important;
}

/* Marker tròn nhỏ cũng mảnh hơn */
#mindmap svg[data-layout="hierarchy"] .mind-node circle {
    stroke-width: 0.7px !important;
}


/* =========================================================
   KIỂU 5 — XƯƠNG CÁ (FISHBONE)
   Chỉ áp dụng cho layout fishbone.
   Không ảnh hưởng 4 kiểu cũ.
   ========================================================= */

/* Canvas fishbone rộng và thoáng */
#mindmap svg[data-layout="fishbone"] {
    background: #fbfdff;
}

/* Xương sống / connector: mảnh, mềm */
#mindmap svg[data-layout="fishbone"] .mindmap-links path:not([filter]):not(.fishbone-taper):not(.fishbone-taper-glow) {
    stroke-width: 1.35px !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    opacity: 0.78 !important;
}

/*
   QUAN TRỌNG:
   fishbone-taper và fishbone-taper-glow có stroke-width riêng
   do JS sinh ra theo từng đoạn. Không được để rule connector
   cố định 1.35px ghi đè chúng.
*/
#mindmap svg[data-layout="fishbone"] .mindmap-links path.fishbone-taper {
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

#mindmap svg[data-layout="fishbone"] .mindmap-links path.fishbone-taper-glow {
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* Glow rất nhẹ */
#mindmap svg[data-layout="fishbone"] .mindmap-links path[filter] {
    stroke-width: 2.4px !important;
    opacity: 0.055 !important;
}

/* Root vẫn là điểm nhấn */
#mindmap svg[data-layout="fishbone"] .mind-node.depth-0 rect {
    stroke-width: 1.5px !important;
}

/* Các "xương sườn" cấp 1 */
#mindmap svg[data-layout="fishbone"] .mind-node.depth-1 rect {
    stroke-width: 1.15px !important;
}

/* Node cấp sâu mảnh hơn */
#mindmap svg[data-layout="fishbone"] .mind-node.depth-2 rect,
#mindmap svg[data-layout="fishbone"] .mind-node.depth-3 rect,
#mindmap svg[data-layout="fishbone"] .mind-node.depth-4 rect,
#mindmap svg[data-layout="fishbone"] .mind-node.depth-5 rect,
#mindmap svg[data-layout="fishbone"] .mind-node.depth-6 rect {
    stroke-width: 0.9px !important;
}

/* Important không bị quá nặng */
#mindmap svg[data-layout="fishbone"] .mind-node.node-important rect {
    stroke-width: 1.3px !important;
}

/* Hover nhẹ */
#mindmap svg[data-layout="fishbone"] .mind-node:hover rect {
    stroke-width: 1.45px !important;
}

/* Selected */
#mindmap svg[data-layout="fishbone"] .mind-node.selected rect {
    stroke-width: 1.8px !important;
}

/* Marker nhỏ gọn */
#mindmap svg[data-layout="fishbone"] .mind-node circle {
    stroke-width: 0.7px !important;
}

/* Giảm shadow cho cảm giác giống mind map vẽ tay */
#mindmap svg[data-layout="fishbone"] .mind-node {
    filter: none;
}

#mindmap svg[data-layout="fishbone"] .mind-node:hover {
    filter:
        drop-shadow(
            0 5px 10px rgba(15, 23, 42, 0.12)
        );
}

/* ==========================================================
   FONT FIX — TAHOMA
   Không sử dụng Inter / Arial / Segoe UI / Roboto
   ========================================================== */

.mindmap-page,
.mindmap-page *,
.mindmap-page svg,
.mindmap-page svg text,
.mind-node text {
    font-family: Tahoma, sans-serif !important;
}