        :root {
            --navy: #1A2744;
            --white: #ffffff;
            --ink: #131217;
            --dark: #0F172A;
            --indigo: #2029BD;
            --indigo-2: #161C8C;
            --teal: #14CAF4;
            --teal-2: #0FA9CC;
            --signal: #14CAF4;
            --signal-dk: #0FA9CC;
            --gold: #14CAF4;
            --brand-grad: linear-gradient(135deg, var(--teal) 0%, var(--indigo) 100%);
            --paper: #F8F8F8;
            --surface: #FFFFFF;
            --line: #EFF5F8;
            --muted: #6B6F7D;
            --color-gray-light: #e5e5e5;
            --text: #1A2744;
            --ink-soft: #4a4a4a;
            --tag-bg: #eef0fb;
            --tag-ink: #3552ca;
            --radius: 14px;
            --radius-sm: 8px;
            --book-shadow: 0 8px 28px rgba(20, 20, 40, 0.12), 0 2px 8px rgba(20, 20, 40, 0.06);
            --shadow: 0 18px 40px -22px rgba(15, 23, 42, 0.35);
            --shadow-sm: 0 8px 20px -12px rgba(15, 23, 42, 0.25);
            --serif: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
            --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

            --danger: #E5484D;
            --success: #16A34A;
            --preview: #2563EB;

        }

        .bg-color-1 {
            background: var(--paper);
        }

        .bg-color-2 {
            background: var(--surface);
            border-top: 1px solid var(--line);
            border-bottom: 1px solid var(--line);
        }


        .wrap {
            max-width: 1240px;
            margin: 0 auto;
            padding: 0 32px;
            position: relative;
        }

        @media (max-width:640px) {
            .wrap {
                padding: 0 20px;
            }
        }

        /* ---------------- sections ---------------- */
        .section-pd-76 {
            padding: 76px 0;
        }

        .section-pd-80 {
            padding: 80px 0;
        }

        .sec-head {
            max-width: 720px;
            margin: 0 auto 46px;
            text-align: center;
        }

        .sec-head-display {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            flex-wrap: wrap;
            gap: 16px;
        }

        .sec-head.left {
            margin: 0 0 42px;
            text-align: left;
            max-width: none;
        }

        .eyebrow {
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--signal);
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .eyebrow::before {
            content: "";
            width: 16px;
            height: 2px;
            background: var(--signal);
            border-radius: 2px;
        }

        .sec-head h2 {
            font-size: clamp(26px, 3vw, 36px);
            margin-top: 12px;
            font-weight: normal;
        }

        .sec-head p {
            color: var(--muted);
            margin-top: 14px;
            line-height: 1.65;
        }

        /* ---------------- feature grid ---------------- */
        .feature-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 32px 44px;
        }

        .feature {
            display: flex;
            gap: 16px;
        }

        .icon-circle {
            width: 46px;
            height: 46px;
            border-radius: 50%;
            background: var(--indigo);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            color: #fff;
            font-size: 16px;
            font-family: var(--serif);
        }

        .feature h4 {
            font-size: 16.5px;
            margin-bottom: 6px;
            font-weight: 600;
        }

        .feature p {
            color: var(--muted);
            font-size: 14.5px;
            line-height: 1.6;
        }

        @media (max-width:700px) {
            .feature-grid {
                grid-template-columns: 1fr;
            }
        }

        /* ---------------- news / sponsor rows ---------------- */
        .news-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 22px;
        }

        @media (max-width:820px) {
            .news-grid {
                grid-template-columns: 1fr;
            }
        }

        .news-card {
            border: 1px solid var(--line);
            border-radius: var(--radius);
            overflow: hidden;
            background: var(--surface);
            transition: box-shadow .2s ease, transform .2s ease;
        }

        .news-card:hover {
            box-shadow: var(--shadow);
            transform: translateY(-3px);
        }

        .news-card .thumb {
            height: 220px;
            background: var(--indigo);
        }

        .news-card .body {
            padding: 20px;
        }

        .news-card .date {
            font-size: 12px;
            color: var(--muted);
            margin-bottom: 8px;
            font-weight: 600;
        }

        .news-card h4 {
            font-size: 15.5px;
            line-height: 1.4;
            margin-bottom: 14px;
            font-weight: 400;
        }

        .news-card a {
            font-size: 13px;
            font-weight: 700;
            color: var(--indigo);
        }

        .news-card .thumb {
            aspect-ratio: 16/9;
            width: 100%;
            background: var(--indigo);
            overflow: hidden;
        }

        .news-card .thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            display: block;
        }

        .btn-new {
            display: inline-block;
            font-size: 13px;
            font-weight: 700;
            padding: 8px 20px;
            border-radius: 999px;
            border: 1px solid transparent;
            cursor: pointer;
            transition: opacity .15s ease, transform .15s ease, background .15s ease, color .15s ease;
        }

        .btn-new:active {
            transform: translateY(1px);
        }

        .btn-navy {
            background: var(--navy);
            color: #fff;
        }

        .btn-navy:hover {
            background: var(--indigo);
        }

        .btn-signal {
            background: var(--signal);
            color: #fff;
        }

        .btn-signal:hover {
            background: var(--signal-dk);
        }

        .btn-outline {
            background: transparent;
            color: var(--ink);
            border-color: var(--ink);
        }

        .btn-outline:hover {
            background: var(--ink);
            color: #fff;
        }

        .btn-black {
            background: var(--ink);
            color: #fff;
            width: 100%;
            text-align: center;
            border: none;
            font-size: 14px;
            padding: 14px 20px;
            border-radius: var(--radius-sm);
        }

        .btn-black:hover {
            background: var(--indigo);
        }

        /* ---------------- footer ---------------- */
        footer.site {
            background: var(--ink);
            color: var(--paper);
            padding: 56px 0 26px;

        }

        .foot-grid {
            display: grid;
            grid-template-columns: 1.4fr 1fr 1fr 1fr;
            gap: 36px;
        }

        @media (max-width:800px) {
            .foot-grid {
                grid-template-columns: 1fr 1fr;
            }
        }

        .foot-logo {
            color: #fff;
            font-weight: 600;
            font-size: 20px;
            margin-bottom: 12px;
            font-family: var(--serif);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .foot-grid h5 {
            color: #fff;
            font-size: 12.5px;
            text-transform: uppercase;
            letter-spacing: 0.09em;
            margin-bottom: 14px;
        }

        .foot-bottom {
            margin-top: 40px;
            padding-top: 18px;
            border-top: 1px solid rgba(255, 255, 255, 0.12);
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 10px;
            font-size: 12.5px;
            color: var(--paper);
        }

        .foot-grid ul {
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .foot-grid li {
            font-size: 14px;
            padding-left: 0;
            list-style-type: none;
        }

        .foot-grid li a:hover {
            color: #fff;
        }

        .foot-grid li::before,
        .foot-grid li::marker {
            content: none;
        }

        .foot-grid li a {
            color: var(--paper);
        }

        p.text-foot-grid {
            max-width: 32ch;
            line-height: 1.7;
            font-size: 14px;
        }

        /* ---------------- interior page title block (replaces old hero-banner) ---------------- */
        .page-title {
            padding: 30px 0 30px;
            border-bottom: 1px solid var(--line);
        }

        .page-title .eyebrow {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .page-title h1 {
            font-size: clamp(26px, 3.6vw, 36px);
            margin-top: 14px;
            font-weight: normal;
        }

        .page-title .crumb {
            margin-top: 10px;
            font-size: 13px;
            font-weight: 600;
            color: var(--muted);
        }

        .page-title .crumb span {
            color: var(--ink);
        }

        .sponsor-row {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            justify-content: center;
        }

        .sponsor-row .sp {

            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            background: var(--surface);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            color: var(--muted);
            font-size: 12px;
            text-align: center;
            padding: 8px;
            transition: border-color .2s ease, color .2s ease;
            overflow: hidden;
            box-sizing: border-box;
        }

        .sponsor-row .sp img {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
            display: block;
        }

        .sponsor-row .sp:hover {
            border-color: var(--indigo);
            color: var(--ink);
        }

        @media (max-width:640px) {
            .sponsor-row .sp {
                width: 104px;
                height: 62px;
                padding: 6px;
            }
        }

        @media (max-width:400px) {
            .sponsor-row .sp {
                width: 88px;
                height: 52px;
                padding: 5px;
            }
        }

        .results-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 22px;
            font-size: 14px;
            color: var(--muted);
            flex-wrap: wrap;
            gap: 10px;
        }

        .pagination {
            display: flex;
            justify-content: center;
            margin-top: 20px;
        }

        .pagination ul {
            display: flex;
            align-items: center;
            gap: 10px;
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .pagination ul li {
            margin: 0;
            list-style: none;
        }

        .pagination ul li a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            background: var(--surface);
            color: var(--ink);
            font-size: 13px;
            font-weight: 700;
            box-shadow: var(--shadow-sm);
            text-decoration: none;
            transition: background .15s ease, color .15s ease, transform .15s ease;
        }

        .pagination ul li a:hover {
            transform: translateY(-2px);
            color: var(--indigo);
        }

        .pagination ul li a.current_page {
            background: var(--ink);
            color: #fff;
            box-shadow: none;
        }

        .pagination ul li a.current_page:hover {
            transform: none;
            color: #fff;
        }

        /* ---------------- contact ---------------- */
        .contact-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 22px;
            margin-bottom: 0;
        }

        @media (max-width:800px) {
            .contact-grid {
                grid-template-columns: 1fr;
            }
        }

        .contact-card {
            border: 1px solid var(--color-gray-light);
            border-radius: var(--radius);
            padding: 34px 24px;
            text-align: center;
            background: var(--surface);
        }

        .contact-card .icon-circle {
            margin: 0 auto 16px;
            width: 52px;
            height: 52px;
            font-size: 19px;
            background: #EEF0FB;
            color: var(--indigo);
        }

        .contact-card h4 {
            font-size: 16.5px;
            margin-bottom: 8px;
            font-weight: 600;
        }

        .contact-card p {
            color: var(--muted);
            font-size: 14.5px;
            line-height: 1.6;
        }

        .map-frame {
            width: 100%;
            height: 420px;
            margin-top: 44px;
            border-radius: var(--radius);
            overflow: hidden;
            border: 1px solid var(--line);
        }

        .map-frame iframe {
            width: 100%;
            height: 100%;
            border: 0;
        }

        /* ---------------- news detail (single article) ---------------- */
        .article-wrap {
            max-width: 940px;
            margin: 0 auto;
        }

        .article-hero {
            width: 100%;
            /*aspect-ratio: 16/7.6;*/
            border-radius: var(--radius);
            overflow: hidden;
            margin-bottom: 28px;
            background: var(--brand-grad);
            position: relative;
        }

        .article-hero img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            display: block;
        }

        /* video embed block — sits directly under the cover image when the news item has a YouTube link */
        .media-label {
            font-size: 11.5px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--muted);
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
        }

        .media-label svg {
            width: 15px;
            height: 15px;
            color: var(--signal);
            flex-shrink: 0;
        }

        .video-frame {
            width: 100%;
            aspect-ratio: 16/9;
            border-radius: var(--radius);
            overflow: hidden;
            background: #000;
            box-shadow: var(--shadow-sm);
            margin-bottom: 34px;
        }

        .video-frame iframe {
            width: 100%;
            height: 100%;
            border: 0;
            display: block;
        }

        .article-meta-date {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: var(--muted);
            font-weight: normal;
            margin-bottom: 14px;
        }

        .article-meta-date svg {
            width: 15px;
            height: 15px;
            flex-shrink: 0;
        }

        h1.article-title {
            font-size: clamp(20px, 3.2vw, 30px);
            line-height: 1.25;
            margin-bottom: 30px;
            font-weight: normal;
        }

        .article-fields {
            display: flex;
            flex-direction: column;
            gap: 13px;
            margin-bottom: 30px;
        }

        .article-fields p {
            font-size: 14.5px;
            line-height: 1.7;
            color: var(--ink);
        }

        .article-fields p b {
            font-weight: 700;
        }

        .article-body h3 {
            font-size: 16px;
            font-weight: 700;
            margin: 0 0 16px;
        }

        .bio-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 8px;
        }

        .bio-list li {
            position: relative;
            padding-left: 20px;
            font-size: 14.5px;
            line-height: 1.7;
            color: var(--ink);
        }

        .bio-list li::before {
            content: "";
            position: absolute;
            left: 0;
            top: 9px;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--signal);
        }

        .bio-list li b {
            font-weight: 700;
        }

        .related-section {
            border-top: 1px solid var(--line);
            padding-top: 48px;
            margin-top: 56px;
        }

        .related-section h3 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 10px;
        }

        .related-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 22px;
        }

        @media (max-width:900px) {
            .related-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width:640px) {
            .related-grid {
                grid-template-columns: 1fr;
            }
        }

        .ck-content {
            color: var(--ink);
            margin-bottom: 50px;
        }

        .ck-content p {
            font-size: 14.5px;
            line-height: 1.7;
            margin: 0 0 14px;
        }

        .ck-content p strong,
        .ck-content p b {
            font-weight: 700;
        }

        .ck-content a {
            color: var(--indigo);
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        .ck-content h1,
        .ck-content h2,
        .ck-content h3,
        .ck-content h4 {
            font-weight: 700;
            margin: 28px 0 14px;
            font-family: var(--serif);
        }

        .ck-content h1:first-child,
        .ck-content h2:first-child,
        .ck-content h3:first-child {
            margin-top: 0;
        }

        .ck-content ul,
        .ck-content ol {
            margin: 0 0 18px;
            padding: 0;
        }

        .ck-content ul {
            list-style: none;
        }

        .ck-content ul li {
            position: relative;
            padding-left: 20px;
            font-size: 14.5px;
            line-height: 1.7;
            margin-bottom: 12px;
        }

        .ck-content ul li::before {
            content: "";
            position: absolute;
            left: 0;
            top: 9px;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--indigo);
        }

        .ck-content ul li strong,
        .ck-content ul li b {
            font-weight: 700;
        }

        .ck-content ol {
            padding-left: 20px;
        }

        .ck-content ol li {
            font-size: 14.5px;
            line-height: 1.7;
            margin-bottom: 12px;
        }

        .ck-content img {
            max-width: 100%;
            height: auto;
            border-radius: var(--radius-sm);
            display: block;
            margin: 16px 0;
        }

        .ck-content blockquote {
            border-left: 3px solid var(--signal);
            margin: 18px 0;
            padding: 2px 0 2px 18px;
            color: var(--muted);
            font-style: italic;
        }

        .ck-content iframe {
            width: 100% !important;
            height: auto !important;
            aspect-ratio: 16/9;
            max-width: 100%;
            border: 0;
            border-radius: var(--radius);
            display: block;
            margin: 18px 0 24px;
            box-shadow: var(--shadow-sm);
        }

        .ck-content figure.media {
            margin: 18px 0 24px;
        }

        .ck-content figure.media iframe {
            margin: 0;
        }

        .back-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: normal;
            color: var(--muted);
            margin-bottom: 22px;
            transition: color .15s ease, gap .15s ease;
        }

        .back-link svg {
            width: 15px;
            height: 15px;
            flex-shrink: 0;
            transition: transform .15s ease;
        }

        .back-link:hover {
            color: var(--indigo);
            gap: 11px;
        }

        .back-link:hover svg {
            transform: translateX(-2px);
        }

        /* ---------------- listing layout ---------------- */
        .listing {
            display: grid;
            grid-template-columns: 1fr 300px;
            gap: 44px;
            align-items: start;
        }

        @media (max-width:960px) {
            .listing {
                grid-template-columns: 1fr;
            }
        }

        .grid-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 22px;
        }

        @media (max-width:900px) {
            .grid-cards {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width:560px) {
            .grid-cards {
                grid-template-columns: 1fr;
            }
        }

        .p-card {
            border: 1px solid var(--color-gray-light);
            border-radius: var(--radius);
            padding: 22px;
            background: var(--surface);
            transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
            position: relative;
            overflow: hidden;
            display: flex;
            /* เพิ่ม */
            flex-direction: column;
            /* เพิ่ม */
        }

        .p-card::after {
            position: absolute;
            border: 1px solid var(--line);
            top: 14px;
            right: -34px;
            transform: rotate(35deg);
            background: var(--brand-grad);
            color: #fff;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.05em;
            padding: 3px 34px;
            opacity: 0;
            transition: opacity .2s ease;
        }

        .p-card:hover {
            box-shadow: var(--shadow);
            transform: translateY(-3px);
            border: 1px solid var(--line);
            border-color: transparent;
        }

        .p-card:hover::after {
            opacity: 1;
        }

        .p-avatar {
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background: var(--indigo);
            margin-bottom: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 700;
            font-size: 16px;
            font-family: var(--serif);
        }

        .p-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .p-avatar-sm {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--indigo);
            margin-bottom: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 700;
            font-size: 16px;
            font-family: var(--serif);
        }

        .p-avatar-sm img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .p-card h4 {
            font-size: 15px;
            margin-bottom: 4px;
            font-weight: normal;
        }

        .p-card .loc {
            font-size: 12.5px;
            color: var(--muted);
            margin-bottom: 10px;
        }

        .p-card .desc {
            font-size: 13.5px;
            color: var(--muted);
            line-height: 1.55;
            margin-bottom: 14px;
        }

        .p-card-icons {
            display: flex;
            gap: 8px;
            margin-top: auto;
            /* เพิ่ม — ตัวนี้คือคีย์หลัก */
        }

        .p-card-icons span {
            width: 30px;
            height: 30px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--line);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            color: var(--muted);
        }

        /* sidebar */
        .sidebar-box {
            border: 1px solid var(--color-gray-light);
            border-radius: var(--radius);
            padding: 22px;
            margin-bottom: 20px;
            background: var(--surface);
        }

        .sidebar-box h5 {
            font-size: 14.5px;
            margin-bottom: 14px;
            font-family: var(--serif);
            font-weight: 600;
        }

        .search-field form {
            display: flex;
            gap: 8px;
        }

        .search-field input {
            flex: 1;
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            padding: 8px 10px;
            font-size: 13px;
            background: var(--paper);
        }

        .search-field button {
            border: none;
            background: var(--navy);
            color: #fff;
            border-radius: var(--radius-sm);
            width: 42px;
            cursor: pointer;
            display: flex;
            /* เพิ่ม ให้ไอคอนอยู่กลางปุ่มพอดี */
            align-items: center;
            justify-content: center;
        }

        .search-field button:hover {
            background: var(--indigo);
        }

        .check-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 0;
            font-size: 13.5px;
        }

        .check-row label {
            display: flex;
            align-items: center;
            gap: 9px;
        }

        .check-row input[type=checkbox] {
            accent-color: var(--indigo);
            width: 15px;
            height: 15px;
        }

        .check-row span {
            color: var(--muted);
            font-size: 12.5px;
        }

        .show-more {
            color: var(--indigo);
            font-size: 13px;
            font-weight: 700;
            margin-top: 6px;
            display: inline-block;
        }

        .top-rated li {
            display: flex;
            gap: 12px;
            align-items: center;
            margin-bottom: 14px;
        }

        .top-rated .thumb {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            /* เปลี่ยนจาก var(--radius-sm) ให้เป็นวงกลม */
            background: var(--indigo);
            flex-shrink: 0;
            display: flex;
            /* เพิ่ม เพื่อ center ตัวอักษร */
            align-items: center;
            justify-content: center;
            color: #fff !important;
            font-weight: 700;
            font-size: 13px;
            font-family: var(--serif);
            overflow: hidden;
            /* เพิ่ม กันรูปล้นวงกลม */
        }

        .top-rated .thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            /* เพิ่ม ให้รูป fill เต็มวงกลมสวยๆ ไม่บิด */
            border-radius: 50%;
        }

        .top-rated .thumb a {
            color: #fff !important;
        }

        .top-rated a.rate {
            display: block;
            font-size: 13.5px;
            font-weight: 600;
            line-height: 1.2;
            color: var(--color-heading);
        }

        .top-rated a.rate:hover {
            color: var(--indigo);

        }

        .top-rated span {
            font-size: 12px;
            color: var(--muted);
        }

        .xb-marquee__item {
            border: 1px solid var(--line) !important;
            border-radius: var(--radius-sm) !important;

            display: flex;
            align-items: center;
            padding: 15px !important;

            -webkit-border-radius: var(--radius-sm) !important;
            -moz-border-radius: var(--radius-sm) !important;
            -ms-border-radius: var(--radius-sm) !important;
            -o-border-radius: var(--radius-sm) !important;
            margin-right: 30px !important;
            box-shadow: 0px 16px 34px 0px rgba(109, 121, 152, 0.13);
        }

        .img-profile-home {
            border-radius: 8px !important;
        }

        /* ---------------- catalog layout ---------------- */
        .catalog {
            padding: 26px 0 80px;
        }


        /* ---------------- real site book-card component ---------------- */
        .ex-books-layout {
            display: grid;
            gap: 24px;
            align-items: start;
        }

        @media (min-width: 1200px) {
            .ex-books-layout {
                grid-template-columns: 1fr 260px;
            }
        }

        @media (max-width: 1199px) {
            .ex-books-layout {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 900px) {

            .ex-books-layout,
            .ex-about-layout {
                grid-template-columns: 1fr;
            }

        }

        .ex-book-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 24px;
        }

        @media (max-width: 768px) {
            .ex-book-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 14px;
            }
        }

        @media (max-width: 480px) {
            .ex-book-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
        }

        @media (max-width: 360px) {
            .ex-book-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width:600px) {

            .books-toolbar {
                flex-wrap: nowrap;
                /* คงแถวเดียว: Showing ซ้าย ปุ่มขวา ไม่ตกบรรทัด */
            }

            .books-toolbar>span {
                flex-shrink: 1;
                min-width: 0;
                font-size: 12px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .books-toolbar-actions {
                flex-shrink: 0;
                gap: 6px;
            }

            .btn-navy,
            #sidebarNavToggler1 {
                padding: 7px 10px;
                font-size: 12px;
                white-space: nowrap;
            }

            /* จอเล็กมาก ซ่อนข้อความปุ่ม เหลือแค่ไอคอน ป้องกันล้นจอ */
            .btn-navy span,
            #sidebarNavToggler1 span {
                display: none;
            }
        }

        @media (max-width:380px) {

            .btn-navy,
            #sidebarNavToggler1 {
                padding: 8px;
            }
        }

        .ex-book-card {
            border: 1px solid var(--color-gray-light);
            border-radius: var(--radius);
            overflow: hidden;
            background: #fff;
            display: flex;
            flex-direction: column;
            transition: box-shadow .2s ease, transform .2s ease;
        }

        .ex-book-card:hover {
            border: 1px solid var(--color-gray-light);
            box-shadow: var(--shadow);
            transform: translateY(-4px);
        }

        .ex-book-cover-wrap {
            aspect-ratio: 3/4;
            position: relative;
            overflow: hidden;
            background: var(--bg-soft);
            display: block;
        }

        .ex-book-cover-wrap img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .ex-book-cover-wrap.placeholder {
            display: flex;
            align-items: flex-end;
            padding: 18px;
            color: #fff;
            font-family: 'Manrope', sans-serif;
            font-weight: 800;
            font-size: 19px;
            line-height: 1.2;
        }

        .ex-book-cover-wrap.placeholder::before {
            content: "";
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 26px);
        }

        .ex-book-cover-wrap.placeholder span {
            position: relative;
        }

        .ex-book-body {
            padding: 18px 20px 20px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .ex-book-category {
            font-size: 12px;
            font-weight: 500;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--indigo);
            margin: 0 0 6px;
        }

        .ex-book-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text);
            line-height: 1.35;
            margin-bottom: 10px;
        }

        .ex-book-title:hover {
            color: var(--brand);
        }

        .ex-book-meta {
            margin-bottom: 16px;
        }

        .ex-book-meta-row {
            font-size: 13.5px;
            color: var(--muted);
            line-height: 1.8;
            margin: 0;
        }

        .ex-book-meta-row a {
            color: var(--indigo);
        }

        .ex-book-meta-row strong {
            color: var(--text);
            font-weight: 600;
        }

        .ex-book-actions {
            margin-top: auto;
            display: flex;
            gap: 8px;
        }

        .ex-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            font-size: 13.5px;
            font-weight: 700;
            padding: 9px 16px;
            border-radius: 999px;
            cursor: pointer;
            border: 1px solid var(--border);
            background: #fff;
            color: var(--text);
            transition: opacity .15s ease, background .15s ease, transform .15s ease, border-color .15s ease;
        }

        .ex-btn:active {
            transform: translateY(1px);
        }

        .ex-btn-sm {
            padding: 9px 16px;
            font-size: 13.5px;
        }

        .ex-btn-update {
            background: var(--black);
            color: #fff;
            border-color: var(--black);
        }

        .ex-btn-update:hover {
            opacity: .88;
        }

        .ex-btn-fav:hover {
            border-color: var(--ink);
        }

        .ex-btn svg {
            width: 15px;
            height: 15px;
            flex-shrink: 0;
        }

        .ex-book-cover-noimg {
            background: linear-gradient(155deg, #5D7FA6, #2C4560);
        }

        /* ============================================================
   BOOK DETAIL PAGE
   ============================================================ */
        .page-container {
            max-width: 1320px;
            margin: 0 auto;
            padding: 28px 24px 64px;
        }

        .book-back-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
            font-size: 0.92rem;
            color: var(--ink-soft);
            background: var(--paper);
            border: 1px solid var(--line);
            border-radius: 999px;
            padding: 9px 18px;
            margin-bottom: 28px;
            box-shadow: var(--shadow);
            transition: border-color 0.15s ease, color 0.15s ease;
        }

        .book-back-link:hover {
            color: var(--blue);
            border-color: var(--blue);
        }

        .book-back-link svg {
            width: 16px;
            height: 16px;
        }

        .book-detail {
            display: grid;
            grid-template-columns: 400px 1fr;
            gap: 44px;
            background: #ffffff;
            border: 1px solid var(--color-gray-light);
            border-radius: 16px;
            padding: 36px;
            box-shadow: var(--shadow);
            margin-bottom: 56px;
        }

        .book-cover-wrap {
            position: sticky;
            top: 92px;
            align-self: start;
        }

        .book-cover {
            width: 100%;
            border-radius: var(--radius);
            box-shadow: 0 14px 32px rgba(20, 20, 40, 0.18);
        }

        .book-title {
            font-size: 1.8rem;
            font-weight: 500;
            letter-spacing: -0.01em;
            margin: 0 0 14px;
            line-height: 1.15;
        }

        .book-byline {
            display: flex;
            align-items: center;
            gap: 10px;
            color: var(--ink-soft);
            font-size: 0.95rem;
            margin-bottom: 22px;
        }

        .book-byline-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            object-fit: cover;
        }

        .book-action-row {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 28px;
        }

        .action-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            border: 1px solid var(--line);
            background: var(--paper);
            color: var(--ink-soft);
            border-radius: 999px;
            padding: 10px 18px;
            font-size: 0.88rem;
            font-weight: 600;
            transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
        }

        .action-btn svg {
            width: 16px;
            height: 16px;
        }

        .action-btn:hover {
            border-color: var(--blue);
            color: var(--blue);
        }

        .action-btn--primary {
            background: var(--blue);
            border-color: var(--blue);
            color: #fff;
        }

        .action-btn--primary:hover {
            background: var(--blue-dark);
            color: #fff;
        }

        .meta-list {
            margin: 0 0 28px;
            border-top: 1px solid var(--line);
        }

        .meta-row {
            display: grid;
            grid-template-columns: 250px 1fr;
            gap: 24px;
            padding: 14px 0;
            border-bottom: 1px solid var(--line);
        }

        .meta-row dt {
            font-weight: 600;
            color: var(--ink-soft);
            font-size: 0.92rem;
        }

        .meta-row dd {
            margin: 0;
            font-size: 0.96rem;
            color: var(--ink-soft);
        }

        .tag {
            display: inline-block;
            background: var(--tag-bg);
            color: var(--tag-ink);
            font-size: 0.85rem;
            font-weight: 600;
            padding: 4px 12px;
            border-radius: 999px;
        }

        .meta-empty {
            color: var(--muted);
            font-style: italic;
        }

        .synopsis-block h2 {
            font-size: 1.1rem;
            font-weight: 500;
            margin: 0 0 10px;
        }

        .synopsis-block p {
            margin: 0;
        }

        #short-text,
        #full-text,
        .synopsis-block div,
        .synopsis-block div * {
            font-size: 0.96rem;
        }

        /* ============================================================
   RELATED BOOKS
   ============================================================ */
        .related-section {
            margin-bottom: 24px;
        }

        .related-heading {
            font-size: 1.6rem;
            font-weight: 500;
            margin: 0 0 24px;
            letter-spacing: -0.01em;
        }

        .related-grid-book {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 20px;
        }

        /* Tablet: เหลือ 3 คอลัมน์ */
        @media (max-width: 1024px) {
            .related-grid-book {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        /* Mobile: เหลือ 2 คอลัมน์ */
        @media (max-width: 640px) {
            .related-grid-book {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 14px;
            }
        }

        .related-card {
            background: #ffffff;
            border: 1px solid var(--color-gray-light);
            border-radius: 16px;
            overflow: hidden;
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
            transition: box-shadow 0.2s ease, transform 0.2s ease;
        }

        .related-card:hover {
            box-shadow: var(--shadow-hover);
            transform: translateY(-3px);
        }

        .related-cover-link {
            display: block;
            aspect-ratio: 3/4;
            overflow: hidden;
        }

        .related-cover {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .related-body {
            padding: 16px 18px 6px;
            flex: 1;
        }

        .related-title {
            font-size: 1.02rem;
            font-weight: 700;
            margin: 0 0 10px;
            line-height: 1.3;
            overflow-wrap: break-word;
            word-break: break-word;
        }

        .related-meta {
            list-style: none;
            margin: 0;
            padding: 0;
            font-size: 0.84rem;
            color: var(--ink-soft);
            display: flex;
            flex-direction: column;
            gap: 4px;
            overflow-wrap: break-word;
            word-break: break-word;
        }

        .related-meta strong {
            color: var(--ink);
            font-weight: 600;
        }

        .related-meta li {
            line-height: 1.4;
        }


        .related-actions {
            display: flex;
            gap: 8px;
            padding: 14px 18px 18px;
        }

        .related-actions .book-icon-btn {
            background: var(--bg);
            color: var(--ink-soft);
            border: 1px solid var(--line);
        }

        .related-actions .book-icon-btn:hover {
            background: var(--tag-bg);
            color: var(--blue);
            border-color: var(--blue);
        }

        /* ============================================================
   BOOK ICON BUTTON
   ============================================================ */
        .book-icon-btn {
            width: 38px;
            height: 38px;
            border-radius: 25%;
            border: 1px solid transparent;
            background: rgba(255, 255, 255, 0.12);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s ease;
        }

        .book-icon-btn:hover {
            background: rgba(255, 255, 255, 0.22);
        }

        .book-icon-btn svg {
            width: 18px;
            height: 18px;
        }

        /* ============================================================
   BOOK DETAIL / FOOTER RESPONSIVE
   ============================================================ */
        @media (max-width: 1280px) {
            .related-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 1024px) {
            .related-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .book-detail {
                grid-template-columns: 260px 1fr;
                gap: 32px;
                padding: 28px;
            }

            .footer-inner {
                grid-template-columns: 1fr 1fr;
            }

            .back-to-top {
                grid-column: 1 / -1;
                justify-self: start;
                flex-direction: row;
            }
        }

        @media (max-width: 720px) {
            .page-container {
                padding: 20px 16px 48px;
            }

            .book-detail {
                grid-template-columns: 1fr;
                padding: 22px;
                gap: 24px;
            }

            .book-cover-wrap {
                position: static;
                max-width: 260px;
                margin: 0 auto;
            }

            .book-title {
                font-size: 1.6rem;
                text-align: left;
            }

            .action-row {
                gap: 8px;
            }

            .action-btn {
                flex: 1;
                justify-content: center;
                padding: 11px 10px;
                font-size: 0.82rem;
            }

            .meta-row {
                grid-template-columns: 1fr;
                gap: 4px;
                padding: 12px 0;
            }

            .meta-row dt {
                font-size: 0.82rem;
                color: var(--muted);
            }

            .related-grid {
                grid-template-columns: 1fr 1fr;
                gap: 14px;
            }

            .related-heading {
                font-size: 1.3rem;
            }

            .related-title {
                font-size: 0.92rem;
            }

            .related-meta {
                font-size: 0.78rem;
            }

            .footer-inner {
                grid-template-columns: 1fr;
                padding: 40px 20px 30px;
                gap: 28px;
            }

            .back-to-top {
                grid-column: auto;
            }

            .footer-bottom {
                flex-direction: column;
                text-align: center;
            }
        }

        @media (max-width: 480px) {
            .related-grid {
                grid-template-columns: 1fr;
            }

            .header-inner {
                padding: 0 16px;
                gap: 14px;
            }

            .brand-logo {
                height: 32px;
            }
        }

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

            *,
            *::before,
            *::after {
                animation-duration: 0.001ms !important;
                transition-duration: 0.001ms !important;
            }

            html {
                scroll-behavior: auto;
            }
        }


        /* ---------------- profile card ---------------- */
        .profile-card {
            border: 1px solid var(--color-gray-light);
            border-radius: var(--radius);
            padding: 26px;
            margin: 20px 0 30px;
            display: flex;
            gap: 22px;
            align-items: flex-start;
            flex-wrap: wrap;
        }

        @media (max-width:480px) {
            .profile-card {
                padding: 18px;
                gap: 14px;
                margin: 16px 0 22px;
            }

            .profile-main h1 {
                font-size: 21px;
            }

            .contact-body {
                padding: 16px;
            }
        }

        .profile-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: var(--indigo);
            margin-bottom: 14px;
            color: #fff;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 22px;
            font-family: var(--serif);
        }

        .profile-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .profile-main {
            flex: 1;
            min-width: 0;
            width: 100%;
        }

        .profile-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: var(--indigo);
            margin-bottom: 14px;
            color: #fff;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 22px;
            font-family: var(--serif);
        }

        .profile-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .profile-main h1 {
            font-size: 24px;
            margin-bottom: 10px;
        }

        .pill-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 14px;
        }

        .pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--paper);
            border-radius: 999px;
            padding: 6px 12px;
            font-size: 12.5px;
            font-weight: normal;
            color: var(--text);
        }

        .pill a {
            color: var(--text);
        }

        .pill a:hover {
            color: var(--indigo);
        }

        .profile-desc {
            color: var(--muted);
            font-size: 14px;
            line-height: 1.65;
            max-width: 100%;
            width: 100%;
        }

        /* Responsive: stacked + centered layout (mobile/card view) */
        @media (max-width: 768px) {

            .profile-header,
            .profile-card {
                display: flex;
                flex-direction: column;
                align-items: center;
                text-align: center;
            }

            .profile-avatar {
                margin-left: auto;
                margin-right: auto;
            }

            .profile-main {
                display: flex;
                flex-direction: column;
                align-items: center;
                text-align: center;
                width: 100%;
            }

            .profile-main h1 {
                text-align: center;
            }

            .pill-row {
                justify-content: center;
            }

            .profile-desc {
                text-align: left;
                /* คำบรรยายยาวมักอ่านง่ายกว่าถ้าชิดซ้าย แม้ layout จะ center */
            }
        }

        .profile-img {
            width: 80px;
            height: 80px;
            object-fit: cover;
            border-radius: 50%;
            margin-top: -2px;
            margin-right: 5px;
        }

        .profile-action-row {
            display: flex;
            gap: 10px;
            margin-top: 20px;
            flex-wrap: wrap;
        }

        .profile-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 6px 14px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            text-decoration: none;
            transition: opacity .15s;
        }

        .profile-btn:hover {
            opacity: .85;
        }

        .profile-btn-primary {
            background: var(--navy);
            color: var(--white);
        }

        .profile-btn-primary a:hover {
            background: var(--navy);
            color: var(--white);
        }

        .profile-btn-ghost {
            background: transparent;
            color: var(--navy);
            border: 1.5px solid var(--color-gray-light);
        }

        .profile-btn-Unfav {
            background: var(--indigo);
            color: var(--white);

        }

        .profile-btn-fav {
            background: transparent;
            color: var(--navy);
            border: 1.5px solid var(--color-gray-light);
        }

        .profile-btn-fav-action,
        .profile-btn-fav-action:hover {
            background: var(--tag-fg);
            color: var(--white);
            border: 1.5px solid var(--tag-fg);
        }

        .profile-btn svg {
            width: 15px;
            height: 15px;
        }

        .pill svg {
            width: 11px;
            height: 11px;
            opacity: 0.7;
            flex-shrink: 0;
        }

        /* ---------------- tabs ---------------- */
        .tabs {
            display: flex;
            gap: 30px;
            border-bottom: 1px solid var(--line);
            margin-bottom: 30px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .tab-link {
            padding: 14px 2px;
            font-size: 15px;
            font-weight: 700;
            color: var(--muted);
            border-bottom: 2px solid transparent;
            cursor: pointer;
            background: none;
            border-top: none;
            border-left: none;
            border-right: none;
            white-space: nowrap;
            flex-shrink: 0;
        }

        @media (max-width:480px) {
            .tabs {
                gap: 20px;
            }

            .tab-link {
                font-size: 14px;
            }
        }

        .tab-link.active {
            color: var(--text);
            border-color: var(--text);
        }

        .tab-panel {
            display: none;
        }

        .tab-panel.active {
            display: block;
        }

        /* ---------------- panel (dark header + white body) ---------------- */
        .panel {
            border: 1px solid var(--color-gray-light);
            border-radius: var(--radius);
            overflow: hidden;
            margin-bottom: 22px;
            line-height: 18px;
        }

        .panel-head {
            background: var(--navy);
            color: #fff;
            padding: 14px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12.5px;
            font-weight: 500;
            letter-spacing: .08em;
            text-transform: uppercase;
            flex-wrap: wrap;
            gap: 10px;
        }

        @media (max-width:480px) {
            .panel-head {
                padding: 14px 16px;
            }

            .panel-body {
                padding: 2px 16px;
            }
        }

        .btn-mini {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: #fff;
            color: var(--text);
            border: none;
            border-radius: 999px;
            padding: 8px 16px;
            font-size: 12.5px;
            font-weight: 700;
            cursor: pointer;
        }

        .panel-body {
            padding: 6px 22px;
        }

        .info-row {
            display: flex;
            justify-content: space-between;
            gap: 16px;
            padding: 15px 0;
            border-bottom: 1px solid var(--line);
            font-size: 14px;
            flex-wrap: wrap;
        }

        .info-row:last-child {
            border-bottom: none;
        }

        .info-row .k {
            color: var(--muted);
            font-size: 11.5px;
            font-weight: 800;
            letter-spacing: .06em;
            text-transform: uppercase;
            flex: 0 0 160px;
        }

        .info-row .v {
            font-weight: normal;
            color: var(--text);
            flex: 1 1 auto;
            min-width: 120px;
        }

        .info-row .v a {
            color: var(--indigo);
            font-weight: 700;
        }

        @media (max-width:420px) {
            .info-row {
                flex-direction: column;
                gap: 4px;
            }

            .info-row .v {
                text-align: left;
            }
        }

        .panel-body p.desc {
            color: var(--text);
            font-size: 14.5px;
            line-height: 1.7;
            padding: 18px 0;
        }

        .about-grid {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 22px;
            align-items: start;
        }

        @media (max-width:900px) {
            .about-grid {
                grid-template-columns: 1fr;
            }
        }

        /* contact person card */
        .contact-body {
            padding: 20px 22px;
        }

        .contact-person {
            display: flex;
            gap: 12px;
            align-items: flex-start;
            margin-bottom: 18px;
        }

        .contact-avatar {
            width: 52px;
            height: 52px;
            min-width: 52px;
            /* กันไม่ให้ถูกบีบแคบกว่าที่กำหนด */
            min-height: 52px;
            /* กันไม่ให้ถูกยืดสูงกว่าที่กำหนด */
            flex-shrink: 0;
            border-radius: 50%;
            background: var(--indigo);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 22px;
            font-family: var(--serif);
            overflow: hidden;
        }


        .contact-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
            display: block;
        }

        .contact-person .role {
            color: var(--muted);
            font-size: 12.5px;
        }

        .contact-line {
            display: flex;
            gap: 12px;
            align-items: flex-start;
            padding: 11px 0;
            border-top: 1px solid var(--line);
        }

        .contact-line .ic {
            width: 34px;
            height: 34px;
            border-radius: 9px;
            background: var(--paper);
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }

        .contact-line .ic svg {
            width: 14px;
            height: 14px;
            opacity: 0.7;
            flex-shrink: 0;
        }

        .contact-line .lbl {
            font-size: 10.5px;
            font-weight: 800;
            letter-spacing: .06em;
            color: var(--muted);
            text-transform: uppercase;
        }

        .contact-line .val {
            font-size: 13.5px;
            font-weight: 600;
        }

        .contact-line .val a {
            color: var(--indigo);
        }

        .contact-actions {
            display: flex;
            gap: 10px;
            margin-top: 18px;
        }

        @media (max-width:420px) {
            .contact-actions {
                flex-direction: column;
            }
        }

        .btn-outline-sm {
            flex: 1;
            text-align: center;
            border: 1px solid var(--color-gray-light);
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            background: #fff;
        }

        .btn-solid-sm {
            flex: 1;
            text-align: center;
            background: var(--navy);
            color: #fff;
            border: none;
            border-radius: 10px;
            padding: 10px 12px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
        }

        /* ---------------- books tab ---------------- */
        .books-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 18px;
            flex-wrap: wrap;
            gap: 12px;
        }

        .books-toolbar-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .btn-navy {
            background: var(--navy);
            color: #fff;
            border: none;
            border-radius: 10px;
            padding: 8px 12px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 7px;
        }

        .books-listing {
            display: grid;
            grid-template-columns: 1fr 300px;
            gap: 30px;
            align-items: start;
        }

        @media (max-width:960px) {
            .books-listing {
                grid-template-columns: 1fr;
            }

            .filter-col {
                order: -1;
            }
        }

        /* ---------------- filter button ---------------- */
        #sidebarNavToggler1 {
            background: #fff;
            color: var(--ink, #111);
            border: 1.5px solid var(--color-gray-light, #d9dce1);
            border-radius: 10px;
            padding: 8px 14px;
            font-size: 13px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease;
            text-decoration: none;
        }

        #sidebarNavToggler1:hover {
            background: var(--paper, #f5f6f8);
            border-color: var(--indigo);
            color: var(--indigo);
        }

        .cat-heading {
            font-size: 12px;
            font-weight: 800;
            letter-spacing: .08em;
            text-transform: uppercase;
            color: var(--text);
            margin-bottom: 12px;
        }

        .cat-list {
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .cat-list li a {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 9px 4px;
            font-size: 14px;
            color: var(--text);
            border-radius: 8px;
            text-decoration: none;
        }

        .cat-list li a:hover {
            color: var(--indigo);
        }

        .cat-list li.active a {
            color: var(--indigo);
            font-weight: 700;
        }

        .cat-list .count {
            background: var(--paper);
            color: var(--muted);
            font-size: 11.5px;
            font-weight: 700;
            min-width: 22px;
            height: 22px;
            border-radius: 999px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 5px;
        }

        .book-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
        }

        @media (max-width:900px) {
            .book-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width:560px) {
            .book-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .book-card {
            border: 1px solid var(--line);
            border-radius: var(--radius);
            overflow: hidden;
            background: #fff;
            display: flex;
            flex-direction: column;
            transition: box-shadow .18s ease, transform .18s ease;
        }

        .book-card:hover {
            box-shadow: var(--shadow);
            transform: translateY(-3px);
        }

        .book-cover {
            aspect-ratio: 3/4;
            position: relative;
            display: flex;
            align-items: flex-end;
            padding: 14px;
            color: #fff;
            font-family: var(--serif);
            font-weight: 800;
            font-size: 15px;
            line-height: 1.25;
        }

        .book-cover::before {
            content: "";
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 22px);
        }

        .book-cover span {
            position: relative;
        }

        .book-body {
            padding: 14px 16px 16px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .book-cat {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: .05em;
            text-transform: uppercase;
            color: var(--indigo);
            margin-bottom: 5px;
        }

        .book-title {
            font-size: 14.5px;
            font-weight: 700;
            line-height: 1.3;
            margin-bottom: 10px;
        }

        .book-meta {
            font-size: 12px;
            color: var(--muted);
            line-height: 1.7;
            margin-bottom: 14px;
        }

        .book-meta b {
            color: var(--text);
        }

        .book-actions {
            display: flex;
            gap: 8px;
            margin-top: auto;
        }

        .btn-tiny {
            flex: 1;
            text-align: center;
            border-radius: 8px;
            padding: 6px 8px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            border: 1px solid transparent;
        }

        .btn-tiny-update {
            background: var(--navy);
            color: #fff;
        }

        .btn-tiny-update:hover {
            background: var(--indigo);
            color: #fff;
        }

        .btn-tiny-remove {
            background: #FDECEC;
            color: var(--danger);
            border-color: #F6C6C6;
        }

        .pagination {
            display: flex;
            gap: 6px;
            justify-content: center;
            margin-top: 30px;
            flex-wrap: wrap;
        }

        .pagination a,
        .pagination span {
            min-width: 34px;
            height: 34px;
            padding: 0 8px;
            border-radius: 9px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 700;
            border: 1px solid var(--line);
            color: var(--text);
        }

        .pagination .active {
            background: var(--ink);
            color: #fff;
            border-color: var(--ink);
        }

        /* ---------------- documents tab ---------------- */
        .docs-table {
            width: 100%;
            border-collapse: collapse;
            border: 1px solid var(--line);
            border-radius: var(--radius);
            overflow: hidden;
        }

        .docs-table-wrap {
            overflow-x: auto;
            border-radius: var(--radius);
            border: 1px solid var(--line);
        }

        .docs-table thead tr {
            background: var(--navy);
            color: #fff;
        }

        .docs-table th {
            padding: 14px 20px;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: .07em;
            text-transform: uppercase;
            text-align: left;
            white-space: nowrap;
        }

        .docs-table td {
            padding: 16px 20px;
            border-top: 1px solid var(--line);
            vertical-align: middle;
            font-size: 14px;
            white-space: nowrap;
            line-height: 1.3;
        }

        .doc-name {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .pdf-icon {

            font-size: 9px;
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .doc-name .fn {
            font-weight: 500;
        }

        .doc-name .fd {
            color: var(--muted);
            font-size: 12px;
            margin-top: 2px;
        }

        .btn-preview,
        .btn-download {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border-radius: 8px;
            padding: 8px 14px;
            font-size: 12.5px;
            font-weight: normal;
            border: 1px solid transparent;
            cursor: pointer;
        }

        .btn-preview {
            background: #EAF0FE;
            color: var(--preview);
        }

        .btn-download {
            background: #E9F9EE;
            color: var(--success);
        }

        .trash-btn {
            width: 34px;
            height: 34px;
            border-radius: 8px;
            border: 1px solid #FCA5A5;
            ;
            background: #FEF2F2;
            color: #DC2626;
            cursor: pointer;
        }

        .ex-btn-primary-contact {
            background: #fff;
            color: var(--navy);
            border-color: #d0d5dd;
        }

        .ex-btn-contact {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 400;
            cursor: pointer;
            border: none;
            text-decoration: none;
            transition: opacity .15s;
        }

        .ex-btn-contact:hover {
            color: var(--navy);
            opacity: .95;
        }

        .ex-person-btn:hover,
        .ex-person-btn:focus,
        .ex-person-btn:active,
        .ex-person-btn:visited {
            text-decoration: none !important;
        }

        .doc-empty {
            padding: 56px 24px;
            text-align: center;
            background: var(--white);
            border: 1px solid var(--color-gray-light);
            border-radius: var(--radius);
        }

        .doc-empty svg {
            color: var(--color-gray-light);
            margin-bottom: 14px;
        }

        .doc-empty-title {
            font-size: 14px;
            font-weight: 400;
            color: var(--muted);
            margin-bottom: 6px;
        }

        .pagination-book {
            display: flex;
            justify-content: center;
            margin-top: 20px;
        }

        .pagination-book ul {
            display: flex;
            align-items: center;
            gap: 10px;
            list-style: none;
            margin: 0;
            padding: 0;
            flex-wrap: wrap;
        }

        .pagination-book ul li {
            margin: 0;
            list-style: none;
        }

        .pagination-book ul li a {
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 32px;
            height: 32px;
            padding: 0 10px;
            white-space: nowrap;
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            background: var(--surface);
            color: var(--ink);
            font-size: 13px;
            font-weight: 700;
            box-shadow: var(--shadow-sm);
            text-decoration: none;
            transition: background .15s ease, color .15s ease, transform .15s ease;
        }

        .pagination-book ul li a:hover {
            transform: translateY(-2px);
            color: var(--indigo);
        }

        .pagination-book ul li a.current_page {
            background: var(--ink);
            color: #fff;
            box-shadow: none;
        }

        .pagination-book ul li a.current_page:hover {
            transform: none;
            color: #fff;
        }

        .tab-panel {
            display: none;
        }

        .tab-panel.active {
            display: block;
        }

        .pdf-icon {
            width: 32px;
            height: 32px;
            margin-right: 12px;
        }


        /* ---------------- forms ---------------- */
        .auth-shell {
            min-height: calc(100vh - 140px);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 60px 20px;
            background:
                radial-gradient(circle at 15% 20%, rgba(35, 43, 107, 0.06), transparent 40%),
                radial-gradient(circle at 85% 80%, rgba(63, 160, 181, 0.10), transparent 40%);
        }

        .auth-wrap {
            max-width: 460px;
            width: 100%;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: 20px;
            padding: 44px 40px;
            box-shadow: var(--shadow);
        }

        .auth-wrap.wide {
            max-width: 760px;
            padding: 45px 45px;
        }

        .auth-wrap h1 {
            font-size: 30px;
            margin-bottom: 8px;
        }

        .auth-wrap .auth-alt {
            margin-bottom: 20px;
            font-size: 14px;
            color: var(--muted);
        }

        .auth-alt a {
            color: var(--indigo);
            font-weight: 700;
        }

        .field-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px 24px;
            line-height: normal;
        }

        @media (max-width:640px) {
            .field-grid {
                grid-template-columns: 1fr;
            }
        }

        .field label {
            font-size: 13.5px;
            font-weight: 600;
            display: block;
            margin-bottom: 8px;
        }

        .req {
            color: var(--danger);
            font-weight: 700;
        }

        .field input,
        .field select {
            width: 100%;
            border: 1px solid var(--line);
            background: var(--paper);
            border-radius: var(--radius-sm);
            padding: 12px 14px;
            font-size: 14px;
            color: var(--ink);
        }

        .field input:focus,
        .field select:focus {
            border-color: var(--indigo);
            background: var(--surface);
        }

        .field input::placeholder {
            color: #9AA0AC;
        }

        .radio-row {
            display: flex;
            gap: 26px;
            align-items: center;
            margin-bottom: 8px;
            flex-wrap: wrap;
        }

        .radio-row label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
        }

        .radio-row input {
            accent-color: var(--indigo);
        }

        .auth-submit {
            margin-top: 30px;
        }

        .forgot {
            display: inline-block;
            margin: 16px 0 26px;
            font-size: 13.5px;
            color: var(--muted);
        }

        .forgot:hover {
            color: var(--ink);
        }

        .pass-wrap {
            position: relative;
        }

        .pass-wrap input {
            padding-right: 44px;
        }

        .pass-wrap svg {
            position: absolute;
            right: 14px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
            color: var(--muted);
            z-index: 5;
        }

        .pass-wrap svg.is-visible {
            color: var(--indigo);
        }

        .grecaptcha-badge {
            visibility: hidden;
        }

        .bootstrap-select>.dropdown-toggle {
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
        }

        .btn-form-submit {
            background: var(--ink);
            color: #fff;
            width: 100%;
            text-align: center;
            border: none;
            font-size: 14px;
            padding: 14px 20px;
            border-radius: var(--radius-sm);
        }

        .btn-form-submit:hover {
            background: var(--indigo);
            color: #ffffff;
        }

        .auth-shell .auth-wrap.hidden {
            display: none !important;
        }

        /* ===== Success state ===== */
        .success-icon {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: #eef2ff;
            color: var(--indigo);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 26px;
            margin-bottom: 20px;
        }

        .email-chip {
            display: inline-block;
            background: var(--tag-bg);
            padding: 4px 10px;
            border-radius: 6px;
            font-weight: 700;
        }

        .resend {
            font-size: 13px;
            color: var(--ink-soft);
            margin-top: 18px;
            text-align: center;
        }

        .resend button {
            background: none;
            border: none;
            color: var(--indigo);
            font-weight: 700;
            cursor: pointer;
            font-size: 13px;
            padding: 0;
        }

        /* =========================================================
   Modal — custom styling (applies to ALL modals)
   ========================================================= */
        /* --- Modal shell --- */
        .modal-content {
            border: none;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
        }

        /* --- Header (dark bar) --- */
        .modal-header {
            background-color: #1b1b1f;
            border-bottom: none;
            padding: 1rem 1.5rem;
        }

        .modal-title {
            color: #ffffff;
            font-weight: 600;
            font-size: 1.1rem;
        }

        /* Close (X) button — make it visible on dark background */
        .modal .btn-close {
            filter: invert(1) grayscale(100%) brightness(200%);
            opacity: 0.8;
        }

        .modal .btn-close:hover {
            opacity: 1;
        }

        /* --- Body --- */
        .modal-body {
            padding: 1.75rem;
            background-color: #ffffff;
        }

        /* Labels */
        .modal .form-label {
            font-weight: 500;
            color: #1b1b1f;
            margin-bottom: 0.35rem;
        }

        /* Required marker */
        .modal .text-valid {
            color: #e63946;
            font-weight: 400;
        }

        /* Small helper / hint text (e.g. recommended image size) */
        .modal .form-hint,
        .modal .text-hint {
            color: #e63946;
            font-size: 0.8rem;
            margin-top: 0.25rem;
            display: block;
        }

        /* --- Inputs, selects, textareas --- */
        .modal .form-control,
        .modal select.selectpicker,
        .modal textarea {
            background-color: #eef1f8;
            border: 1px solid #e1e5f0;
            border-radius: 8px;
            padding: 0.6rem 0.9rem;
            font-size: 0.95rem;
            color: #1b1b1f;
            box-shadow: none;
        }

        .modal .form-control:focus,
        .modal textarea:focus {
            background-color: #eef1f8;
            border-color: #3f51b5;
            box-shadow: 0 0 0 0.2rem rgba(63, 81, 181, 0.15);
        }

        .modal textarea {
            resize: vertical;
            min-height: 90px;
        }

        /* Bootstrap-select (e.g. country dropdown) button styling to match inputs */
        .modal .bootstrap-select>.dropdown-toggle {
            background-color: #eef1f8 !important;
            border: 1px solid #e1e5f0 !important;
            border-radius: 8px !important;
            color: #1b1b1f !important;
            padding: 0.6rem 0.9rem !important;
        }

        /* --- Image / dropify upload box --- */
        .modal .dropify-wrapper {
            border: 1px solid #e1e5f0;
            border-radius: 10px;
            background-color: #fafbfd;
        }

        /* --- Footer --- */
        .modal-footer {
            background-color: #ffffff;
            border-top: 1px solid #eef0f4;
            padding: 1.25rem 2rem;
        }

        .modal-footer .btn-secondary {
            background-color: #1b1b1f;
            border-color: #1b1b1f;
            border-radius: 8px;
            padding: 0.5rem 1.5rem;
            font-weight: 500;
        }

        .modal-footer .btn-secondary:hover {
            background-color: #000000;
            border-color: #000000;
        }

        .modal-footer .btn-primary {
            background-color: #3f51b5;
            border-color: #3f51b5;
            border-radius: 8px;
            padding: 0.5rem 1.75rem;
            font-weight: 500;
        }

        .modal-footer .btn-primary:hover {
            background-color: #303f9f;
            border-color: #303f9f;
        }

        /* =========================================================
   Add Book page — CSS-only reskin
   Scope: .book-upload-page (class added on the <section> only,
   no other markup/fields changed)
   ========================================================= */

        /* Outer form wrapper -> white card */
        .book-upload-page .woocommerce-info {
            border: 1px solid var(--color-gray-light);
            background-color: #ffffff;
            border-radius: 14px;
            box-shadow: var(--shadow-sm, 0 8px 20px -12px rgba(15, 23, 42, 0.25));
            padding: 1.75rem 2rem;
        }

        /* Section headers (h3) get an icon + divider, like card headers */
        .book-upload-page h3 {
            font-size: 1.05rem;
            font-weight: 700;
            color: var(--ink, #1b1b1f);
            /*padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line, #eef0f4);*/
        }

        .book-upload-page h3::before {
            font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
            font-weight: 400;
            margin-right: 0.5rem;
            color: var(--ink, #1b1b1f);
        }


        .book-upload-page h3 code {
            font-size: 0.8rem;
            font-weight: 500;
        }

        /* Turn the book-info block into its own card, visually separated below the images */
        .book-upload-page .woocommerce-billing-fields {

            padding-top: 1.5rem !important;
            border-top: 1px solid var(--line, #eef0f4);
        }

        /* Required marker */
        .book-upload-page code {
            color: #e63946;
            background: none;
            font-weight: 400;
            padding: 0;
        }

        /* --- Image upload boxes (Cover Book / Image 1-3) --- */
        .book-upload-page .dropify-wrapper {
            border: 1px solid var(--line, #e1e5f0);
            border-radius: 10px;
            background-color: #fafbfd;
            width: 100%;
            min-height: 180px;
        }

        .book-upload-page .fs--1 {
            display: block;
            text-align: center;
            margin-top: 0.5rem;
        }

        .book-upload-page .fs--1 strong {
            font-weight: 600;
            color: var(--ink, #1b1b1f);
            font-size: 0.9rem;
        }

        /* --- "Active Book" toggle row -> pill bar like the mock --- */
        .book-upload-page .form-group.row.pb-10:has(.vc-toggle-container) {
            background-color: #f5f7fb;
            border: 1px solid var(--line, #eef0f4);
            border-radius: 10px;
            padding: 0.6rem 1rem;
            margin-left: 0;
            margin-right: 0;
            align-items: center;
        }

        .book-upload-page .form-group.row.pb-10:has(.vc-toggle-container) label.col-form-label {
            font-weight: 600;
            color: var(--ink, #1b1b1f);
        }

        .book-upload-page .vc-switch-label {
            background-color: #d7dbe3;
        }

        .book-upload-page .vc-switch-input:checked~.vc-switch-label {
            background-color: #16a34a;
        }

        /* --- Labels --- */
        .book-upload-page .col-form-label {
            font-weight: 500;
            color: var(--ink, #1b1b1f);
        }

        /* --- Inputs, selects, textareas --- */
        .book-upload-page .form-control,
        .book-upload-page select.selectpicker,
        .book-upload-page textarea.form-control {
            background-color: #eef1f8;
            border: 1px solid #e1e5f0;
            border-radius: 8px;
            padding: 0.6rem 0.9rem;
            font-size: 0.95rem;
            color: #1b1b1f;
            box-shadow: none;
        }

        .book-upload-page .form-control:focus,
        .book-upload-page textarea.form-control:focus {
            background-color: #eef1f8;
            border-color: #3f51b5;
            box-shadow: 0 0 0 0.2rem rgba(63, 81, 181, 0.15);
        }

        .book-upload-page .bootstrap-select>.dropdown-toggle {
            background-color: #eef1f8 !important;
            border: 1px solid #e1e5f0 !important;
            border-radius: 8px !important;
            color: #1b1b1f !important;
            padding: 0.6rem 0.9rem !important;
        }

        /* Page-number "pages" suffix row */
        .book-upload-page .ul_li:has(input[name="number_page_book"]) {
            align-items: center;
            gap: 0.6rem;
        }

        /* --- Synopsis / CKEditor textarea --- */
        .book-upload-page textarea#editor {
            min-height: 220px;
        }

        .book-upload-page .ck-editor__editable {
            min-height: 220px;
        }

        /* --- Save button --- */
        .book-upload-page .xb-btn {
            background-color: var(--ink, #1b1b1f);
            border: none;
            color: #fff;
            border-radius: 8px;
            padding: 0.7rem 2.5rem;
            font-weight: 600;
            letter-spacing: 0.02em;
        }

        .book-upload-page .xb-btn:hover {
            background-color: #000000;
            color: #fff;
        }

        .input-group-text-date {

            border-top-right-radius: 9px !important;
            border-bottom-right-radius: 9px !important;
        }

        /* ========================================
   Base Style (Desktop / Default)
======================================== */
        .nav-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            row-gap: 10px;
        }

        .nav-link.rounded-pill {
            padding: 10px 20px;
            white-space: nowrap;
            transition: all 0.2s ease;
        }

        .span-menu-meeting {
            font-size: 16px;
            font-weight: 500;
            line-height: 1.4;
            padding: 3px;
        }

        .nav-item.pr-15 {
            padding-right: 15px;
        }


        /* ========================================
   Large Desktop (>= 1200px)
======================================== */
        @media (min-width: 1200px) {
            .span-menu-meeting {
                font-size: 13px;
            }

            .nav-link.rounded-pill {
                padding: 6px 12px;
            }
        }


        /* ========================================
   Desktop / Laptop เล็ก (992px - 1199px)
======================================== */
        @media (max-width: 1199px) {
            .span-menu-meeting {
                font-size: 13px;
            }

            .nav-link.rounded-pill {
                padding: 9px 18px;
            }
        }


        /* ========================================
   Tablet แนวนอน (768px - 991px)
======================================== */
        @media (max-width: 991px) {
            .nav-pills {
                gap: 8px;
                row-gap: 8px;
            }

            .span-menu-meeting {
                font-size: 14px;
            }

            .nav-link.rounded-pill {
                padding: 8px 16px;
            }

            .nav-item.pr-15 {
                padding-right: 8px;
            }
        }


        /* ========================================
   Tablet แนวตั้ง (576px - 767px)
======================================== */
        @media (max-width: 767px) {
            .nav-pills {
                gap: 6px;
                row-gap: 8px;
                flex-wrap: wrap;
            }

            .span-menu-meeting {
                font-size: 13px;
            }

            .nav-link.rounded-pill {
                padding: 7px 14px;
            }

            .nav-item.pr-15 {
                padding-right: 6px;
            }
        }


        /* ========================================
   Mobile ทั่วไป (400px - 575px)
======================================== */
        @media (max-width: 575px) {
            .nav-pills {
                gap: 6px;
                row-gap: 6px;
            }

            .span-menu-meeting {
                font-size: 12px;
            }

            .nav-link.rounded-pill {
                padding: 6px 12px;
            }

            .nav-item.pr-15 {
                padding-right: 6px;
            }
        }


        /* ========================================
   Mobile เล็ก (320px - 399px)
======================================== */
        @media (max-width: 399px) {
            .nav-pills {
                gap: 4px;
                row-gap: 6px;
            }

            .span-menu-meeting {
                font-size: 11px;
            }

            .nav-link.rounded-pill {
                padding: 5px 10px;
            }

            .nav-item.pr-15 {
                padding-right: 4px;
            }
        }


        /* ========================================
   Mobile เล็กมาก (<= 320px) เช่น iPhone SE
======================================== */
        @media (max-width: 320px) {
            .span-menu-meeting {
                font-size: 10px;
            }

            .nav-link.rounded-pill {
                padding: 5px 8px;
            }
        }

        #xb-header-area {
            position: sticky !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            z-index: 999 !important;
            transition: none !important;
            animation: none !important;
            border-bottom: 1px solid var(--color-gray-light);
        }

        /* กันเผื่อ JS ของธีมสร้าง header ซ้อนสำหรับตอน scroll ทีหลัง ให้ซ่อนไปเลย ไม่ต้องมีตัวซ้ำ */
        #xb-header-area .xb-header-area-sticky,
        #xb-header-area .xb-sticky-stt,
        #xb-header-area .xb-header-fixed {
            display: none !important;
        }

        #xb-header-area .xb-header-menu .xb-item--author,
        #xb-header-area .xb-header-menu .xb-item--author * {
            transition: none !important;
            animation: none !important;
        }

        /* แถวโปรไฟล์ในเมนูสไลด์: avatar + ชื่อ เรียงแนวนอน ไม่ให้รูปใหญ่ล้น */
        #xb-header-area .xb-header-menu .menu-item-has-children {
            position: relative;
        }

        #xb-header-area .xb-header-menu .xb-item--author {
            display: flex !important;
            align-items: center !important;
            flex-wrap: nowrap !important;
            gap: 10px;
            padding: 8px 40px 8px 0;
        }

        #xb-header-area .xb-header-menu .xb-item--author .pr-10 {
            flex: 0 0 auto;
            width: 44px;
            height: 44px;
            overflow: hidden;
            border-radius: 50%;
        }

        #xb-header-area .xb-header-menu .xb-item--author .pr-10 img {
            width: 44px !important;
            height: 44px !important;
            max-width: 44px !important;
            object-fit: cover;
            border-radius: 50%;
            display: block;
        }

        #xb-header-area .xb-header-menu .xb-item--author .xb-name-login {
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #xb-header-area .xb-header-menu .xb-item--author .xb-name-login h6 {
            margin: 0;
            font-size: 15px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* ปุ่มลูกศร toggle sub-menu: ยึดขวาบนของแถว ไม่ให้ลอยทับรูป */
        #xb-header-area .xb-header-menu .menu-item-has-children>.xb-menu-toggle {
            position: absolute !important;
            top: 10px;
            right: 0;
            width: 28px;
            height: 28px;
        }

        #xb-header-area .xb-header-menu .menu-item.pt-20>ul.ul_li[align="center"] {
            gap: 12px;
            padding: 16px 0 20px;
            margin-bottom: 8px;
            border-top: 1px solid rgba(0, 0, 0, 0.08);
            border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        }

        #xb-header-area .xb-header-menu .menu-item.pt-20>ul.ul_li[align="center"]>li {
            flex: 1 1 0;
        }

        #xb-header-area .xb-header-menu .menu-item.pt-20 a#rcorners2 {

            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 14px 8px !important;
            border-radius: 12px;
            font-weight: 600;
            font-size: 13px;
            color: #fff !important;
            background: var(--color-primary);
            border: none !important;
            box-shadow: 0 6px 14px rgba(43, 87, 224, 0.28);
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        #xb-header-area .xb-header-menu .menu-item.pt-20 a#rcorners2 svg {
            width: 15px;
            height: 15px;
        }

        /*
.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .15s;
}*/

        #xb-header-area .xb-header-menu .menu-item.pt-20 a#rcorners2:hover,
        #xb-header-area .xb-header-menu .menu-item.pt-20 a#rcorners2:active {
            transform: translateY(-2px);
            box-shadow: 0 8px 18px rgba(43, 87, 224, 0.35);
            color: #fff !important;
        }

        #xb-header-area .xb-header-menu .menu-item.pt-20 a#rcorners2 i {
            width: 15px;
            height: 15px;
        }

        /* ปุ่ม Chats ใช้สีเข้มต่างออกไป เพื่อให้แยกจาก Meetings ชัดเจน */
        #xb-header-area .xb-header-menu .menu-item.pt-20>ul.ul_li[align="center"]>li:last-child a#rcorners2 {
            background: var(--color-dark, #16192c);
            box-shadow: 0 6px 14px rgba(22, 25, 44, 0.28);
        }

        #xb-header-area .xb-header-menu .menu-item.pt-20>ul.ul_li[align="center"]>li:last-child a#rcorners2:hover {
            box-shadow: 0 8px 18px rgba(22, 25, 44, 0.35);
        }

        .fs-11 {
            font-size: 11px;
            color: var(--muted)
        }


        /* ============================================================
       Meeting Card — Modern / Responsive (ใหม่ทั้งหมด ไม่แก้ของเดิม)
       ใช้ CSS variables ที่ประกาศไว้แล้วใน :root ของ header.php
       ============================================================ */

        .mc-list {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .mc-card {
            background: var(--surface, #fff);
            border: 1px solid var(--line, #eff5f8);
            border-radius: var(--radius, 14px);
            box-shadow: var(--shadow-sm, 0 8px 20px -12px rgba(15, 23, 42, .25));
            padding: 20px 24px;
            display: grid;
            grid-template-columns: 150px 1fr;
            gap: 24px;
            align-items: start;
            transition: box-shadow .2s ease, transform .2s ease;
            margin-bottom: 20px;
        }

        .mc-card:hover {
            box-shadow: var(--shadow, 0 18px 40px -22px rgba(15, 23, 42, .35));
            transform: translateY(-2px);
        }

        /* -------- Left: date / time -------- */
        .mc-date {
            display: flex;
            flex-direction: column;
            gap: 4px;
            border-right: 1px solid var(--line, #eff5f8);
            padding-right: 16px;
        }

        .mc-date .mc-date-day {
            font-weight: 700;
            font-size: 15px;
            color: var(--text, #1a2744);
            line-height: 1.3;
        }

        .mc-date .mc-date-time {
            font-size: 13.5px;
            color: var(--muted, #6b6f7d);
        }

        /* -------- Middle: main info -------- */
        .mc-body {
            min-width: 0;
        }

        .mc-header {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 4px;
        }

        .mc-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            object-fit: cover;
            border: 1px solid var(--line, #eff5f8);
            flex-shrink: 0;
        }

        .mc-name {
            font-weight: 700;
            font-size: 16px;
            color: var(--navy, #1a2744);
            margin: 0;
        }

        .mc-chat-btn {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--line, #eff5f8);
            color: var(--indigo, #2029bd);
            background: transparent;
            transition: background .15s ease, color .15s ease;
        }

        .mc-chat-btn:hover {
            background: var(--indigo, #2029bd);
            color: #fff;
        }

        .mc-sub {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px;
            font-size: 13.5px;
            color: var(--muted, #6b6f7d);
            margin-bottom: 10px;
        }

        .mc-sub img.mc-flag {
            width: 18px;
            border-radius: 2px;
        }

        .mc-table-no {
            font-size: 13.5px;
            margin-bottom: 10px;
        }

        .mc-table-no .mc-tag {
            display: inline-block;
            background: var(--tag-bg, #eef0fb);
            color: var(--tag-ink, #3552ca);
            border-radius: var(--radius-sm, 8px);
            padding: 2px 10px;
            font-weight: 600;
        }

        .mc-meta-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 4px 24px;
            margin: 10px 0 12px;
            padding: 0;
            list-style: none;
        }

        .mc-meta-list p {
            margin: 0;
            font-size: 14px;
            color: var(--text, #1a2744);
        }

        .mc-meta-list span.mc-label {
            font-weight: 600;
            color: var(--navy, #1a2744);
        }

        /* -------- Badges / status row -------- */
        .mc-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
            padding: 0;
            list-style: none;
        }

        .mc-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px 12px;
            border-radius: 999px;
            font-size: 12.5px;
            font-weight: 600;
            line-height: 1.4;
        }

        .mc-badge--pending {
            background: rgba(20, 202, 244, .12);
            color: var(--teal-2, #0fa9cc);
        }

        .mc-badge--confirmed {
            background: rgba(22, 163, 74, .12);
            color: var(--success, #16a34a);
        }

        .mc-badge--info {
            background: var(--tag-bg, #eef0fb);
            color: var(--tag-ink, #3552ca);
        }

        /* -------- Bottom: actions row (full width, below content) -------- */
        .mc-actions {
            grid-column: 1 / -1;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: flex-end;
            border-top: 1px solid var(--line, #eff5f8);
            padding-top: 16px;
            margin-top: 4px;
        }

        .mc-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 10px 14px;
            border-radius: var(--radius-sm, 8px);
            font-size: 13px;
            font-weight: 600;
            text-decoration: none;
            cursor: pointer;
            border: 1px solid transparent;
            white-space: nowrap;
            transition: opacity .15s ease, transform .15s ease;
        }

        .mc-btn:hover {
            opacity: .88;
            transform: translateY(-1px);
        }

        .mc-btn--primary {
            background: var(--dark, #0f172a);
            color: #fff;
        }

        .mc-btn--outline {
            background: transparent;
            border-color: var(--dark, #0f172a);
            color: var(--dark, #0f172a);
        }

        .mc-btn--danger {
            background: transparent;
            border-color: var(--danger, #e5484d);
            color: var(--danger, #e5484d);
        }

        .mc-btn--danger:hover {
            background: var(--danger, #e5484d);
            color: #fff;
        }

        /* -------- Empty state -------- */
        .mc-empty {
            background: var(--surface, #fff);
            border: 1px dashed var(--line, #eff5f8);
            border-radius: var(--radius, 14px);
            text-align: center;
            padding: 60px 20px;
            color: var(--muted, #6b6f7d);
        }

        /* ============================================================
       Responsive breakpoints
       ============================================================ */
        @media (max-width: 991.98px) {
            .mc-card {
                grid-template-columns: 120px 1fr;
            }
        }

        @media (max-width: 575.98px) {
            .mc-card {
                grid-template-columns: 1fr;
                padding: 16px;
                gap: 12px;
            }

            .mc-date {
                flex-direction: row;
                align-items: center;
                gap: 10px;
                border-right: none;
                border-bottom: 1px solid var(--line, #eff5f8);
                padding-right: 0;
                padding-bottom: 10px;
            }

            .mc-header {
                gap: 8px;
            }

            .mc-avatar {
                width: 38px;
                height: 38px;
            }

            .mc-name {
                font-size: 15px;
            }

            .mc-actions {
                flex-direction: column;
            }

            .mc-btn {
                flex: 1 1 auto;
                width: 100%;
            }
        }

        .vt-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 380px;
            background: var(--surface, #fff);
            border: 1px dashed var(--line, #eff5f8);
            border-radius: var(--radius, 14px);
            text-align: center;
            padding: 60px 20px;
            color: var(--muted, #6b6f7d);
        }

        .vt-empty__icon {
            color: #c7cbd6;
            margin-bottom: 18px;
            line-height: 0;
        }

        .vt-empty__title {
            font-size: 18px;
            font-weight: 600;
            color: #1c1f2a;
            margin: 0 0 6px;
        }

        .vt-empty__desc {
            font-size: 14px;
            color: var(--muted, #6b6f7d);
            max-width: 320px;
            margin: 0;
        }

        @media (max-width: 576px) {
            .vt-empty {
                min-height: 280px;
                padding: 40px 16px;
            }

            .vt-empty__icon svg {
                width: 48px;
                height: 48px;
            }
        }

        .mc-btn--video {
            flex-direction: column;
            align-items: center;
            gap: 2px;
            text-align: center;
            line-height: 1.3;
        }

        .mc-btn--video i {
            margin-bottom: 2px;
        }

        /* "Delete meeting" link shown inside the card body (tb-01),
   styled to match the danger color already defined for .mc-btn--danger. */
        .mc-link-delete {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            font-weight: 600;
            color: var(--danger, #e5484d);
            margin-top: 8px;
            text-decoration: none;
            cursor: pointer;
        }

        .mc-link-delete:hover {
            text-decoration: underline;
        }

        /* badge สีแดงสำหรับสถานะ Canceled */
        .mc-badge--danger {
            background: rgba(229, 72, 77, .12);
            color: var(--danger, #e5484d);
        }

        /* ============================================================
   Modal Detail Meeting — Sender/Receiver card layout
   ใหม่ทั้งหมด ไม่แก้ CSS เดิม (.modal-content / .modal-header ฯลฯ)
   ============================================================ */

        .mdm-hidden-legacy {
            display: none;
        }

        /* -------- Sender / Receiver cards -------- */
        .mdm-parties {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        .mdm-party {
            background: #f8f9fc;
            border: 1px solid #e6e8f0;
            border-radius: 12px;
            padding: 18px 20px;
        }

        .mdm-tag {
            display: inline-block;
            font-size: 11.5px;
            font-weight: 700;
            letter-spacing: .04em;
            text-transform: uppercase;
            padding: 4px 12px;
            border-radius: 999px;
        }

        .mdm-tag--sender {
            background: rgba(63, 81, 181, .1);
            color: #3f51b5;
            border: 1px solid rgba(63, 81, 181, .25);
        }

        .mdm-tag--receiver {
            background: rgba(22, 163, 74, .1);
            color: #16a34a;
            border: 1px solid rgba(22, 163, 74, .25);
        }

        .mdm-party-main {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-top: 14px;
        }

        .mdm-avatar {
            flex-shrink: 0;
        }

        .mdm-avatar img {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            object-fit: cover;
            border: 1px solid #e6e8f0;
        }

        .mdm-party-name {
            font-weight: 700;
            font-size: 17px;
            color: #1b1b1f;
        }

        .mdm-party-sub {
            font-size: 13.5px;
            color: #6b7280;
            margin-top: 3px;
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .mdm-table-pill:not(:empty) {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 12px;
            font-size: 12.5px;
            font-weight: 600;
            color: #3552ca;
            background: #eef0fb;
            border-radius: 999px;
            padding: 5px 12px;
        }

        .mdm-table-pill:empty {
            display: none;
        }

        .mdm-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;
        }

        .mdm-badges:empty {
            display: none;
        }

        /* -------- Meeting info grid -------- */
        .mdm-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
        }

        .mdm-field {
            background: #f8f9fc;
            border: 1px solid #e6e8f0;
            border-radius: 12px;
            padding: 14px 18px;
        }

        .mdm-field--full {
            grid-column: 1 / -1;
        }

        .mdm-field-label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: .04em;
            text-transform: uppercase;
            color: #6b7280;
            margin-bottom: 6px;
        }

        .mdm-field-value {
            font-size: 15px;
            color: #1b1b1f;
            word-break: break-word;
        }

        /* -------- Responsive -------- */
        @media (max-width: 767.98px) {

            .mdm-parties,
            .mdm-grid {
                grid-template-columns: 1fr;
            }
        }

        /* ============================================================
   Modal Request a Meeting v2 — party card + radio cards + field grid
   reuse: .mdm-party / .mdm-party-main / .mdm-avatar / .mdm-party-name /
          .mdm-table-pill / .pill-row / .pill / .mdm-grid / .mdm-field
   ============================================================ */

        .rm-party-card {
            margin-bottom: 20px;
        }

        .mt-10 {
            margin-top: 10px;
        }

        /* -------- Confirm / Cancel radio cards -------- */
        .rm-radio-cards {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-bottom: 22px;
        }

        @media (max-width: 575.98px) {
            .rm-radio-cards {
                grid-template-columns: 1fr;
            }
        }

        .rm-radio-card {
            display: flex;
            align-items: center;
            gap: 12px;
            border: 1.5px solid var(--line, #eff5f8);
            border-radius: 12px;
            padding: 14px 18px;
            font-weight: 600;
            font-size: 13px;
            cursor: pointer;
            transition: border-color .15s ease, background .15s ease;
        }

        .rm-radio-card input[type="radio"] {
            width: 18px;
            height: 18px;
            flex-shrink: 0;
            accent-color: var(--indigo, #2029bd);
        }

        .rm-radio-card--confirm {
            background: rgba(22, 163, 74, .06);
            border-color: rgba(22, 163, 74, .3);
            color: var(--success, #16a34a);
        }

        .rm-radio-card--confirm:has(input:checked) {
            background: rgba(22, 163, 74, .1);
            border-color: var(--success, #16a34a);
        }

        .rm-radio-card--cancel {
            background: rgba(229, 72, 77, .05);
            border-color: rgba(229, 72, 77, .25);
            color: var(--danger, #e5484d);
        }

        .rm-radio-card--cancel:has(input:checked) {
            background: rgba(229, 72, 77, .1);
            border-color: var(--danger, #e5484d);
        }

        /* -------- Meeting info grid spacing in this modal -------- */
        .rm-meeting-grid {
            margin-bottom: 24px;
        }

        /* -------- Message to section -------- */
        .rm-message-to {
            margin-top: 6px;
        }

        .rm-message-to .form-label {
            margin-bottom: 10px;
            display: block;
        }

        .rm-radio-card--location {
            background: var(--surface, #fff);
        }

        .rm-radio-card--location:has(input:checked) {
            background: rgba(32, 41, 189, .06);
            border-color: var(--indigo, #2029bd);
        }