/* ============================================
   EMSIS - Custom Home CSS  (Bootstrap 5)
   Font: Chulabhorn Likit (~/fonts/chulabhorn-likit)
   Primary : #002575  |  Accent : #ff8900
   ============================================ */

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

html,
body {
    font-family: 'chulabhorn likit text regular', sans-serif;
    background: #fff;
    color: #1a1a1a;
    margin: 0;
}

.ems-header-title,
.ems-section-title,
.ems-nav-btn,
.ems-card-title,
.ems-see-all {
    font-family: 'chulabhorn likit text bold', sans-serif;
}

/* ─── TOP HEADER ────────────────────────────── */
.ems-header {
    background: #002575;
    padding: 10px 0;
}
.ems-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}
.ems-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}
.ems-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.ems-header-logo {
    width: 60px;
    height: 60px;
    border-radius: 20%;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    flex-shrink: 0;
}
.ems-header .fa,
.ems-navbar .fa {
    font-size: 1.2rem;
    line-height: 1;
}
.ems-btn-feedback .fa {
    font-size: 1.25rem;
}
.ems-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.01em;
    min-width: 0;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: break-word;
}
.ems-btn-feedback {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FFFFFF 0% 0% no-repeat padding-box;
    color: #ff8900;
    border-radius: 20px;
    padding: 6px 24px;
    margin-left: 0;
    font-size: 0.88rem;
    font-family: 'chulabhorn likit text regular', sans-serif;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s;
}
.ems-btn-feedback:hover { background: rgba(255,255,255,.15); color: #ff8900; }
.ems-btn-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF 0% 0% no-repeat padding-box;
    color: #002E82;
    border: none;
    outline: none;
    border-radius: 20px;
    padding: 6px 24px;
    margin-left: 0;
    font-size: 0.88rem;
    font-family: 'chulabhorn likit text regular', sans-serif;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s;
    min-width: 0;
    max-width: 240px;
}

button.ems-btn-login {
    font-family: inherit;
    font-weight: inherit;
}

.ems-btn-login__icon {
    width: 1.15rem;
    height: 1.15rem;
    object-fit: contain;
    flex-shrink: 0;
}

.ems-btn-login__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ems-btn-login:hover { background: rgba(255,255,255,.15); color: #fff; }
.ems-btn-login:focus, .ems-btn-login:active, .ems-btn-login.show {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.ems-btn-login.dropdown-toggle {
    padding: 6px 24px;
}

/* ─── USER DROPDOWN ─────────────────────────── */
.ems-header .user-dropdown-menu {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 37, 117, 0.12);
    padding: 16px;
    min-width: 220px;
    margin-top: 10px !important;
}
.ems-header .user-dropdown-menu li {
    margin-bottom: 4px;
}
.ems-header .user-dropdown-menu li:last-child {
    margin-bottom: 0;
}
.ems-header .user-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #333333;
    font-weight: 500;
    font-size: 0.93rem;
    border-radius: 10px;
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.ems-header .user-dropdown-menu .dropdown-item:hover {
    background-color: #f0f4ff;
    color: #002e82;
}
.ems-header .user-dropdown-menu .dropdown-item-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    color: #002e82;
    stroke-width: 1.8;
    transition: color 0.2s ease;
}
.ems-header .user-dropdown-menu .dropdown-item:hover .dropdown-item-icon {
    color: #002e82;
}

/* ─── NAVBAR ────────────────────────────────── */
.ems-navbar {
    background: #FFFFFF;
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    position: sticky;
    top: 0;
    z-index: 100;
}
.ems-nav-btn {
    background: transparent;
    border: none;
    color: #002E82;
    font-size: 0.93rem;
    font-weight: 600;
    font-family: inherit;
    padding: 10px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s, background .2s;
}
.ems-nav-btn:hover, .ems-nav-btn:focus { color: #2e62c3; background: rgba(255,255,255,.12); border-radius: 4px; outline: none; }
.ems-nav-btn.dropdown-toggle::after {
    display: inline-block;
    margin-left: 6px;
    vertical-align: 2px;
    content: "";
    border-top: 6px solid currentColor;
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
}
.ems-btn-login.dropdown-toggle::after {
    margin-left: 8px;
    vertical-align: 0.15em;
    border-top: 6px solid currentColor;
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
}
.ems-navbar .dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,37,117,.13);
    font-size: 0.93rem;
    min-width: 180px;
    padding: 6px 0;
}
.ems-navbar .dropdown-item {
    padding: 8px 18px;
    color: #333;
    font-weight: 500;
}
.ems-navbar .dropdown-item:hover { background: #f0f4ff; color: #002575; }

/* ─── HOME MOBILE MENU ──────────────────────── */
.ems-home-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.ems-home-menu-toggle:hover,
.ems-home-menu-toggle:focus {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}

.ems-home-menu-toggle__bar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #ffffff;
}

.ems-home-drawer {
    --bs-offcanvas-width: min(320px, 88vw);
    border-left: none;
    box-shadow: -8px 0 32px rgba(0, 20, 80, 0.18);
}

.ems-home-drawer__header {
    background: #002575;
    color: #ffffff;
    padding: 16px 18px;
    border-bottom: 3px solid #ff8900;
}

.ems-home-drawer__title {
    font-family: 'chulabhorn likit text bold', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.ems-home-drawer__close {
    filter: invert(1) grayscale(1) brightness(2);
    opacity: 0.85;
}

.ems-home-drawer__body {
    padding: 0 0 24px;
    background: #ffffff;
}

.ems-home-drawer__account {
    padding: 12px 0 4px;
    border-bottom: 1px solid #e8ecf4;
}

.ems-home-drawer__nav-label {
    padding: 14px 20px 6px;
    color: #888;
    font-family: 'chulabhorn likit text bold', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ems-mobile-drawer-action {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #002575;
    font-family: 'chulabhorn likit text bold', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.ems-mobile-drawer-action:hover,
.ems-mobile-drawer-action:focus {
    background: rgba(0, 37, 117, 0.06);
    color: #2e62c3;
    text-decoration: none;
}

.ems-mobile-drawer-action--feedback {
    color: #ff8900;
}

.ems-mobile-drawer-action--feedback:hover,
.ems-mobile-drawer-action--feedback:focus {
    background: #fff8f0;
    color: #ff8900;
}

.ems-mobile-drawer-action--feedback .fa,
.ems-mobile-drawer-action__user-icon {
    width: 22px;
    flex-shrink: 0;
}

.ems-mobile-drawer-action--feedback .fa {
    font-size: 1rem;
    text-align: center;
}

.ems-mobile-drawer-action__user-icon {
    height: 22px;
    object-fit: contain;
}

.ems-mobile-drawer-action__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #002575;
    stroke-width: 1.8;
}

.ems-mobile-drawer-user {
    border-top: 1px solid #e8ecf4;
}

.ems-mobile-drawer-user__name {
    padding: 12px 20px 4px;
    color: #666;
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#navLinkMobile {
    display: flex;
    flex-direction: column;
}

.ems-mobile-nav-group {
    border-bottom: 1px solid #e8ecf4;
}

.ems-mobile-nav-toggle,
.ems-mobile-nav-subtoggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: #002575;
    font-family: 'chulabhorn likit text bold', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ems-mobile-nav-toggle:hover,
.ems-mobile-nav-toggle:focus,
.ems-mobile-nav-subtoggle:hover,
.ems-mobile-nav-subtoggle:focus {
    background: rgba(0, 37, 117, 0.06);
    color: #2e62c3;
    outline: none;
}

.ems-mobile-nav-toggle::after,
.ems-mobile-nav-subtoggle::after {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-left: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.ems-mobile-nav-toggle:not(.collapsed)::after,
.ems-mobile-nav-subtoggle:not(.collapsed)::after {
    transform: rotate(-135deg);
}

.ems-mobile-nav-submenu,
.ems-mobile-nav-subitems {
    padding: 4px 0 8px;
    background: #f7f9fc;
}

.ems-mobile-nav-link {
    display: block;
    padding: 10px 20px 10px 28px;
    color: #444;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.ems-mobile-nav-link:hover {
    background: #eef3ff;
    color: #002575;
}

.ems-mobile-nav-subgroup {
    border-top: 1px solid #e4e9f2;
}

.ems-mobile-nav-subtoggle {
    padding: 10px 20px 10px 36px;
    font-size: 0.88rem;
    font-weight: 600;
}

.ems-mobile-nav-subitems .ems-mobile-nav-link {
    padding-left: 44px;
    font-size: 0.85rem;
}

.ems-mobile-nav-empty {
    display: block;
    padding: 10px 20px 10px 28px;
    color: #888;
    font-size: 0.85rem;
}

/* ─── HOME CONTENT SHELL (จัดระยะขอบให้เท่ากับหน้าระบบงาน) ─── */
.ems-home-shell {
    max-width: 1260px;
    margin-inline: auto;
}

/* ─── HERO BANNER ───────────────────────────── */
.ems-hero {
    position: relative;
    width: min(114.75rem, 100%);
    aspect-ratio: 114.75 / 58.5;
    max-height: 58.5rem;
    margin-inline: auto;
    border-radius: 80px;
    overflow: hidden;
    box-shadow: 0 6px 30px rgba(0,37,117,.14);
    background: #001a55;
}

.ems-hero-wrap {
    width: 100%;
}

.ems-hero #ems-hero-carousel,
.ems-hero .carousel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ems-hero .carousel-inner {
    width: 100%;
    height: 100%;
}

.ems-hero .carousel-item {
    width: 100%;
    height: 100%;
}

.ems-hero .carousel-item > a {
    display: block;
    width: 100%;
    height: 100%;
}

.ems-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.ems-hero-slogan {
    background: #002575;
    color: #fff;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 14px 48px;
    position: relative;
    letter-spacing: 0.01em;
    border-radius: 0 0 22px 22px;
}
/* Orange bracket accents */
.ems-hero-slogan::before,
.ems-hero-slogan::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ff8900;
}
.ems-hero-slogan::before { left: 14px; }
.ems-hero-slogan::after  { right: 14px; }

/* ─── BANNER POSTER ROW ─────────────────────── */
.ems-banner-row {
    display: flex;
    justify-content: center;
    padding: 18px clamp(1.5rem, 7vw, 8.5rem) 0;
}

.ems-banner-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: clamp(0.75rem, 1.6vw, 1.5rem);
    width: 100%;
    max-width: 114.75rem;
}

.ems-banner-card {
    flex: 0 0 auto;
    width: min(22rem, calc((100% - (2 * clamp(0.75rem, 1.6vw, 1.5rem))) / 3));
    aspect-ratio: 27.75 / 32.813;
    border-radius: 14px;
    overflow: hidden;
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    transition: box-shadow .2s, transform .2s;
}

.ems-banner-card:hover {
    box-shadow: 0 6px 24px rgba(0,37,117,.15);
    transform: translateY(-2px);
}

.ems-banner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ems-banner-scroll-wrap {
    --ems-banner-scroll-pad: 12px;
    width: 100%;
    max-width: 114.75rem;
}

.ems-banner-grid {
    scrollbar-width: thin;
    scrollbar-color: #9eb6d8 #eef2f8;
}

.ems-banner-grid::-webkit-scrollbar {
    height: 10px;
}

.ems-banner-grid::-webkit-scrollbar-track {
    background: #eef2f8;
    border-radius: 999px;
}

.ems-banner-grid::-webkit-scrollbar-thumb {
    background: #9eb6d8;
    border-radius: 999px;
    border: 2px solid #eef2f8;
}

.ems-banner-grid::-webkit-scrollbar-thumb:hover {
    background: #6b8fc4;
}

/* ─── SECTION HEADER ────────────────────────── */
.ems-section-wrap {
    padding: 48px 0 0;
    margin-bottom: 36px;
}
.ems-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}
.ems-section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #111;
    margin: 0;
    letter-spacing: -0.01em;
}
.ems-see-all {
    font-size: 0.95rem;
    color: #4b6fd4;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.ems-see-all:hover { color: #002575; text-decoration: underline; }

/* ─── CONTENT CARDS ─────────────────────────── */
.ems-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 14px rgba(0,0,0,.08);
    border: none;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.ems-card:hover {
    box-shadow: 0 8px 28px rgba(0,37,117,.14);
    transform: translateY(-3px);
}
.ems-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.ems-card-body {
    padding: 16px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ems-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ems-card-sub {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 4px;
}
.ems-card-footer-row {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
}
.ems-card-date { font-size: 0.82rem; color: #aaa; }
.ems-read-more {
    font-size: 0.875rem;
    color: #4b6fd4;
    font-weight: 600;
    text-decoration: none;
}
.ems-read-more:hover { color: #002575; text-decoration: underline; }

/* ─── SECTION HORIZONTAL SCROLL ─────────────── */
.ems-section-scroll-wrap {
    --ems-section-scroll-pad: 12px;
}

.ems-section-scroll {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #9eb6d8 #eef2f8;
}

.ems-section-scroll__item {
    min-width: 0;
}

.ems-section-scroll::-webkit-scrollbar {
    height: 10px;
}

.ems-section-scroll::-webkit-scrollbar-track {
    background: #eef2f8;
    border-radius: 999px;
}

.ems-section-scroll::-webkit-scrollbar-thumb {
    background: #9eb6d8;
    border-radius: 999px;
    border: 2px solid #eef2f8;
}

.ems-section-scroll::-webkit-scrollbar-thumb:hover {
    background: #6b8fc4;
}

/* ─── FOOTER ─────────────────────────────────── */
.ems-footer-wrap {
    padding: 36px 16px 32px;
    max-width: 1260px;
    margin-inline: auto;
}
.ems-footer {
    background: #eef1f8;
    border-radius: 20px;
    padding: 32px 36px 24px;
}
.ems-footer-body {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 48px;
    justify-content: space-between;
}
.ems-footer-col {
    flex: 1 1 280px;
}
.ems-footer-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #606060;
    margin-bottom: 14px;
    letter-spacing: 0.01em;
}
.ems-footer-contact-block,
.ems-footer-social-link {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ems-footer-icon {
    color: #002575;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.ems-footer-sep {
    display: inline-block;
    width: 1px;
    height: 28px;
    background: #c5cad6;
    flex-shrink: 0;
}
.ems-footer-contact-text {
    font-size: 0.92rem;
    color: #606060;
    line-height: 1.65;
}
.ems-footer-social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    align-items: center;
}
.ems-footer-social-link {
    color: #606060;
    text-decoration: none;
    font-size: 0.92rem;
}
.ems-footer-social-link:hover {
    color: #002575;
    text-decoration: none;
}
.ems-footer-copyright {
    margin-top: 22px;
    text-align: right;
    color: #002575;
    font-weight: 700;
    font-size: 0.92rem;
}
.ems-footer-link {
    color: #606060;
    text-decoration: none;
    font-size: 0.92rem;
}
.ems-footer-link:hover { color: #002575; text-decoration: underline; }
.ems-footer-contact-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.92rem;
    color: #333;
    align-items: flex-start;
}
.ems-footer-contact-row i {
    color: #002575;
    min-width: 18px;
    margin-top: 2px;
}
.ems-footer-menu-col a {
    display: block;
    color: #858EA2;
    text-decoration: none;
    font-size: 0.92rem;
    margin-bottom: 6px;
}
.ems-footer-menu-col a:hover { color: #002575; }

/* ─── RESPONSIVE ──────────────────────────────── */
@media (max-width: 991px) {
    .ems-header-title {
        display: none;
    }

    .ems-header__actions {
        gap: 8px;
    }

    .ems-btn-feedback__label,
    .ems-btn-login__name,
    .ems-btn-login__label {
        display: none;
    }

    .ems-btn-feedback,
    .ems-btn-login {
        width: 42px;
        height: 42px;
        padding: 0;
        gap: 0;
        justify-content: center;
        max-width: none;
    }

    .ems-btn-feedback .fa {
        font-size: 1.15rem;
    }

    .ems-btn-login__icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    .ems-btn-login.dropdown-toggle::after {
        display: none;
    }

    .ems-home-menu-toggle {
        width: 42px;
        height: 42px;
    }

    .ems-hero-wrap {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding: 0;
        margin-top: 0;
        margin-bottom: 0.75rem;
    }

    .ems-hero {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        max-height: none;
    }

    .ems-banner-row {
        padding: 18px 0 0;
    }

    .ems-banner-scroll-wrap {
        margin-inline: calc(-1 * var(--ems-banner-scroll-pad));
        padding-inline: var(--ems-banner-scroll-pad);
    }

    .ems-banner-grid {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: scroll;
        overflow-y: hidden;
        gap: 1rem;
        max-width: none;
        padding-bottom: 14px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .ems-banner-card {
        flex: 0 0 clamp(240px, 78vw, 22rem);
        width: clamp(240px, 78vw, 22rem);
        scroll-snap-align: start;
    }

    .ems-footer-wrap {
        padding: 28px 12px 24px;
    }

    .ems-footer {
        padding: 24px 24px 20px;
        border-radius: 16px;
    }

    .ems-footer-body {
        gap: 24px 32px;
    }

    .ems-footer-col {
        flex: 1 1 220px;
    }

    .ems-section-scroll-wrap {
        --ems-section-scroll-pad: 12px;
        margin-inline: calc(-1 * var(--ems-section-scroll-pad));
        padding-inline: var(--ems-section-scroll-pad);
    }

    .ems-section-scroll {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        grid-template-columns: none;
        overflow-x: scroll;
        overflow-y: hidden;
        gap: 1.25rem;
        padding-bottom: 14px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .ems-section-scroll__item {
        flex: 0 0 clamp(280px, 82vw, 340px);
        width: clamp(280px, 82vw, 340px);
        scroll-snap-align: start;
    }

    .ems-section-wrap {
        padding-top: 36px;
        margin-bottom: 32px;
    }

    .ems-section-title {
        font-size: 1.5rem;
    }

    .ems-see-all {
        font-size: 1rem;
    }

    .ems-card {
        height: 100%;
    }

    .ems-card-body {
        padding: 18px 18px 20px;
        max-height: 260px;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: #c5d4ea transparent;
    }

    .ems-card-body::-webkit-scrollbar {
        width: 6px;
    }

    .ems-card-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .ems-card-body::-webkit-scrollbar-thumb {
        background: #c5d4ea;
        border-radius: 999px;
    }

    .ems-card-title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 1.1rem;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        text-overflow: ellipsis;
    }

    .ems-card-sub {
        font-size: 0.95rem;
        line-height: 1.5;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .ems-card-img {
        height: auto;
        min-height: 200px;
        aspect-ratio: 4 / 3;
    }

    .ems-card-date,
    .ems-read-more {
        font-size: 0.92rem;
    }
}
@media (max-width: 767px) {
    .ems-hero-slogan { font-size: 0.95rem; padding: 12px 40px; }

    .ems-footer-wrap {
        padding: 20px 10px 18px;
    }

    .ems-footer {
        padding: 20px 16px 16px;
        border-radius: 14px;
    }

    .ems-footer-body {
        flex-direction: column;
        gap: 20px;
    }

    .ems-footer-col {
        flex: 1 1 100%;
    }

    .ems-footer-title {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .ems-footer-contact-text {
        font-size: 0.85rem;
        line-height: 1.55;
    }

    .ems-footer-social-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ems-footer-social-link {
        font-size: 0.85rem;
        align-items: flex-start;
    }

    .ems-footer-social-link span:not(.ems-footer-sep) {
        line-height: 1.4;
        word-break: break-word;
    }

    .ems-footer-copyright {
        text-align: left;
        font-size: 0.82rem;
        margin-top: 16px;
        line-height: 1.5;
    }

    .ems-hero-slogan::before { left: 8px; width: 20px; height: 20px; }
    .ems-hero-slogan::after  { right: 8px; width: 20px; height: 20px; }
}

@media (max-width: 575px) {
    .ems-footer-wrap {
        padding: 16px 8px 14px;
    }

    .ems-footer {
        padding: 16px 14px 14px;
        border-radius: 12px;
    }

    .ems-footer-contact-block {
        align-items: flex-start;
        gap: 10px;
    }

    .ems-footer-sep {
        height: 24px;
        margin-top: 2px;
    }

    .ems-footer-icon {
        font-size: 1rem;
        margin-top: 2px;
    }

    .ems-footer-copyright {
        font-size: 0.78rem;
    }
}

/* Performance / News / Activity / KnowledgeData — card view only on mobile */
@media (max-width: 991px) {
    .contentBox .ems-list-view-toggle {
        display: none !important;
    }

    .contentBox #contentCard {
        display: flex !important;
    }

    .contentBox #contentTable {
        display: none !important;
    }
}

/* Account/Profile — responsive avatar preview (overrides frontend.min.css) */
.user-avatar {
    max-width: 300px;
    width: 100%;
}

.user-avatar img {
    width: 100% !important;
    max-width: 300px !important;
    height: auto !important;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.user-avatar button {
    bottom: 8px !important;
    right: 8px !important;
}

@media (max-width: 575px) {
    .user-avatar {
        max-width: min(260px, calc(100vw - 2.5rem));
        margin-inline: auto;
    }

    .user-avatar button {
        padding: 8px;
        bottom: 6px !important;
        right: 6px !important;
    }
}
