        :root {
            --navy: #071525;
            --navy-2: #0d2040;
            --gold: #c8a84b;
            --gold-light: #e8c97a;
            --gold-pale: #f7edcf;
            --cream: #f8f5ef;
            --white: #ffffff;
            --g100: #f2f2f5;
            --g200: #e4e4ea;
            --g400: #9494a6;
            --g600: #505065;
            --text: #0f1020;
            --ph-blue: #1a2fa0;
            --ph-blue-dark: #111f7a;
            --ph-blue-glow: rgba(26, 47, 160, 0.35);
        }

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

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: 'Sarabun', sans-serif;
            background: var(--cream);
            color: var(--text);
            overflow-x: hidden;
            min-height: 100vh;
            display: flex;
            flex-direction: column;

        }

        /* ── Main wrap ── */
        .main-wrap {
            flex: 1;
            max-width: 1320px;
            margin: 0 auto;
            padding: 44px 32px 80px;
        }

        /* ── Filter bar ── */
        .filter-bar {
            background: var(--white);
            border: 1px solid var(--g200);
            border-radius: 6px;
            padding: 16px 22px;
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
            margin-bottom: 52px;
            box-shadow: 0 2px 16px rgba(7, 21, 37, .06);
        }

        .filter-label {
            font-size: .78rem;
            font-weight: 700;
            color: var(--navy);
            white-space: nowrap;
            flex-shrink: 0;
        }

        .filter-btns {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            flex: 1;
        }

        .filter-btn {
            background: var(--g100);
            border: 1px solid var(--g200);
            color: var(--g600);
            font-family: 'Sarabun', sans-serif;
            font-size: .76rem;
            font-weight: 500;
            padding: 6px 18px;
            border-radius: 20px;
            cursor: pointer;
            transition: all .18s;
        }

        .filter-btn:hover,
        .filter-btn.active {
            background: var(--navy);
            color: var(--gold-light);
            border-color: var(--navy);
        }

        .search-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: auto;
        }

        .search-input {
            background: var(--g100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239494a6' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
            border: 1px solid var(--g200);
            font-family: 'Sarabun', sans-serif;
            font-size: .78rem;
            padding: 7px 14px 7px 36px;
            border-radius: 20px;
            outline: none;
            transition: all .2s;
            width: 220px;
        }

        .search-input:focus {
            border-color: var(--gold);
            background-color: var(--white);
            box-shadow: 0 0 0 3px rgba(200, 168, 75, .12);
        }

        /* ── Org tree ── */
        .tier {
            margin-bottom: 0;
        }

        .tier-connector {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 8px 0;
        }

        .connector-line {
            width: 2px;
            height: 28px;
            background: linear-gradient(to bottom, rgba(200, 168, 75, .5), rgba(200, 168, 75, .15));
        }

        /* ── tier-row: ให้การ์ดทุกใบในแถวเดียวกันสูงเท่ากัน ── */
        .tier-row {
            display: flex;
            justify-content: center;
            gap: 24px;
            flex-wrap: wrap;
            padding: 4px 0;
            align-items: stretch;
            /* <-- สำคัญ: ให้ทุกการ์ดสูงเท่ากัน */
        }

        .tier-label {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 28px;
        }

        .tier-label-line {
            flex: 1;
            height: 1px;
            background: var(--g200);
        }

        .tier-label-text {
            font-size: 1rem;
            font-weight: 700;
            color: var(--g400);
            letter-spacing: .12em;
            text-transform: uppercase;
            white-space: nowrap;
        }

        /* ── Card wrapper ── */
        .card-wrapper {
            cursor: pointer;
            flex-shrink: 0;
            position: relative;
            background: #ffffff;
            border-radius: 12px;
            box-shadow: 0 4px 24px rgba(26, 47, 160, 0.13);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            /* ← ให้ card-info ยืดเต็มความกว้าง */
            border: 2px solid #c5cbee;
            width: 180px;
            /* กว้างเท่ากันทุกใบ */
            z-index: 2;

            opacity: 0;
            transform: translateY(30px) scale(0.96);
            transition:
                opacity 0.5s ease,
                transform 0.5s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease;
        }

        .card-wrapper.visible {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        .card-wrapper:hover {
            transform: translateY(-8px) scale(1.03);
            box-shadow:
                0 16px 40px var(--ph-blue-glow),
                0 0 0 1px var(--ph-blue);
            border-color: var(--ph-blue);
            z-index: 10;
        }

        /* shimmer overlay on hover */
        .card-wrapper::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(120deg,
                    transparent 0%,
                    rgba(255, 255, 255, 0.18) 40%,
                    rgba(255, 255, 255, 0.45) 50%,
                    rgba(255, 255, 255, 0.18) 60%,
                    transparent 100%);
            background-size: 250% 100%;
            background-position: -100% 0;
            z-index: 5;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .card-wrapper:hover::before {
            opacity: 1;
            animation: shimmer 0.75s ease forwards;
        }

        @keyframes shimmer {
            0% {
                background-position: -100% 0;
            }

            100% {
                background-position: 200% 0;
            }
        }

        /* ── Photo wrap ── */
        .card-photo-wrap {
            position: relative;
            width: 100%;
            flex-shrink: 0;
        }

        .card-photo {
            width: 100%;
            height: 220px;
            overflow: hidden;
            background: #e8ecf8;
        }

        .card-photo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: top center;
            display: block;
            transition: transform 0.5s ease;
            filter: saturate(0.9);
        }

        .card-wrapper:hover .card-photo img {
            transform: scale(1.08);
            filter: saturate(1.15) brightness(1.04);
        }

        /* ── Logo badge ── */
        .card-logo {
            position: absolute;
            top: 8px;
            left: 8px;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 3;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .card-wrapper:hover .card-logo {
            transform: scale(1.15) rotate(-5deg);
            box-shadow: 0 4px 14px rgba(201, 168, 76, 0.5);
        }

        .card-logo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* placeholder เมื่อรูปโหลดไม่ได้ */
        .card-photo-ph {
            width: 100%;
            height: 220px;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            background: linear-gradient(180deg, #dce2f7 0%, #b0bcee 100%);
        }

        .card-photo-ph svg {
            width: 65%;
            height: 80%;
            opacity: 0.30;
            fill: var(--ph-blue);
        }

        /* ── Info bar ──
           flex: 1 ทำให้ card-info ยืดเต็มพื้นที่ที่เหลือ
           ทำให้ทุกการ์ดในแถวเดียวกันมีสีฟ้าสูงเท่ากันเมื่อใช้ align-items: stretch บน tier-row
        ── */
        .card-info {
            padding: 10px 10px 12px;
            text-align: center;
            width: 100%;
            background: var(--ph-blue);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            flex: 1;
            /* ← ยืดเต็มพื้นที่ที่เหลือ */
            transition: background 0.3s ease;
        }

        .card-wrapper:hover .card-info {
            background: var(--ph-blue-dark);
        }

        .card-name {
            font-size: 13px;
            font-weight: 700;
            color: #ffffff;
            line-height: 1.4;
            margin-bottom: 3px;
            transition: color 0.3s;
            white-space: nowrap;
            overflow: hidden;
            /* ลบ text-overflow: ellipsis ออก */
            width: 100%;
            display: block;
        }

        .card-wrapper:hover .card-name {
            color: var(--gold-light);
        }

        .card-pos {
            font-size: 11px;
            font-weight: 500;
            color: #c5d0f5;
            line-height: 1.4;
        }

        /* ── Stagger delays ── */
        #sec-tier1 .card-wrapper:nth-child(1) {
            transition-delay: 0.05s;
        }

        #sec-tier2 .card-wrapper:nth-child(1) {
            transition-delay: 0.12s;
        }

        #sec-tier2 .card-wrapper:nth-child(2) {
            transition-delay: 0.19s;
        }

        #sec-tier2 .card-wrapper:nth-child(3) {
            transition-delay: 0.26s;
        }

        #sec-tier2 .card-wrapper:nth-child(4) {
            transition-delay: 0.33s;
        }

        #sec-tier3 .card-wrapper:nth-child(1) {
            transition-delay: 0.40s;
        }

        #sec-tier3 .card-wrapper:nth-child(2) {
            transition-delay: 0.47s;
        }

        #sec-tier3 .card-wrapper:nth-child(3) {
            transition-delay: 0.54s;
        }

        /* ── Animations ── */
        .fade-up {
            opacity: 0;
            transform: translateY(20px);
            animation: fadeUp .6s ease forwards;
        }

        @keyframes fadeUp {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .d1 {
            animation-delay: .05s;
        }

        .d2 {
            animation-delay: .12s;
        }

        .d3 {
            animation-delay: .20s;
        }

        .d4 {
            animation-delay: .28s;
        }

        /* ── Modal ── */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(5, 12, 28, .82);
            backdrop-filter: blur(10px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 0;
            pointer-events: none;
            transition: opacity .28s;
        }

        .modal-overlay.open {
            opacity: 1;
            pointer-events: all;
        }

        .modal-box {
            background: var(--white);
            border-radius: 22px;
            max-width: 640px;
            width: 100%;
            box-shadow: 0 40px 100px rgba(5, 12, 28, .6);
            transform: translateY(44px) scale(.93);
            transition: transform .34s cubic-bezier(.34, 1.56, .64, 1), opacity .28s;
            opacity: 0;
            overflow: hidden;
            position: relative;
            max-height: 92vh;
            overflow-y: auto;
        }

        .modal-overlay.open .modal-box {
            transform: translateY(0) scale(1);
            opacity: 1;
        }

        .modal-banner {
            background: linear-gradient(140deg, #2080c8 0%, #0f5aa0 50%, #082d5e 100%);
            padding: 32px 28px 0;
            position: relative;
            overflow: hidden;
            min-height: 170px;
        }

        .modal-banner::before {
            content: '';
            position: absolute;
            top: -65px;
            right: -65px;
            width: 210px;
            height: 210px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, .07);
        }

        .modal-banner-row {
            display: flex;
            align-items: flex-end;
            gap: 26px;
            position: relative;
            z-index: 1;
        }

        .modal-photo {
            width: 120px;
            height: 148px;
            flex-shrink: 0;
            border-radius: 12px 12px 0 0;
            overflow: hidden;
            background: linear-gradient(160deg, #3a9ae8, #1c72c8);
            display: flex;
            align-items: flex-end;
            justify-content: center;
            border: 2px solid rgba(255, 255, 255, .18);
            border-bottom: none;
            box-shadow: 0 -6px 28px rgba(0, 0, 0, .3);
        }

        .modal-photo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: top;
            display: block;
        }

        .modal-avatar-lg {
            font-size: 5rem;
            line-height: 1;
            padding-bottom: 6px;
        }

        .modal-text {
            padding-bottom: 22px;
            flex: 1;
        }

        .modal-name {
            font-family: 'Noto Serif Thai', serif;
            font-size: 1.45rem;
            font-weight: 700;
            color: #fff;
            margin-bottom: 6px;
        }

        .modal-pos {
            font-size: .84rem;
            color: rgba(255, 255, 255, .65);
            line-height: 1.5;
            margin-bottom: 10px;
        }

        .modal-badge {
            display: inline-block;
            background: rgba(200, 168, 75, .2);
            border: 1px solid rgba(200, 168, 75, .45);
            color: var(--gold-light);
            font-size: .66rem;
            font-weight: 700;
            padding: 3px 12px;
            border-radius: 10px;
            letter-spacing: .06em;
        }

        .modal-close {
            position: absolute;
            top: 14px;
            right: 16px;
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: rgba(255, 255, 255, .12);
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: .9rem;
            color: rgba(255, 255, 255, .75);
            transition: all .18s;
            z-index: 10;
        }

        .modal-close:hover {
            background: rgba(255, 255, 255, .25);
            color: #fff;
        }

        .modal-body {
            padding: 28px;
        }

        .sec-label {
            font-size: .68rem;
            font-weight: 700;
            color: var(--g400);
            letter-spacing: .1em;
            text-transform: uppercase;
            margin-bottom: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .sec-label::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--g200);
        }

        .info-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-bottom: 28px;
        }

        .info-card {
            background: var(--g100);
            border-radius: 10px;
            padding: 12px 14px;
            border: 1px solid var(--g200);
        }

        .info-card-label {
            font-size: .62rem;
            font-weight: 700;
            color: var(--g400);
            letter-spacing: .06em;
            text-transform: uppercase;
            margin-bottom: 3px;
        }

        .info-card-val {
            font-size: .86rem;
            font-weight: 700;
            color: var(--navy);
        }

        .job-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 11px;
            margin-bottom: 24px;
        }

        .job-item {
            background: linear-gradient(135deg, rgba(21, 100, 168, .05), rgba(7, 21, 37, .02));
            border: 1px solid rgba(21, 100, 168, .13);
            border-left: 4px solid #1e78c8;
            border-radius: 10px;
            padding: 14px 16px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        .job-icon {
            font-size: 1.1rem;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .job-text strong {
            display: block;
            font-size: .84rem;
            font-weight: 700;
            color: var(--navy);
        }

        /* ── Responsive ── */
        @media (max-width: 960px) {
            .header-status {
                display: none;
            }

            .info-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 680px) {
            .tier-row {
                gap: 16px;
            }

            .filter-bar {
                flex-direction: column;
                align-items: flex-start;
            }

            .search-wrap {
                margin-left: 0;
                width: 100%;
            }

            .search-input {
                width: 100%;
            }
        }