/**
 * Profile Template Custom Styles (v2.8 - Aesthetics & Grid Fix)
 * 
 * Target: Highly polished UI, fixed Grid alignment, and better responsiveness.
 */

/* ========================================
   CSS VARIABLES
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) {
    --color-primary: #4682b4; /* steelblue */
    --color-primary-light: #f0f7ff;
    --color-primary-border: #cbdff0;
    --color-accent: #daa520; /* goldenrod */
    --color-bg-white: #ffffff;
    --color-bg-lighter: #fafafa;
    --color-border-light: #dbe3ef;
    --color-text-main: #1e293b;
    --color-text-secondary: #475569;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-bg-light: #f8fafc;
    --color-heading-2: #334155; /* deep gray for level-2 headings */

    --wrapper-pad-x: 24px;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 14px;
    --spacing-xl: 16px;
    --spacing-2xl: 20px;
    --spacing-3xl: 24px;
    --spacing-4xl: 30px;

    --border-radius-sm: 8px;
    --border-radius-md: 10px;
    --border-radius-lg: 12px;
    --border-radius-full: 999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.05);

    --font-weight-semi: 600;
    --font-weight-bold: 700;

    --soso-chart-color-current: rgba(70, 130, 180, 0.7);
    --soso-chart-color-previous: rgba(70, 130, 180, 0.35);
    --soso-chart-color-border: rgba(70, 130, 180, 1);
    --soso-chart-color-line: var(--color-accent);
}

/* ========================================
   AI 解读 + 排名卡片并排（Profile）
   ======================================== */

/* Desktop: if a section has both AI summary + ranking box, render them side-by-side */
@media (min-width: 769px) {
    #profile-template-wrapper .soso-sp-ai-ranking-row {
        display: flex;
        align-items: stretch;
        gap: 16px;
        margin: 20px;
    }

    #profile-template-wrapper .soso-sp-ai-ranking-row > .soso-ai-section-summary,
    #profile-template-wrapper .soso-sp-ai-ranking-row > .soso-sp-ranking-cards-grid,
    #profile-template-wrapper .soso-sp-ai-ranking-row > .soso-sp-ranking-card {
        flex: 1 1 0;
        min-width: 0;
    }

    /* Ranking cards grid can contain multiple cards; stack them in the right column to avoid squeezing */
    #profile-template-wrapper .soso-sp-ai-ranking-row > .soso-sp-ranking-cards-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 0;
    }

    #profile-template-wrapper .soso-sp-ai-ranking-row > .soso-sp-ranking-card {
        margin: 0;
    }
}

/* Mobile: tighten title + AI box spacing, and set AI body font-size to 13px */
@media (max-width: 768px) {
    #profile-template-wrapper .soso-sp-section-title {
        margin-bottom: 6px;
    }

    #profile-template-wrapper .soso-sp-section-title + .soso-ai-section-summary,
    #profile-template-wrapper .soso-sp-section-title + .soso-sp-ai-ranking-row {
        margin: 10px;
    }

    #profile-template-wrapper .soso-ai-section-summary__body {
        font-size: 13px;
        line-height: 1.65;
    }

    #profile-template-wrapper .soso-ai-section-summary__body p,
    #profile-template-wrapper .soso-ai-section-summary__body li {
        font-size: inherit;
    }
}

/* Profile: tables line-height (global) */
#profile-template-wrapper table th,
#profile-template-wrapper table td {
    line-height: 1.5 !important;
}

/* ========================================
   PROFILE SUGGESTION (Wiki-like feedback)
   ======================================== */

.soso-sp-suggest-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000000;
}

.soso-sp-suggest-modal.is-open {
    display: block;
}

.soso-sp-suggest-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.soso-sp-suggest-modal__dialog {
    position: relative;
    width: min(560px, calc(100vw - 24px));
    margin: 6vh auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 18px 18px 16px;
    color: #0f172a;
}

.soso-sp-suggest-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #334155;
}

.soso-sp-suggest-modal__title {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 900;
}

.soso-sp-suggest-modal__desc {
    margin: 0 0 14px 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
}

.soso-sp-suggest-hp {
    display: none;
}

.soso-sp-suggest-field {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.soso-sp-suggest-field > span {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.soso-sp-suggest-field input,
.soso-sp-suggest-field textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    outline: none;
}

@media (max-width: 768px) {
    .soso-sp-suggest-field input,
    .soso-sp-suggest-field textarea {
        font-size: 16px;
    }
}

.soso-sp-suggest-field textarea {
    resize: vertical;
    min-height: 120px;
}

.soso-sp-app-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    gap: 8px;
    align-items: stretch;
    justify-content: space-around;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(226, 232, 240, 1);
}

.soso-sp-app-nav__item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.1;
    cursor: pointer;
}

.soso-sp-app-nav__item:hover {
    color: #334155;
}

.soso-sp-app-nav__item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

.soso-sp-app-nav__text {
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.soso-sp-fav-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000001;
}

.soso-sp-fav-modal.is-open {
    display: block;
}

.soso-sp-fav-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.soso-sp-fav-modal__dialog {
    position: relative;
    width: min(560px, calc(100vw - 24px));
    margin: 10vh auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 18px 18px 16px;
    color: #0f172a;
}

.soso-sp-fav-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #334155;
}

.soso-sp-fav-modal__title {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 900;
}

.soso-sp-fav-modal__desc {
    margin: 0 0 14px 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
}

.soso-sp-fav-list {
    display: grid;
    gap: 10px;
}

.soso-sp-fav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.soso-sp-fav-item__thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.soso-sp-fav-item__meta {
    flex: 1;
    min-width: 0;
}

.soso-sp-fav-item__name {
    display: block;
    font-size: 13px;
    font-weight: 900;
    color: #0f172a;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soso-sp-fav-item__type {
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soso-sp-fav-item__remove {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #b91c1c;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    flex-shrink: 0;
}

.soso-sp-fav-empty {
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.soso-sp-note-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.soso-sp-note-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000002;
}

.soso-sp-note-modal.is-open {
    display: block;
}

.soso-sp-note-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.soso-sp-note-modal__dialog {
    position: relative;
    width: min(560px, calc(100vw - 24px));
    margin: 10vh auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 18px 18px 16px;
    color: #0f172a;
}

.soso-sp-note-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #334155;
}

.soso-sp-note-modal__title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 900;
}

.soso-sp-note-modal__body {
    font-size: 12px;
    line-height: 1.7;
    color: #334155;
    white-space: pre-wrap;
}

.soso-sp-sources-acc {
    border: 1px solid var(--color-border-light) !important;
    border-radius: 12px !important;
    background: var(--color-bg-white) !important;
    overflow: hidden !important;
    margin-top: 14px !important;
}

.soso-sp-sources-acc__summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    color: var(--color-text-main);
    font-weight: 900;
    font-size: 14px;
    background: var(--color-bg-lighter);
    border-bottom: 1px solid var(--color-border-light);
}

.soso-sp-sources-acc__summary::-webkit-details-marker { display: none; }

.soso-sp-sources-acc__chev {
    margin-left: auto;
    transition: transform 0.2s ease;
}

details.soso-sp-sources-acc[open] .soso-sp-sources-acc__chev {
    transform: rotate(180deg);
}

.soso-sp-sources-acc__body {
    padding: 10px 12px 14px;
    background: var(--color-bg-white);
}

.soso-sp-suggest-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 6px;
}

.soso-sp-suggest-submit,
.soso-sp-suggest-cancel {
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 800;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.soso-sp-suggest-submit {
    background: var(--color-primary, #4682b4);
    color: #fff;
    border-color: rgba(0,0,0,0.04);
}

.soso-sp-suggest-cancel {
    background: #fff;
    color: #334155;
}

.soso-sp-suggest-status {
    margin-top: 10px;
    font-size: 13px;
    color: #475569;
    min-height: 18px;
}

/* ========================================
   GENERAL RESET
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
    color: var(--color-text-main) !important;
    line-height: 1.6 !important;
    width: 100% !important;
    padding: 0;
    box-sizing: border-box !important;
    background: transparent !important;
}

/* Elementor single templates bypass #content; mirror the theme's 10px padding here. */
body.elementor-page :is(#profile-template-wrapper, #university-template-wrapper),
body[class*="elementor-page"] :is(#profile-template-wrapper, #university-template-wrapper),
body[class*="elementor-page-"] :is(#profile-template-wrapper, #university-template-wrapper) {
    padding-inline: 10px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) *, 
:is(#profile-template-wrapper, #university-template-wrapper) *::before, 
:is(#profile-template-wrapper, #university-template-wrapper) *::after {
    box-sizing: inherit !important;
}

/* Visibility Fixes */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-d-short { display: none !important; }
@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) {
        padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    }

    .soso-sp-app-nav {
        display: flex;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-d-full { display: none !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-d-short { display: inline !important; }
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-prevnext-nav {
    display: flex !important;
    gap: 14px !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 18px 0 0 0 !important;
    padding: 12px !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    background: var(--color-bg-white) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-prevnext-nav a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    border: 1px solid var(--color-primary) !important;
    border-radius: var(--border-radius-sm) !important;
    text-decoration: none !important;
    color: var(--color-primary) !important;
    background: var(--color-bg-white) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-prevnext-nav a:hover {
    background: var(--color-primary-light) !important;
    text-decoration: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-prevnext-nav a.soso-sp-prevnext-nav--disabled {
    opacity: 0.45 !important;
    border-style: dashed !important;
    pointer-events: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-bottom-nav {
    display: none !important;
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-prevnext-nav {
        display: flex !important;
        gap: 10px !important;
        padding: 10px !important;
        margin: 14px 0 0 0 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-prevnext-nav a {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        justify-content: center !important;
        padding: 12px 10px !important;
        font-size: 15px !important;
    }
}

/* ========================================
   1. HEADER AREA (The Hero Section)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header {
    display: flex !important;
    flex-direction: row !important;
    gap: 30px !important;
    background: #fff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 0 !important;
    padding: 30px !important;
    margin-bottom: 30px !important;
    box-shadow: var(--shadow-md) !important;
    position: relative !important;
    margin-left: calc(var(--wrapper-pad-x) * -1) !important;
    margin-right: calc(var(--wrapper-pad-x) * -1) !important;
    padding-left: calc(var(--wrapper-pad-x) + 30px) !important;
    padding-right: calc(var(--wrapper-pad-x) + 30px) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-photo {
    width: 384px !important;
    height: 288px !important;
    flex-shrink: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    border: 1px solid #f1f5f9 !important;
    box-shadow: var(--shadow-sm) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-photo:hover img {
    transform: scale(1.05) !important;
}

/* Photo Carousel */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-photo.soso-sp-photo--carousel {
    position: relative !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-carousel-track {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    transform: translateX(0);
    transition: transform 300ms ease !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-carousel-slide {
    flex: 0 0 100% !important;
    height: 100% !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-names {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-names h1 {
    font-size: 32px !important;
    font-weight: 800 !important;
    margin: 0 0 10px 0 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-name-lines {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 15px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-name-lines li {
    font-size: 16px !important;
    color: var(--color-text-secondary) !important;
    margin-bottom: 4px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-desc {
    margin-top: 14px !important;
    color: var(--color-text-main) !important;
    line-height: 1.8 !important;
    font-weight: 500 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-desc p {
    margin: 0 0 14px 0 !important;
}

/* Infochips / Badges (Ranking chips) */
:is(#profile-template-wrapper, #university-template-wrapper) #soso-sp-header-badges-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin: 14px 0 10px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #soso-sp-header-badges-container .soso-sp-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    border: 1px solid #fcd34d !important;
    border-radius: 9999px !important;
    padding: 6px 16px !important;
    text-decoration: none !important;
    color: #b45309 !important; /* amber-700 */
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease, color 200ms ease !important;
    box-shadow: 0 2px 6px rgba(180, 83, 9, 0.1) !important;
    margin: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #soso-sp-header-badges-container .soso-sp-badge:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 20px rgba(180, 83, 9, 0.2) !important;
    color: #78350f !important; /* amber-900 */
    border-color: #fbbf24 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #soso-sp-header-badges-container .soso-sp-badge i {
    margin: 0 !important;
    color: #d97706 !important; /* amber-600 */
    font-size: 14px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #soso-sp-header-badges-container .soso-sp-badge .dashicons {
    margin: 0 !important;
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 16px !important;
    color: #d97706 !important; /* amber-600 */
}

:is(#profile-template-wrapper, #university-template-wrapper) #soso-sp-header-badges-container .soso-sp-badge-label {
    margin-right: 2px !important;
    font-weight: 600 !important;
    color: inherit !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #soso-sp-header-badges-container .soso-sp-badge-val {
    font-weight: 800 !important;
    font-family: Arial, sans-serif !important;
    color: inherit !important;
    font-size: 16px !important;
    padding: 2px 10px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(251, 191, 36, 0.5) !important;
}

/* Social Buttons */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-social {
    width: 48px !important;
    flex-shrink: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-social-icons {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    align-items: center !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon {
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid var(--color-border) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 8px !important;
    color: var(--color-text-muted) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon svg {
    width: 18px !important;
    height: 18px !important;
    fill: currentColor !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--facebook { color: #1877f2 !important; border-color: rgba(24, 119, 242, 0.35) !important; background: rgba(24, 119, 242, 0.08) !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--instagram { color: #e4405f !important; border-color: rgba(228, 64, 95, 0.35) !important; background: rgba(228, 64, 95, 0.08) !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--youtube { color: #ff0000 !important; border-color: rgba(255, 0, 0, 0.35) !important; background: rgba(255, 0, 0, 0.08) !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--xiaohongshu { color: #ff2442 !important; border-color: rgba(255, 36, 66, 0.35) !important; background: rgba(255, 36, 66, 0.08) !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--whatsapp { color: #25d366 !important; border-color: rgba(37, 211, 102, 0.35) !important; background: rgba(37, 211, 102, 0.08) !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--linkedin { color: #0a66c2 !important; border-color: rgba(10, 102, 194, 0.35) !important; background: rgba(10, 102, 194, 0.08) !important; }

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--facebook:hover { color: #ffffff !important; border-color: #1877f2 !important; background: #1877f2 !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--instagram:hover { color: #ffffff !important; border-color: #e4405f !important; background: #e4405f !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--youtube:hover { color: #ffffff !important; border-color: #ff0000 !important; background: #ff0000 !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--xiaohongshu:hover { color: #ffffff !important; border-color: #ff2442 !important; background: #ff2442 !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--whatsapp:hover { color: #ffffff !important; border-color: #25d366 !important; background: #25d366 !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon--linkedin:hover { color: #ffffff !important; border-color: #0a66c2 !important; background: #0a66c2 !important; }

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-social-icon:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08) !important;
}

/* Header Actions */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-top: auto !important;
    padding-top: 20px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions--hero {
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions__actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-apply-link-btn,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-pdf-export-btn,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-nav-btn,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-link-btn {
    padding: 10px 24px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-apply-link-btn {
    background: var(--color-primary-light) !important;
    border: 1px solid var(--color-primary-border) !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-link-btn {
    background: var(--color-primary-light) !important;
    border: 1px solid var(--color-primary-border) !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-pdf-export-btn {
    background: var(--color-primary-light) !important;
    border: 1px solid var(--color-primary-border) !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-apply-link-btn:hover {
    background: #dbeafe !important;
    border-color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-link-btn:hover {
    background: #dbeafe !important;
    border-color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-pdf-export-btn:hover {
    background: #dbeafe !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 8px 18px rgba(70, 130, 180, 0.18) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions a .dashicons,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions button .dashicons,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions span .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 16px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-nav-btn .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-nav-btn {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--color-text-muted) !important;
    background: #fff !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-nav-btn:hover:not(.soso-sp-header-nav-btn--disabled) {
    color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-nav-btn--disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* ========================================
   2. MAIN LAYOUT & TOC
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-layout {
    display: flex !important;
    flex-direction: row !important;
    gap: 30px !important;
    align-items: flex-start !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-col {
    width: 240px !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 20px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-placeholder {
    display: block !important;
    height: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc {
    background: #fff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 16px !important;
    padding: 8px !important;
    box-shadow: var(--shadow-sm) !important;
    max-height: calc(100vh - 24px) !important;
    overflow: auto !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc.soso-sp-toc--fixed {
    position: fixed !important;
    top: 12px !important;
    z-index: 9999 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-links a {
    display: flex !important;
    align-items: center !important;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    color: var(--color-text-secondary) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    margin-bottom: 2px !important;
    transition: all 0.2s !important;
    font-weight: 500 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-links a:hover {
    background: var(--color-bg-light) !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-links a.soso-sp-active {
    background: var(--color-primary-light) !important;
    color: var(--color-primary) !important;
    font-weight: 700 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-links a .dashicons {
    margin-right: 12px !important;
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-text {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-cn {
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-en {
    font-size: 12px !important;
    line-height: 1.2 !important;
    color: var(--color-text-muted) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-school {
    padding: 12px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 8px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-school--mobile {
    display: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-school--desktop {
    display: flex !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-school img {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-school-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-mobile {
    display: none !important;
    border:1px solid var(--color-border) !important;
    border-radius: 10px;
}

/* ========================================
   3. CONTENT SECTIONS
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-content {
    flex: 1 !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section {
    margin-bottom: 30px !important;
    scroll-margin-top: 30px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-box {
    background: #fff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-sm) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-title {
    background: var(--color-bg-light) !important;
    padding: 18px 24px !important;
    border-bottom: 1px solid var(--color-border) !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-title h2 {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-title .dashicons {
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-title h2 .soso-sp-sub {
    font-size: 15px !important;
    font-weight: 400 !important;
    color: var(--color-text-muted) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary {
    padding: 14px 24px !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    background: linear-gradient(135deg, rgba(240, 247, 255, 0.9), rgba(248, 250, 252, 0.9)) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    color: var(--color-text-main) !important;
    margin: 0 0 8px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__title .dashicons {
    color: var(--color-primary) !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body {
    font-size: 13px !important;
    line-height: 1.75 !important;
    color: var(--color-text-secondary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body p {
    margin: 0 0 8px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body p:last-child {
    margin-bottom: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body ul,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body ol {
    margin: 0 0 8px 20px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body .soso-ai-summary-two-col {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-top: 10px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body .soso-ai-summary-box {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 12px !important;
    padding: 10px 12px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body .soso-ai-summary-box h4 {
    margin: 0 0 8px 0 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: var(--color-text-main) !important;
    padding: 0 !important;
    border: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body .soso-ai-summary-box h4::before {
    display: none !important;
}

@media (max-width: 900px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body .soso-ai-summary-two-col {
        grid-template-columns: 1fr !important;
    }
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-body {
    padding: 30px !important;
}

/* Reduce whitespace for Overview section */
:is(#profile-template-wrapper, #university-template-wrapper) #overview .soso-sp-section-body {
    padding-top: 18px !important;
    padding-bottom: 22px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-body > :first-child {
    margin-top: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-body > :last-child {
    margin-bottom: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section p {
    margin: 0 0 12px 0 !important;
    color: var(--color-text-secondary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section a {
    color: var(--color-primary) !important;
    text-decoration: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section a:hover {
    text-decoration: underline !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section h4 {
    margin: 22px 0 12px 0 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: var(--color-heading-2) !important;
    position: relative !important;
    padding: 0 0 8px 26px !important;
    border-bottom: 2px solid var(--color-border-light) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section h4::before {
    content: "\f111" !important; /* dashicons-admin-generic */
    font-family: dashicons !important;
    position: absolute !important;
    left: 0 !important;
    top: 1px !important;
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
    color: var(--color-text-muted) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section h5 {
    margin: 14px 0 8px 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--color-primary) !important;
    position: relative !important;
    padding-left: 22px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section h5::before {
    content: "\f147" !important; /* dashicons-admin-links */
    font-family: dashicons !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 16px !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section ul,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section ol {
    margin: 0 0 12px 0 !important;
    padding-left: 1.2em !important;
    color: var(--color-text-secondary) !important;
}

/* ========================================
   CARD + KEY-VALUE (Overview / Activities, etc.)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-card {
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 18px !important;
    background: var(--color-bg-white) !important;
    box-shadow: var(--shadow-sm) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-card h3 {
    margin: 0 0 14px 0 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--color-text-main) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) h3.soso-sp-card-title {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    color: var(--color-primary) !important;
    margin: 0 0 14px 0 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) h3.soso-sp-card-title .dashicons {
    font-size: 18px !important;
    line-height: 18px !important;
    width: 18px !important;
    height: 18px !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-card ul {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    display: flex !important;
    flex-direction: column !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-card ul li {
    padding: 8px 0 !important;
    margin: 0 !important;
    list-style: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-card ul li + li {
    border-top: 1px solid var(--color-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-kv {
    display: grid !important;
    grid-template-columns: 120px minmax(0, 1fr) !important;
    gap: 8px 16px !important;
    align-items: start !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-kv.soso-sp-kv--compact {
    grid-template-columns: 84px minmax(0, 1fr) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-kv.soso-sp-kv--contact {
    grid-template-columns: 50px minmax(0, 1fr) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-kv .k {
    color: var(--color-text-muted) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-kv .v {
    color: var(--color-text-main) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    word-break: break-word;
    line-height: 1.45 !important;
}

/* Activities: values should be normal weight */
:is(#profile-template-wrapper, #university-template-wrapper) #activities .soso-sp-kv .v {
    font-weight: 400 !important;
}

/* ========================================
   LINKS (Overview / Documents)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-links-group + .soso-sp-links-group {
    margin-top: 14px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-links {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-links a.soso-sp-link {
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-link {
    display: inline-flex !important;
    gap: 5px !important;
    align-items: center !important;
    padding: 8px 12px !important;
    border: 1px solid var(--color-primary-border) !important;
    border-radius: var(--border-radius-sm) !important;
    text-decoration: none !important;
    color: #69727d !important;
    background: var(--color-primary-light) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-link i {
    font-size: 13px !important;
    color: var(--color-heading-2) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-link .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 16px !important;
    color: #0073aa !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-link:hover {
    background: #dbeafe !important;
    text-decoration: none !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
    transform: translateY(-1px) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-link:hover .dashicons {
    color: var(--color-heading-2) !important;
}

/* ========================================
   OVERVIEW LAYOUT (School Overview)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-overview-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-overview-left {
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-overview-right {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-divider {
    height: 1px !important;
    background: var(--color-border) !important;
    margin: 14px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-overview-group-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 800 !important;
    color: var(--color-primary) !important;
    margin: 0 0 var(--spacing-lg) 0 !important;
    font-size: 16px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-overview-group-title .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
    color: var(--color-primary) !important;
}

/* ========================================
   RANKING CARDS (Exam / Fees / Placement)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-card {
    background: var(--color-bg-white) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 18px !important;
    margin: 0 0 24px 0 !important;
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid #f1f5f9 !important;
    display: flex !important;
    flex-direction: column !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin: 0 0 24px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ai-ranking-row > .soso-sp-ranking-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ai-ranking-row > .soso-sp-ranking-card {
    margin: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-cards-grid .soso-sp-ranking-card {
    margin: 0 !important;
}

/* Desktop: keep ranking cards at 50% width when not in an explicit grid wrapper */
@media (min-width: 1100px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-body > .soso-sp-ranking-card {
        max-width: 50% !important;
    }
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 16px !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding-bottom: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-title {
    font-weight: 800 !important;
    color: var(--color-primary) !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-title .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-badge {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    color: #1e4ed8 !important;
    padding: 6px 16px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    border: 1px solid #bce0fd !important;
    box-shadow: 0 2px 8px rgba(30, 78, 216, 0.12) !important;
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    cursor: default !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-badge strong {
    font-size: 18px !important;
    color: #1d4ed8 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-neighbors-grid {
    display: flex !important;
    gap: 20px !important;
    flex: 1 1 auto !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-neighbor-col {
    flex: 1 1 0 !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-subtitle {
    margin-bottom: 8px !important;
    font-size: 12px !important;
    color: var(--color-text-muted) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-neighbor-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-neighbor-list li {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 6px 0 !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-neighbor-rank {
    font-size: 12px !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    min-width: 36px !important;
    text-align: center !important;
    font-weight: 800 !important;
    flex: 0 0 auto !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-neighbor-rank.r-high {
    background: #ecfdf5 !important;
    color: #047857 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-neighbor-rank.r-low {
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-neighbor-list a {
    text-decoration: none !important;
    color: #334155 !important;
    font-size: 14px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    transition: color 0.2s ease !important;
    font-weight: 600 !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-neighbor-list a:hover {
    color: #2563eb !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-neighbor-empty {
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-style: italic !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-link {
    margin-top: 16px !important;
    text-align: right !important;
    font-size: 13px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-link a {
    color: var(--color-text-muted) !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-link a:hover {
    color: #3b82f6 !important;
    text-decoration: none !important;
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-bottom-nav {
    display: flex !important;
    gap: 14px !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 18px 0 0 0 !important;
    padding: 12px !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    background: var(--color-bg-white) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-bottom-nav a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    border: 1px solid var(--color-primary) !important;
    border-radius: var(--border-radius-sm) !important;
    text-decoration: none !important;
    color: var(--color-primary) !important;
    background: var(--color-bg-white) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-bottom-nav a:hover {
    background: var(--color-primary-light) !important;
    text-decoration: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-bottom-nav a.soso-sp-bottom-nav--disabled {
    opacity: 0.45 !important;
    border-style: dashed !important;
    pointer-events: none !important;
}

/* ========================================
   ACCORDION (DETAILS ELEMENT)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-acc-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-acc {
    background: var(--color-bg-white) !important;
    overflow: hidden !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-acc summary {
    list-style: none !important;
    cursor: pointer !important;
    padding: 12px 16px !important;
    background: var(--color-bg-light) !important;
    font-weight: 700 !important;
    color: var(--color-text-main) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-acc summary::-webkit-details-marker {
    display: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-acc[open] summary {
    background: var(--color-bg-lighter) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-acc-body {
    padding: 10px 0 0 0 !important;
}

/* ========================================
   UNI PLACEMENT (DETAILED RESULTS) FILTER BAR
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-root {
    display: block !important;
    max-width: 100% !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filters {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 10px 12px !important;
    padding: 14px 16px !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    background: var(--color-bg-light) !important;
    margin: 0 0 14px 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    flex: 0 0 auto !important;
    width: 150px !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item label {
    margin: 0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--color-text-secondary) !important;
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-range {
    display: flex !important;
    gap: 6px !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-row {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-row input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-row button {
    flex: 0 0 auto !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-item {
    flex: 1 1 320px !important;
    width: auto !important;
    min-width: 200px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item input,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item select {
    width: 100% !important;
    max-width: 100% !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 5px !important;
    padding: 10px 12px !important;
    background: var(--color-bg-white) !important;
    font-size: 14px !important;
    color: var(--color-text-main) !important;
    line-height: 1.2 !important;
    height: 40px !important;
    outline: none !important;
    box-sizing: border-box !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-range input[type="number"] {
    width: 64px !important;
    max-width: 64px !important;
    padding: 10px 8px !important;
    height: 40px !important;
    text-align: center !important;
    font-size: 14px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item.soso-upt-country-item select {
    width: 120px !important;
    max-width: 120px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item input:focus,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item select:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(70, 130, 180, 0.15) !important;
}

/* Reset buttons should follow theme default button styles (reset.css). */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-table-wrap {
    max-width: 100% !important;
    max-height: 70vh !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    position: relative !important;
    border-radius: 14px !important;
    border: 1px solid var(--color-border) !important;
    background: var(--color-bg-white) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-note {
    margin-top: 12px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 12px !important;
    background: var(--color-bg-light) !important;
    color: var(--color-text-secondary) !important;
    line-height: 1.65 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-note-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 800 !important;
    color: var(--color-text-main) !important;
    margin-bottom: 8px !important;
    font-size: 13px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-note-title .dashicons {
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-note-body p {
    margin: 0 0 6px 0 !important;
    font-size: 12px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-note-body p:last-child {
    margin-bottom: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-table-wrap table {
    margin: 0 !important;
    border: 0 !important;
}

/* Uni Placement table: keep desktop fully visible (no horizontal scrollbar) */
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: var(--color-primary) !important;
    color: #fff !important;
    font-weight: 700 !important;
    text-align: center !important;
    padding: 10px 6px !important;
    border-bottom: 2px solid var(--color-border-light) !important;
    white-space: normal !important;
    vertical-align: middle !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td {
    padding: 8px 6px !important;
    border-bottom: 1px solid var(--color-border) !important;
    text-align: center !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-weight:500;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table thead th:first-child,
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td:first-child {
    width: 150px !important;
    max-width: 150px !important;
    text-align: left !important;
    overflow: hidden !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td:first-child .university-name {
    display: block !important;
    max-width: 150px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table .university-name-chinese {
    font-weight: 600 !important;
    color: var(--color-text-main) !important;
    line-height: 1.25 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table .university-name-english {
    font-size: 12px !important;
    color: var(--color-text-muted) !important;
    line-height: 1.2 !important;
    margin-top: 2px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

@media (max-width: 960px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item {
        width: 100% !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item.soso-upt-country-item select {
        width: 100% !important;
        max-width: 100% !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-row {
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: wrap !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-row button {
        padding: 8px 10px !important;
        width: 74px !important;
        max-width: 74px !important;
        white-space: nowrap !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-range input[type="number"] {
        width: 72px !important;
        max-width: 72px !important;
    }
}

/* Mobile/tablet: allow horizontal scroll + sticky header/first column */
@media (max-width: 768px) {
    /* 1. Remove Padding (utilizing :has to target specific accordion body) */
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-acc-body:has(.soso-upt-root) {
        padding: 0 !important;
    }

    /* 2. Reset negative margins (restore normal flow as padding is removed) */
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-root {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filters {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px 12px !important;
        align-items: end !important;
        padding: 12px !important;
        /* Remove borders/radius to flush with edges */
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        margin-bottom: 0 !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item {
        width: auto !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item--qs { grid-column: 1 !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item--us { grid-column: 2 !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item--the { grid-column: 1 !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item--country { grid-column: 2 !important; }
    
    /* 3. Fix Search Item Overflow */
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item--search { 
        grid-column: 1 / -1 !important;
        min-width: 0 !important; /* Critical for grid item shrinking */
        width: 100% !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item input,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-item select {
        padding: 8px 10px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
        height: 36px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-range {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-filter-range input[type="number"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 8px !important;
        font-size: 13px !important;
        height: 36px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-row {
        flex-wrap: nowrap !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Allow input to shrink properly */
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-row input {
        min-width: 0 !important;
        flex: 1 1 auto !important;
        width: auto !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-row button {
        font-size: 0.75rem !important;
        padding: 8px 10px !important;
        width: 72px !important;
        max-width: 72px !important;
        flex: 0 0 auto !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-table-wrap {
        max-height: 62vh !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
        --upt-first-col: 80px;
        --upt-col: 64px;
        /* Remove borders/radius to flush with edges */
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-note-title,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-note-body p {
        font-size: 12px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table {
        width: max-content !important;
        min-width: calc(var(--upt-first-col, 80px) + (var(--other-cols, 8) * var(--upt-col, 64px))) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table th,
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td {
        font-size: 12px !important;
        padding: 8px 6px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table th:not(:first-child),
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td:not(:first-child) {
        width: var(--upt-col, 64px) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table thead th:first-child,
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td:first-child {
        width: var(--upt-first-col, 80px) !important;
        max-width: var(--upt-first-col, 80px) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td:first-child .university-name {
        max-width: var(--upt-first-col, 80px) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table thead th:first-child,
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td:first-child {
        position: sticky !important;
        left: 0 !important;
        z-index: 15 !important;
        background: var(--color-bg-white) !important;
        /* Sticky Border Fix: Outer blocking shadow + Inner borders + Drop shadow */
        box-shadow: -1px 0 0 var(--color-bg-white), inset -1px 0 0 var(--color-border), inset 1px 0 0 var(--color-border), 2px 0 6px -2px rgba(0,0,0,0.12) !important;
        border-right: 1px solid var(--color-border) !important;
        border-bottom: 1px solid var(--color-border) !important;
        /* Mobile Font Styles */
        font-weight: 600 !important;
        font-size: 12px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td:first-child::before,
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table thead th:first-child::before {
        content: "" !important;
        position: absolute !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 1px !important;
        background: var(--color-border) !important;
        pointer-events: none !important;
    }

    /* Draw divider line via pseudo-element (stable under border-collapse + sticky) */
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table td:first-child::after {
        content: "" !important;
        position: absolute !important;
        top: 0 !important;
        bottom: 0 !important;
        right: -1px !important;
        width: 2px !important;
        background: var(--color-border) !important;
        pointer-events: none !important;
    }

    /* Odd rows need matching background for the blocker shadow */
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table tbody tr:nth-child(odd) td:first-child {
        background: var(--color-bg-lighter) !important;
        box-shadow: -1px 0 0 var(--color-bg-lighter), inset -1px 0 0 var(--color-border), inset 1px 0 0 var(--color-border), 2px 0 6px -2px rgba(0,0,0,0.12) !important;
        border-right: 1px solid var(--color-border) !important;
        border-bottom: 1px solid var(--color-border) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table tbody tr:nth-child(even) td:first-child {
        background: var(--color-bg-white) !important;
        box-shadow: -1px 0 0 var(--color-bg-white), inset -1px 0 0 var(--color-border), inset 1px 0 0 var(--color-border), 2px 0 6px -2px rgba(0,0,0,0.12) !important;
        border-right: 1px solid var(--color-border) !important;
        border-bottom: 1px solid var(--color-border) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table tbody tr:hover td:first-child {
        background: #eef6ff !important;
        box-shadow: -1px 0 0 #eef6ff, inset -1px 0 0 var(--color-border), inset 1px 0 0 var(--color-border), 2px 0 6px -2px rgba(0,0,0,0.12) !important;
        border-right: 1px solid var(--color-border) !important;
        border-bottom: 1px solid var(--color-border) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table thead th:first-child {
        z-index: 20 !important;
        background: var(--color-primary) !important;
        color: #fff !important;
        /* Header needs primary color blocker shadow */
        box-shadow: -1px 0 0 var(--color-primary), inset -1px 0 0 rgba(255,255,255,0.22), inset 1px 0 0 rgba(255,255,255,0.22), 2px 0 6px -2px rgba(0,0,0,0.12) !important;
        border-right: 1px solid rgba(255,255,255,0.25) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table thead th:first-child::after {
        content: "" !important;
        position: absolute !important;
        top: 0 !important;
        bottom: 0 !important;
        right: -1px !important;
        width: 2px !important;
        background: rgba(255,255,255,0.25) !important;
        pointer-events: none !important;
    }

    /* Target Country Column to show at least 4 chars */
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table .col-country,
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-upt-table th[data-sort-key="country"] {
        width: 70px !important;
        min-width: 70px !important;
        white-space: normal !important;
    }

    /* In some mobile overlays, content may be rendered outside template wrappers. Keep UniPlacement table compact everywhere. */
    .soso-upt-table-wrap {
        --upt-first-col: 80px;
        --upt-col: 64px;
    }

    .soso-upt-table-wrap table.soso-upt-table {
        width: max-content !important;
        min-width: calc(var(--upt-first-col, 80px) + (var(--other-cols, 8) * var(--upt-col, 64px))) !important;
    }

    .soso-upt-table-wrap table.soso-upt-table th:not(:first-child),
    .soso-upt-table-wrap table.soso-upt-table td:not(:first-child) {
        width: var(--upt-col, 64px) !important;
    }

    .soso-upt-table-wrap table.soso-upt-table thead th:first-child,
    .soso-upt-table-wrap table.soso-upt-table td:first-child {
        width: var(--upt-first-col, 80px) !important;
        max-width: var(--upt-first-col, 80px) !important;
    }

    .soso-upt-table-wrap table.soso-upt-table td:first-child::after {
        right: -1px !important;
        width: 2px !important;
    }

    .soso-upt-table-wrap table.soso-upt-table thead th:first-child::after {
        right: -1px !important;
        width: 2px !important;
    }
}

/* UniPlacement: desktop search row should not hug the right edge */
@media (min-width: 961px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-item .soso-upt-search-row {
        padding-right: 8px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-upt-search-item .soso-upt-search-row button {
        margin-right: 8px !important;
    }
}

/* ========================================
   RELATIONS
   ======================================== */

/* ========================================
   PLACEMENT BY COUNTRY (PBC) TABS
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-tabs {
    display: inline-flex !important;
    gap: 8px !important;
    margin: 0 0 12px 0 !important;
    padding: 4px !important;
    background: var(--color-bg-light) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 999px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-tab-btn {
    appearance: none !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--color-text-muted) !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    cursor: pointer !important;
    line-height: 1 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-tab-btn.is-active {
    background: var(--color-primary-light) !important;
    color: var(--color-primary) !important;
    border: 1px solid var(--color-primary-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    justify-content: center !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-card {
    flex: 1 1 300px !important;
    max-width: 420px !important;
    min-width: 250px !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    background: var(--color-bg-white) !important;
    padding: 14px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-card-title {
    margin: 0 0 10px 0 !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: var(--color-heading-2) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-chart-container {
    position: relative !important;
    height: 260px !important;
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-card {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-chart-container {
        height: 240px !important;
    }
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-relations {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-relations-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 280px !important;
    gap: 16px !important;
    align-items: center !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-relations-desc {
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    background: var(--color-bg-lighter) !important;
    color: var(--color-text-main) !important;
    line-height: 1.6 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 14px 16px !important;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-relations-desc-body {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-relations-desc:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(70, 130, 180, 0.12) !important;
    background: var(--color-bg-white) !important;
    border-color: var(--color-primary-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-relations-desc-title {
    color: var(--color-text-main) !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid var(--color-border-light) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-relations-desc-title .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-rel {
    display: flex !important;
    gap: 16px !important;
    align-items: center !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 14px 16px !important;
    text-decoration: none !important;
    color: inherit !important;
    background: var(--color-bg-white) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-rel:hover {
    background: var(--color-bg-light) !important;
    text-decoration: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-rel-img {
    width: 56px !important;
    height: 56px !important;
    border-radius: var(--border-radius-md) !important;
    overflow: hidden !important;
    background: #f5f5f5 !important;
    border: 1px solid var(--color-border) !important;
    flex: 0 0 auto !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-rel-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-rel-txt {
    flex: 1 !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-rel-title {
    font-weight: 800 !important;
    color: var(--color-text-main) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-rel-sub {
    color: var(--color-text-muted) !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-three-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
}

/* ========================================
   DSE STATS (Placement)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-wrap {
    display: block !important;
    margin-bottom: 30px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-chart-container {
    position: relative !important;
    height: 320px !important;
    width: 100% !important;
    margin-bottom: 25px !important;
    background: var(--color-bg-white) !important;
    border: 1px solid #e9ecef !important;
    border-radius: 10px !important;
    padding: 15px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-table-container {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 12px !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table th {
    background: var(--color-primary) !important;
    color: #fff !important;
    padding: 10px 6px !important;
    text-align: center !important;
    white-space: normal !important;
    word-wrap: break-word;
    vertical-align: middle !important;
    border: 1px solid #dee2e6 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table td {
    padding: 10px 6px !important;
    border: 1px solid #dee2e6 !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: normal !important;
    word-wrap: break-word;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table th:first-child {
    width: 34% !important;
    text-align: left !important;
    padding-left: 8px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table th:nth-child(2) { width: 22% !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table th:nth-child(3) { width: 22% !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table th:nth-child(4) { width: 22% !important; }

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table tr:nth-child(odd) td { background-color: #fafafa !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table tr:nth-child(even) td { background-color: #ffffff !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table tr:hover td { background-color: #e2e6ea !important; }

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table td:first-child {
    text-align: left !important;
    padding-left: 8px !important;
    font-weight: 800 !important;
    color: #2c3e50 !important;
}

@media (max-width: 600px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-chart-container {
        height: min(380px, 92vw) !important;
        padding: 10px !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table { font-size: 12px !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table th,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-dse-stats-table td {
        padding: 8px 4px !important;
        font-size: 12px !important;
    }
}

/* ========================================
   FAQ ACCORDION
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-container {
    max-width: 100% !important;
    margin: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-item {
    background: var(--color-bg-white) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-sm) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-header {
    width: 100% !important;
    padding: 12px 16px !important;
    background: var(--color-bg-light) !important;
    border: none !important;
    text-align: left !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: var(--color-text-main) !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
    min-height: 48px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-header:hover {
    background: var(--color-primary-light) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-header.active {
    background: var(--color-primary) !important;
    color: #fff !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-question-number {
    background: var(--color-primary) !important;
    color: #fff !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-header.active .soso-sp-faq-question-number {
    background: #fff !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-question-text {
    flex: 1 !important;
    min-width: 0 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    line-height: 1.45 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-icon {
    font-size: 14px !important;
    font-weight: 900 !important;
    transition: transform 0.2s ease, color 0.2s ease !important;
    margin-left: 12px !important;
    color: var(--color-primary) !important;
    flex-shrink: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-header.active .soso-sp-faq-accordion-icon {
    transform: rotate(45deg) !important;
    color: #fff !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-content {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.25s ease !important;
    background: var(--color-bg-white) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-content.active {
    max-height: 1200px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-answer-wrapper {
    padding: 12px 16px !important;
    line-height: 1.65 !important;
    color: var(--color-text-secondary) !important;
    border-top: 1px solid #f1f5f9 !important;
    font-size: 14px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-answer-wrapper p {
    margin: 0 0 10px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-answer-wrapper p:last-child {
    margin-bottom: 0 !important;
}

@media (max-width: 480px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-header {
        font-size: 13px !important;
        padding: 10px 12px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-question-number {
        width: 20px !important;
        height: 20px !important;
        font-size: 11px !important;
        margin-right: 10px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-icon {
        font-size: 13px !important;
        margin-left: 10px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-answer-wrapper {
        font-size: 13px !important;
        padding: 10px 12px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-faq-accordion-item {
        margin-bottom: 8px !important;
    }
}

/* ========================================
   SCHOLARSHIP BOXES
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) #scholarship .soso-sp-scholarship-boxes {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #scholarship .soso-sp-scholarship-box {
    padding: 20px !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    background: var(--color-bg-light) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #scholarship .soso-sp-scholarship-box h4 {
    margin-top: 0 !important;
    margin-bottom: 16px !important;
    color: var(--color-primary) !important;
    font-weight: 800 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #scholarship .soso-sp-scholarship-box .soso-sp-card-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 14px 0 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #scholarship .soso-sp-scholarship-box .soso-sp-card-title .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-scholarship-process-list,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-scholarship-criteria-list {
    margin: 0 !important;
    padding-left: 20px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-scholarship-process-list li,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-scholarship-criteria-list li {
    margin-bottom: 8px !important;
    line-height: 1.6 !important;
    color: var(--color-text-secondary) !important;
    font-size: 14px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-scholarship-process-list li + li,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-scholarship-criteria-list li + li {
    border-top: 1px dotted #cbd5e1 !important;
    padding-top: 10px !important;
    margin-top: 10px !important;
}

/* Living: bullet font size */
:is(#profile-template-wrapper, #university-template-wrapper) #living .soso-sp-card ul li {
    font-size: 14px !important;
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-scholarship-process-list li,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-scholarship-criteria-list li,
    :is(#profile-template-wrapper, #university-template-wrapper) #living .soso-sp-card ul li {
        font-size: 14px !important;
    }
}

/* ========================================
   PRINT HELPERS
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-print-only {
    display: none !important;
}

@media print {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-no-print,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-col,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-placeholder,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-social {
        display: none !important;
    }

    /* Print: force UniPlacement tables to fill page width (avoid max-content rules leaking into print preview). */
    .soso-upt-table-wrap {
        overflow: visible !important;
        max-height: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .soso-upt-table-wrap table.soso-upt-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-print-only {
        display: block !important;
    }

    /* Hide interactive link buttons in print/PDF */
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-link,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-link,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-link-btn,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-nav-btn,
    :is(#profile-template-wrapper, #university-template-wrapper) button,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-bottom-nav {
        display: none !important;
    }

    /* Expand all accordions for printing */
    :is(#profile-template-wrapper, #university-template-wrapper) details.soso-sp-acc summary {
        display: none !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) details.soso-sp-acc > :not(summary) {
        display: block !important;
    }

    /* Tighten spacing for fewer pages */
    :is(#profile-template-wrapper, #university-template-wrapper) {
        padding: 0 !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header {
        margin: 0 0 12px 0 !important;
        padding: 12px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-photo {
        width: 260px !important;
        height: 190px !important;
        border-radius: 10px !important;
        box-shadow: none !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-names h1 {
        font-size: 22px !important;
        margin-bottom: 6px !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section {
        margin-bottom: 12px !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-title {
        padding: 10px 12px !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-body {
        padding: 12px !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-card {
        padding: 12px !important;
        box-shadow: none !important;
    }
}

/* ========================================
   4. MOBILE RESPONSIVENESS (POLISHED)
   ======================================== */

@media (max-width: 960px) {
    :is(#profile-template-wrapper, #university-template-wrapper) {
        --wrapper-pad-x: 14px;
        font-size: 13px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header {
        flex-direction: column !important;
        padding: 24px !important;
        gap: 20px !important;
        border-radius: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-photo {
        width: 100% !important;
        height: 220px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-names h1 {
        font-size: 26px !important;
        text-align: center !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-name-lines {
        text-align: center !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-badges {
        justify-content: center !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-social {
        width: 100% !important;
        border-top: 1px solid #f1f5f9 !important;
        padding-top: 15px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-social-icons {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 12px !important;
    }

/* Tablet (640px - 960px): Flex Row (Compact) - All buttons in one line */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 5px !important;
    width: 100% !important;
    overflow: visible !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions__actions {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-apply-link-btn,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-link-btn,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-pdf-export-btn {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    justify-content: center !important;
    padding: 8px 4px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ========================================
   AI SECTION SUMMARY (Profile)
   ======================================== */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary {
    margin: -8px 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--color-primary-border);
    background: rgba(240, 247, 255, 0.7);
    color: var(--color-text-secondary);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0 0 8px 0;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__title .dashicons {
    color: var(--color-primary);
    font-size: 18px;
    line-height: 1;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body {
    font-size: 13px;
    line-height: 1.75;
    color: var(--color-text-secondary);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body p {
    margin: 0 0 8px 0;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body p:last-child {
    margin-bottom: 0;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body ul,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-ai-section-summary__body ol {
    margin: 0 0 8px 20px;
}

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-nav-btn {
        flex-shrink: 0 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-nav-btn {
        width: 32px !important;
        height: 32px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-layout {
        flex-direction: column !important;
        gap: 20px !important;
    }

    /* Mobile safety: prevent any section/card from exceeding viewport width */
    :is(#profile-template-wrapper, #university-template-wrapper),
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-content,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-box,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-body,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-card {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) img,
    :is(#profile-template-wrapper, #university-template-wrapper) iframe,
    :is(#profile-template-wrapper, #university-template-wrapper) video {
        max-width: 100% !important;
        height: auto !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-overview-layout {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-neighbors-grid {
        flex-direction: column !important;
        gap: 14px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-ranking-cards-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-relations-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-three-grid {
        grid-template-columns: 1fr !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-bottom-nav {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-bottom-nav a {
        justify-content: center !important;
        width: auto !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) #scholarship .soso-sp-scholarship-boxes {
        grid-template-columns: 1fr !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-col {
        width: 100% !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 60 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc {
        position: sticky !important;
        top: 0 !important;
        z-index: 60 !important;
        border-radius: 0 !important;
        overflow: visible !important;
        white-space: normal !important;
        max-height: none !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-desktop {
        display: none !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-mobile {
        display: block !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-school--desktop {
        display: none !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-school--mobile {
        display: flex !important;
        padding: 0 !important;
        border-bottom: 0 !important;
        margin: 0 !important;
        gap: 10px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-school--mobile img {
        width: 18px !important;
        height: 18px !important;
        border-radius: 4px !important;
        border: 1px solid var(--color-border) !important;
        box-shadow: none !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-school--mobile .soso-sp-toc-school-title {
        font-size: 15px !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-title {
        padding: 14px 16px !important;
        gap: 10px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-title h2 {
        font-size: 18px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-title h2 .soso-sp-sub {
        font-size: 13px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-body .soso-sp-kv-container {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section-body {
        padding: 10px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section h4 {
        font-size: 16px !important;
        padding-bottom: 6px !important;
        padding-left: 22px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-section h4::before {
        top: 0 !important;
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
        line-height: 16px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table thead th {
        font-size: 12px !important;
        padding: 8px 10px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table td {
        font-size: 12px !important;
        padding: 8px 10px !important;
    }

    /* Table horizontal scroll (avoid page-level overflow) */
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-table-wrapper,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-table-responsive,
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper,
    :is(#profile-template-wrapper, #university-template-wrapper) .table-scroll-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100% !important;
    }
}

/* TOC Mobile Polish */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-mobile summary {
    list-style: none !important;
    padding: 10px 12px !important;
    background: #fff !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-mobile[open] summary {
    background: #fff !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-mobile summary::-webkit-details-marker { display: none !important; }

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc details.soso-sp-toc-mobile summary .soso-sp-toc-toggle {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 1px solid var(--color-border) !important;
    background: #fff !important;
    border-radius: 999px !important;
    padding: 6px 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    color: var(--color-text-main) !important;
    font: inherit !important;
    line-height: 1 !important;
    margin: 0 !important;
    text-transform: none !important;
    box-shadow: none !important;
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc details.soso-sp-toc-mobile summary .soso-sp-toc-toggle:hover {
    background: var(--color-bg-light) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-toggle-text {
    font-weight: 800 !important;
    color: var(--color-primary) !important;
    font-size: 15px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-mobile .soso-sp-acc-body {
    padding: 8px 10px !important;
    max-height: calc(100vh - 64px) !important;
    overflow: auto !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-toggle-icon {
    transition: transform 0.2s ease !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-toc-mobile[open] .soso-sp-toc-toggle-icon {
    transform: rotate(180deg) !important;
}

/* ========================================
   5. COMPONENT SPECIFIC POLISH
   ======================================== */

/* Fees Grid */
:is(#profile-template-wrapper, #university-template-wrapper) .fees-grid-display {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 20px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .fees-grid-card {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 4px solid var(--color-primary) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    box-shadow: var(--shadow-sm) !important;
    transition: transform 0.2s !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .fees-grid-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

/* General Tables (Elementor-proof) */
:is(#profile-template-wrapper, #university-template-wrapper) table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: 1px solid var(--color-border-light) !important;
    background: var(--color-bg-white) !important;
    margin: 12px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table th,
:is(#profile-template-wrapper, #university-template-wrapper) table td,
:is(#profile-template-wrapper, #university-template-wrapper) table tr {
    border-color: var(--color-border-light) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table thead th {
    background: var(--color-primary) !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-align: center !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table td {
    padding: 10px 12px !important;
    border: 1px solid var(--color-border-light) !important;
    text-align: center !important;
    vertical-align: middle !important;
    color: var(--color-text-main) !important;
    font-size: 12px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table th:first-child,
:is(#profile-template-wrapper, #university-template-wrapper) table td:first-child {
    text-align: left !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table tbody tr:nth-child(odd) td {
    background: var(--color-bg-lighter) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table tbody tr:nth-child(even) td {
    background: var(--color-bg-white) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table tbody tr:hover td {
    background: #eef6ff !important;
}

/* ========================================
   APPLICATION TABLES (Apply Section)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) table.application-dates th,
:is(#profile-template-wrapper, #university-template-wrapper) table.application-dates td {
    text-align: center !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.application-dates td {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) table.application-dates {
        table-layout: fixed !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.application-dates thead th,
    :is(#profile-template-wrapper, #university-template-wrapper) table.application-dates td {
        padding: 6px 6px !important;
        font-size: 12px !important;
    }
}

:is(#profile-template-wrapper, #university-template-wrapper) table.safe-grade-table th.col-num,
:is(#profile-template-wrapper, #university-template-wrapper) table.safe-grade-table td.col-num {
    text-align: center !important;
    width: 70px !important;
    white-space: nowrap !important;
}

/* 第二列：申请要求 / 申请流程 / 入学评估 左对齐（申请时间表保持居中） */
:is(#profile-template-wrapper, #university-template-wrapper) table.safe-grade-table th.col-content,
:is(#profile-template-wrapper, #university-template-wrapper) table.safe-grade-table td.col-content {
    text-align: left !important;
}

/* 小标题行（年级行） */
:is(#profile-template-wrapper, #university-template-wrapper) table.safe-grade-table tr.grade-row td.grade-label {
    color: var(--color-primary) !important;
    font-weight: 600 !important;
    background: var(--color-primary-light) !important;
    text-align: left !important;
}

/* ========================================
   6. DATA WRAPPERS (SCROLL)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-table-responsive,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-table-wrapper,
:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper,
:is(#profile-template-wrapper, #university-template-wrapper) .table-scroll-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px !important;
    border: 1px solid var(--color-border) !important;
    background: var(--color-bg-white) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-table-responsive table,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-table-wrapper table,
:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table,
:is(#profile-template-wrapper, #university-template-wrapper) .table-scroll-wrapper table {
    margin: 0 !important;
    border: 0 !important;
}

/* ========================================
   7. FEES (TABS + TABLE)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-fees-tabs-container {
    margin-bottom: 24px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-fees-tab-controls {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin: 0 0 16px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-fees-tab-btn {
    background: var(--color-bg-light) !important;
    border: 1px solid var(--color-border) !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: var(--color-text-muted) !important;
    cursor: pointer !important;
    border-radius: 999px !important;
    transition: all 0.2s ease !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-fees-tab-btn:hover {
    color: var(--color-primary) !important;
    background: var(--color-primary-light) !important;
    border-color: var(--color-primary-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-fees-tab-btn.active {
    color: var(--color-primary) !important;
    background: #f0f7ff !important;
    border-color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-fees-tab-content {
    display: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-fees-tab-content.active {
    display: block !important;
    animation: fadeIn 0.25s ease !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper {
    max-width: 100% !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table {
    min-width: 760px !important;
}

/* Fees: grade column should be centered on desktop */
:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table th:first-child,
:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table td:first-child {
    text-align: center !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper .col-nowrap {
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper th.col-currency,
:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper td.col-currency {
    text-align: center !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper th.col-age,
:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper td.col-age {
    text-align: center !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper .repeater-item {
    display: inline-block;
    white-space: nowrap;
    font-weight: 500;
    line-height: 1.5;
}

:is(#profile-template-wrapper, #university-template-wrapper) .fees-grid-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 12px !important;
    border-bottom: 1px solid var(--color-border) !important;
    padding-bottom: 10px !important;
    margin-bottom: 6px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .fees-grid-grade {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: var(--color-text-main) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .fees-grid-amount {
    font-size: 15px !important;
    font-weight: 900 !important;
    color: var(--color-primary) !important;
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .fees-grid-desc {
    font-size: 13px !important;
    color: var(--color-text-muted) !important;
    line-height: 1.5 !important;
}

@media (max-width: 960px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-fees-tab-btn {
        flex: 1 !important;
        min-width: 140px !important;
        padding: 10px 12px !important;
        text-align: center !important;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table {
        min-width: 680px !important;
    }
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table {
        min-width: 0 !important;
        table-layout: fixed !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table thead th,
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table td {
        padding: 6px 4px !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
        font-weight: 500;
    }

    /* Fit all 7 columns within mobile viewport */
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table th:nth-child(1),
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table td:nth-child(1) { width: 36px !important; text-align: center !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table th:nth-child(2),
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table td:nth-child(2) { width: 44px !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table th:nth-child(3),
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table td:nth-child(3) { width: 36px !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table th:nth-child(4),
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table td:nth-child(4) { width: 64px !important; text-align: center !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table th:nth-child(5),
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table td:nth-child(5) { width: 64px !important; text-align: center !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table th:nth-child(6),
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table td:nth-child(6) { width: 64px !important; text-align: center !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table th:nth-child(7),
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper table.dce-acf-repeater-table td:nth-child(7) { width: 56px !important; }

    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper .fee-table-note,
    :is(#profile-template-wrapper, #university-template-wrapper) #stp-fee-table-wrapper .fee-table-note em {
        font-size: 11px !important;
        color: var(--color-text-muted) !important;
        line-height: 1.35 !important;
    }
}

/* ========================================
   8. EXAM (UER) TABLES + CHARTS + GALLERY
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-section {
    margin-bottom: var(--spacing-3xl) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-section.soso-uer-sources {
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin-top: 18px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-section.soso-uer-sources h5 {
    margin-top: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-chart-container {
    position: relative !important;
    height: 470px !important;
    width: 100% !important;
    margin: 0 0 25px 0 !important;
    background: var(--color-bg-white) !important;
    padding: 15px !important;
    border-radius: var(--border-radius-md) !important;
    border: 1px solid var(--color-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-bar {
    margin: 0 0 15px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-bar label {
    font-weight: var(--font-weight-bold) !important;
    color: var(--color-text-main) !important;
    min-width: 84px !important;
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-buttons {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding-bottom: 2px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-btn {
    padding: 6px 12px !important;
    border-radius: var(--border-radius-sm) !important;
    border: 1px solid var(--color-border) !important;
    font-size: 14px !important;
    background: var(--color-bg-white) !important;
    color: var(--color-text-main) !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-btn.is-active {
    background: #f0f7ff !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-select {
    padding: 6px 12px !important;
    border-radius: var(--border-radius-sm) !important;
    border: 1px solid var(--color-border) !important;
    font-size: 14px !important;
    background: var(--color-bg-white) !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: none !important;
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-bar {
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-bar label {
        flex: 0 0 auto !important;
        min-width: 0 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-buttons {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        width: auto !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-btn {
        width: auto !important;
        text-align: center !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-filter-select {
        display: none !important;
    }
}
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table {
    min-width: 600px !important;
}

/* Other Exam mini tables should not force page overflow on mobile */
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table.soso-uer-mini-table {
    min-width: 0 !important;
    table-layout: fixed !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table.soso-uer-mini-table th,
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table.soso-uer-mini-table td {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-weight: 500;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table thead th:first-child {
    left: 0 !important;
    z-index: 11 !important;
    text-align: left !important;
    border-right: 1px solid var(--color-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 5 !important;
    background: var(--color-bg-white) !important;
    font-weight: var(--font-weight-semi) !important;
    border-right: 1px solid var(--color-border) !important;
    border-bottom-color: var(--color-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table tbody tr:nth-child(odd) td:first-child {
    background: var(--color-bg-lighter) !important;
    border-right: 1px solid var(--color-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table tbody tr:nth-child(even) td:first-child {
    background: var(--color-bg-white) !important;
    border-right: 1px solid var(--color-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table tbody tr:hover td:first-child {
    background: #eef6ff !important;
    border-right: 1px solid var(--color-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table tr.group-header td {
    background: #e9f4f7 !important;
    color: var(--color-primary) !important;
    font-weight: var(--font-weight-bold) !important;
    text-align: left !important;
    padding: 8px 12px !important;
    text-transform: uppercase;
    font-size: 12px !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 9 !important;
    box-shadow: 6px 0 0 rgba(255,255,255,0.9) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table td.trend-cell {
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-other-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 24px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-other-grid {
    flex-direction: column !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-other-tabs {
    display: block !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-tabs {
    display: inline-flex !important;
    gap: 8px !important;
    margin: 0 0 12px 0 !important;
    padding: 4px !important;
    background: var(--color-bg-light) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 999px !important;
    flex-wrap: wrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-tab-btn {
    appearance: none !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--color-text-muted) !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    cursor: pointer !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-tab-btn.is-active {
    background: var(--color-primary-light) !important;
    color: var(--color-primary) !important;
    border: 1px solid var(--color-primary-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-tab-panels {
    display: block !important;
    transition: min-height 0.2s ease !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-tab-panel {
    width: 100% !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-sub-group {
    flex: 1 1 320px !important;
    min-width: 0 !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 18px !important;
    background: var(--color-bg-white) !important;
}

/* Other exam sub-groups use level-3 card titles (h3.soso-sp-card-title). */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-mini-chart {
    height: 335px !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
    min-width: 280px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-chart-container,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-mini-chart {
    max-width: 100% !important;
    overflow: hidden !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-chart-container canvas {
    display: block !important;
    max-width: 100% !important;
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-sub-group {
        max-width: 100% !important;
        overflow: hidden !important;
        padding: 14px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-chart-container {
        padding: 12px !important;
        height: 320px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-mini-chart {
        min-width: 0 !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Universal Gallery (centralized; see Profile-SourceGallery.php) */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 20px !important;
    margin: 25px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-item {
    background: #fff !important;
    border-radius: var(--border-radius-lg, 12px) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid rgba(0,0,0,0.04) !important;
}

@media (hover: hover) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-item:hover {
        transform: translateY(-4px) !important;
        box-shadow: 0 12px 30px rgba(0,0,0,0.12) !important;
    }
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-thumb-link {
    display: block !important;
    text-decoration: none !important;
    cursor: pointer !important;
    position: relative !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-thumb {
    position: relative !important;
    overflow: hidden !important;
    padding-top: 94% !important; /* shorter card thumb (avoid overly tall sources) */
    background-color: #f0f2f5 !important;
    width: 100% !important;
    height: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-thumb img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top !important;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    display: block !important;
}

@media (hover: hover) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-thumb:hover img {
        transform: scale(1.06) !important;
    }
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-count {
    position: absolute !important;
    bottom: 8px !important;
    right: 8px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    letter-spacing: 0.5px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-title {
    padding: 16px 14px !important;
    font-weight: 600 !important;
    color: var(--color-text-main) !important;
    text-align: center !important;
    background: #fff !important;
    flex-grow: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-link-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 12px 10px !important;
    background: var(--color-primary-light) !important;
    color: var(--color-primary) !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    line-height: 1 !important;
}

@media (hover: hover) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-link-btn:hover {
        background: var(--color-primary) !important;
        color: #fff !important;
    }
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-link-btn .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
}

/* Lightbox Styles */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    cursor: default;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox img {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    border-radius: 4px;
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    object-fit: contain;
    will-change: transform;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: grab;
    pointer-events: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-close {
    position: absolute;
    top: 25px;
    right: 25px;
    color: #fff;
    font-size: 36px;
    font-weight: 100;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 100002;
    line-height: 1;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.05);
    color: #fff;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 40px;
    z-index: 100002;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.6;
    font-family: monospace;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-nav:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.1);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-nav.prev { left: 25px; }
:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-nav.next { right: 25px; }

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-counter {
    position: absolute;
    top: 25px;
    left: 25px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 500;
    z-index: 100002;
    background: rgba(0,0,0,0.3);
    padding: 5px 12px;
    border-radius: 20px;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100002;
    background: rgba(40, 40, 40, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-btn {
    background: transparent !important;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: rgba(255,255,255,0.8);
    border-radius: 50%;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table {
        min-width: 0 !important;
        width: 100% !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table th,
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table td {
        white-space: nowrap !important;
        font-size: 12px !important;
        padding: 6px 8px !important;
        letter-spacing: -0.2px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table td:first-child,
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-uer-table th:first-child {
        white-space: normal !important;
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        word-wrap: break-word !important;
        line-height: 1.2 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-item {
        transform: none !important;
        transition: none !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-title {
        font-size: 11px !important;
        padding: 6px 4px !important;
        line-height: 1.25 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-link-btn {
        padding: 8px 2px !important;
        font-size: 10px !important;
        min-height: 32px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-link-btn .dashicons {
        font-size: 12px !important;
        width: 12px !important;
        height: 12px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 28px;
        background: rgba(0,0,0,0.3);
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-nav.prev { left: 10px; }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-nav.next { right: 10px; }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 28px;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-controls {
        bottom: 20px;
        padding: 6px 15px;
        gap: 10px;
    }
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-uer-gallery-lightbox-btn { width: 32px; height: 32px; font-size: 18px; }
}

/* ========================================
   9. PLACEMENT SUMMARY + PBC
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table-container {
    margin-bottom: var(--spacing-3xl) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table .sticky-col {
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
    background-color: var(--color-bg-white) !important;
    border-left: 1px solid var(--color-border) !important;
    border-right: 1px solid var(--color-border) !important;
    border-bottom-color: var(--color-border) !important;
    box-shadow: inset -1px 0 0 var(--color-border), inset 1px 0 0 var(--color-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table th.sticky-col {
    z-index: 3 !important;
    background-color: var(--color-primary) !important;
    color: #fff !important;
    border-right: 1px solid rgba(255,255,255,0.25) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table tr:nth-child(even) td.sticky-col {
    background-color: var(--color-bg-white) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table tr:nth-child(odd) td.sticky-col {
    background-color: var(--color-bg-lighter) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table tr:hover td.sticky-col {
    background-color: #eef6ff !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table .progress-cell {
    position: relative !important;
    z-index: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    height: 100% !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table .progress-cell::before {
    content: "" !important;
    position: absolute !important;
    top: 4px !important;
    bottom: 4px !important;
    left: 4px !important;
    width: calc(var(--progress-width, 0) * 1%) !important;
    max-width: calc(100% - 8px) !important;
    background-color: rgba(70, 130, 180, 0.15) !important;
    border-radius: 4px !important;
    z-index: -1 !important;
    transition: width 0.5s ease-out !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table .progress-cell span {
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    padding: 10px 12px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table .rate-increase {
    color: #2e8b57 !important;
    font-weight: 800 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table .rate-decrease {
    color: #cd5c5c !important;
    font-weight: 800 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table .rate-no-change {
    color: var(--color-text-muted) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table tr.total-row td {
    background-color: var(--color-primary-light) !important;
    font-weight: 800 !important;
    color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table tr.total-row td.sticky-col {
    background-color: var(--color-primary-light) !important;
}

/* Shared flex wrapper used by multiple accordion headers */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-flex-textwrap {
    display: flex !important;
    align-items: flex-start !important;
    flex: 1 !important;
    min-width: 0 !important;
}

/* University Tier Analysis: first column emphasis (was inline font-weight) */
:is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table td.tier-name {
    font-weight: var(--font-weight-semi) !important;
}

/* Placement By Country (cards) */
:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-wrapper {
    margin-bottom: var(--spacing-3xl) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--spacing-xl) !important;
    justify-content: initial !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-view--bar .soso-pbc-card {
    grid-column: 1 / -1 !important;
}

@media (max-width: 960px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-grid { grid-template-columns: 1fr !important; }
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-card {
    background: var(--color-bg-white) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--border-radius-md) !important;
    padding: var(--spacing-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    max-width: none !important;
    min-width: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-card h3 {
    margin: 0 0 var(--spacing-md) 0 !important;
    text-align: center !important;
    font-size: 14px !important;
    color: var(--color-text-main) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-chart-container {
    position: relative !important;
    height: 250px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    overflow: hidden !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-canvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table th,
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table td {
    font-size: 12px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-table-wrap {
    overflow-x: auto;
    margin-top: 30px;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table {
    width: 100%;
    border-collapse: collapse;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table th {
    text-align: center;
    padding: 8px;
    white-space: nowrap;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table th.soso-pbc-col--diff {
    min-width: 60px;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table th.soso-pbc-col--pct {
    min-width: 50px;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table th:first-child {
    text-align: left;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table td {
    text-align: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table td:first-child {
    text-align: left;
    font-weight: var(--font-weight-semi);
    white-space: normal;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    border-radius: 50%;
    background-color: var(--soso-pbc-dot-color, #999);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-muted {
    color: #999;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-diff--up {
    color: #28a745;
    font-weight: var(--font-weight-semi);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-diff--down {
    color: #dc3545;
    font-weight: var(--font-weight-semi);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-pbc-diff--flat {
    color: #6b7280;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-diff--up {
    color: #10b981;
    font-weight: var(--font-weight-semi);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-diff--down {
    color: #ef4444;
    font-weight: var(--font-weight-semi);
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-diff--flat {
    color: #6b7280;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table tr.soso-pbc-total-row td {
    background-color: #f9f9f9;
    font-weight: var(--font-weight-bold);
}

@media (max-width: 960px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table th,
    :is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table td {
        font-size: 12px !important;
        padding: 6px 8px !important;
        white-space: nowrap !important;
        font-weight: 500;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table th.sticky-col,
    :is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table td.sticky-col {
        max-width: 88px !important;
        min-width: 50px !important;
        white-space: normal !important;
        line-height: 1.15 !important;
        padding-right: 6px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table .progress-cell span {
        padding: 6px 6px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table th,
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-pbc-table td {
        font-size: 12px !important;
        padding: 6px 6px !important;
        font-weight: 500;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .placement-summary-table td.tier-name {
        font-weight: var(--font-weight-semi) !important;
    }
}

/* ========================================
   10. STUDENT DISTRIBUTION (SD)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-student-dist-wrapper {
    margin: 0 0 24px 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-controls {
    margin-bottom: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-controls__label {
    font-weight: 800 !important;
    margin-right: 5px !important;
    font-size: 14px !important;
    color: #333 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-chart {
    position: relative !important;
    height: 350px !important;
    width: 100% !important;
    margin-bottom: 30px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table thead tr:nth-child(2) th {
    font-weight: 500 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table tbody td.soso-sp-sd-sticky-col {
    text-align: center !important;
    font-weight: 500 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table thead th.soso-sp-sd-grade-col,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table thead th.soso-sp-sd-col-change {
    vertical-align: middle !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-total-row td,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-total-row td.soso-sp-sd-sticky-col {
    background-color: #f9f9f9 !important;
    font-weight: 800 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-remarks {
    font-size: 12px !important;
    color: #999 !important;
    margin-top: 8px !important;
    font-style: italic !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 12px !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 8px !important;
    background: #fff !important;
    cursor: pointer !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    transition: all 0.2s ease !important;
    font-size: 14px !important;
    min-width: 80px !important;
    text-align: center !important;
    color: var(--color-text-main) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-btn input {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-btn.active {
    background: #f0f7ff !important;
    color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-col-change.soso-sp-sd-change-up {
    color: #2E8B57 !important;
    font-weight: 700 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-col-change.soso-sp-sd-change-down {
    color: #CD5C5C !important;
    font-weight: 700 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-col-change.soso-sp-sd-change-neutral {
    color: #999 !important;
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-table-responsive {
        overflow-x: auto !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px !important;
        position: relative !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-table-responsive.soso-sp-single-year-mode {
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: visible !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table {
        min-width: max-content !important;
        width: max-content !important;
        table-layout: auto !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table th,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table td {
        padding: 6px 8px !important;
        white-space: nowrap !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-table-responsive.soso-sp-single-year-mode .soso-sp-sd-unified-table {
        min-width: 0 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table .soso-sp-sd-sticky-col {
        position: sticky !important;
        left: 0 !important;
        z-index: 20 !important;
        background-color: var(--color-bg-white) !important;
        box-shadow: inset -1px 0 0 var(--color-border-light) !important;
        border-right: 1px solid var(--color-border-light) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table thead .soso-sp-sd-sticky-col,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table thead th.soso-sp-sd-sticky-col {
        z-index: 25 !important;
        background-color: var(--color-primary) !important;
        color: #fff !important;
        box-shadow: 2px 0 4px rgba(0,0,0,0.1), inset -1px 0 0 rgba(255,255,255,0.2) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table tbody tr:nth-child(even) td.soso-sp-sd-sticky-col {
        background-color: var(--color-bg-white) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table tbody tr:nth-child(odd) td.soso-sp-sd-sticky-col {
        background-color: var(--color-bg-lighter) !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table tbody tr:hover td.soso-sp-sd-sticky-col {
        background: #eef6ff !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table th.soso-sp-sd-sticky-col,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-sd-unified-table td.soso-sp-sd-sticky-col {
        min-width: 0 !important;
        width: auto !important;
    }
}

:is(#profile-template-wrapper, #university-template-wrapper) details.soso-sp-sources {
    margin-top: 18px !important;
}

/* ========================================
   11. SSPA PLACEMENT TABLES (Restored & Standardized)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table-container {
    margin: 20px 0 !important;
    position: relative !important;
}


:is(#profile-template-wrapper, #university-template-wrapper) .sspa-th-short {
    display: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-band-label-main,
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-band-label-sub {
    display: inline !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-band-label-sub {
    margin-left: 4px !important;
}

/* 11.1 SSPA Controls (Search & Filters) */
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-controls {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 15px !important;
    width: 100% !important;
    margin-bottom: 25px !important;
    flex-wrap: nowrap !important; /* 强制禁止主容器换行 */
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-search-box {
    position: relative !important;
    min-width: 180px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-search-box input {
    display: block !important;
    width: 100% !important;
    height: 40px !important;
    padding: 0 40px 0 15px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    font-size: 14px !important;
    margin: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-search-icon {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #64748b !important;
    width: 18px !important;
    height: 18px !important;
    z-index: 5 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-filter-box {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex: 1 !important;
    flex-wrap: nowrap !important; /* 强制禁止筛选框内换行，解决垂直堆叠 */
    overflow: visible !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-filter-select {
    height: 40px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 0 25px 0 10px !important;
    min-width: 80px !important;
    max-width: 200px !important; /* 限制最大宽度 */
    width: auto !important;
    background: #fff !important;
    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 500;
    display: inline-block !important;
    flex-shrink: 1 !important;
    appearance: auto !important;
}

/* 11.2 Table Common Styles */
:is(#profile-template-wrapper, #university-template-wrapper) .table-scroll-container {
    width: 100% !important;
    max-height: 80vh !important;
    overflow: auto !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    position: relative !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: #fff !important;
    margin: 0 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table thead th {
    background: steelblue !important;
    color: white !important;
    font-weight: 800 !important;
    text-align: center !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table .sticky-first-column {
    position: sticky !important;
    left: 0 !important;
    z-index: 15 !important;
    border-right: 1px solid var(--color-border) !important;
    border-bottom-color: var(--color-border) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table thead th.sticky-first-column {
    z-index: 21 !important;
    background: steelblue !important;
    border-right: 1px solid rgba(255,255,255,0.25) !important;
}

/* Zebra & Hover Background Synchronization */
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table tr:nth-child(even) td, 
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table tr:nth-child(even) td.sticky-first-column { background-color: #f8fafc !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table tr:nth-child(odd) td, 
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table tr:nth-child(odd) td.sticky-first-column { background-color: #ffffff !important; }
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table tr:hover td, 
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-table tr:hover td.sticky-first-column { background-color: #f1f5f9 !important; }

/* 11.3 Row Special States */
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-row--group-summary td,
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-row--group-summary td.sticky-first-column {
    background-color: #e6f3ff !important;
    font-weight: 800 !important;
    color: steelblue !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-row--total td,
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-row--total td.sticky-first-column {
    background-color: #ffffff !important;
    border-top: 2px solid steelblue !important;
    font-weight: 800 !important;
    color: #000 !important;
}

/* 11.4 School Info Cell */
:is(#profile-template-wrapper, #university-template-wrapper) .school-main-name { 
    font-weight: 600 !important; 
    display: block !important; 
    line-height: 1.3 !important; 
    text-decoration: none !important;
    color: var(--color-primary) !important;
}
:is(#profile-template-wrapper, #university-template-wrapper) .school-main-name:hover { text-decoration: underline !important; }

:is(#profile-template-wrapper, #university-template-wrapper) .school-short-name { 
    font-size: 0.65rem !important; 
    font-weight: 400 !important; 
    color: #64748b !important; 
    margin-top: 2px !important; 
    line-height: 1.2 !important; 
    display: block !important; 
}

/* 11.5 Sort & Helper */
:is(#profile-template-wrapper, #university-template-wrapper) .sort-arrow { 
    position: absolute; 
    right: 6px; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 0; 
    height: 0; 
    margin-left: 0; 
    vertical-align: middle; 
    border-left: 4px solid transparent; 
    border-right: 4px solid transparent; 
    border-bottom: 4px solid #94a3b8; 
    opacity: 0.3; 
}
:is(#profile-template-wrapper, #university-template-wrapper) th.sortable { 
    position: relative !important; 
    cursor: pointer; 
    user-select: none; 
    -webkit-user-select: none; 
}
:is(#profile-template-wrapper, #university-template-wrapper) th.sortable:hover { background: #3a6d96 !important; }
:is(#profile-template-wrapper, #university-template-wrapper) th.asc .sort-arrow { opacity: 1; border-bottom: 4px solid #fff; }
:is(#profile-template-wrapper, #university-template-wrapper) th.desc .sort-arrow { opacity: 1; border-bottom: none; border-top: 4px solid #fff; transform: translateY(-50%) rotate(0deg); }

/* 11.6 SSPA Analysis Charts & Tabs */
:is(#profile-template-wrapper, #university-template-wrapper) .sspa-analysis-visuals {
    margin-top: 30px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 15px !important;
    padding: 20px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-visual-tabs {
    display: flex !important;
    gap: 10px !important;
    border-bottom: 2px solid #f1f5f9 !important;
    margin-bottom: 25px !important;
    padding-bottom: 10px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-visual-tab-btn {
    padding: 8px 20px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    background: #f8fafc !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-visual-tab-btn.active {
    background: steelblue !important;
    color: #fff !important;
    border-color: steelblue !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-visual-content {
    display: none !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-visual-content.active {
    display: block !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-chart-section {
    margin-bottom: 40px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-chart-section:last-child {
    margin-bottom: 10px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-chart-year-title {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: steelblue !important;
    margin-bottom: 15px !important;
    padding-left: 10px !important;
    border-left: 4px solid steelblue !important;
    line-height: 1 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-chart-container {
    width: 100% !important;
    height: 280px !important; /* 固定高度防止留白过多 */
    position: relative !important;
    margin: 0 auto !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-pie-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-pie-item {
    text-align: center !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .sspa-pie-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    margin-top: 10px !important;
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-pie-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-controls { flex-direction: column !important; align-items: stretch !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-search-box { width: 100% !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-filter-box { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-filter-select { width: 100% !important; min-width: 0 !important; }
    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-filter-select:last-child:nth-child(odd) { grid-column: span 2; }

    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-th-full {
        display: none !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-th-short {
        display: inline !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-table thead th,
    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-table td {
        padding: 6px 4px !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-summary-table th.sticky-first-column,
    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-summary-table td.sticky-first-column {
        width: 56px !important;
        min-width: 56px !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-band-label-main,
    :is(#profile-template-wrapper, #university-template-wrapper) .sspa-band-label-sub {
        display: block !important;
        margin-left: 0 !important;
        white-space: nowrap !important;
    }
}

/* ========================================
   12. CURRICULUM (TABLES + SUBJECT MATRIX)
   ======================================== */

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-curriculum-table-wrap {
    margin: 10px 0 var(--spacing-xl) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-curriculum-table th,
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-curriculum-table td {
    white-space: nowrap !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-curriculum-table th:nth-child(2),
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-curriculum-table td:nth-child(2),
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-curriculum-table th:nth-child(3),
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-curriculum-table td:nth-child(3) {
    text-align: center !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-curriculum-table th:nth-child(4),
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-curriculum-table td:nth-child(4) {
    white-space: normal !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-subject-filters {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    align-items: flex-end !important;
    margin: 8px 0 16px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-subject-filter {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    font-size: 13px !important;
    color: var(--color-text-muted) !important;
    min-width: 150px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-subject-filter--search {
    flex: 1 !important;
    min-width: 220px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-subject-filter select,
:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-subject-filter input {
    padding: 8px 10px !important;
    border: 1px solid var(--color-border-light) !important;
    border-radius: var(--border-radius-sm) !important;
    background: var(--color-bg-white) !important;
    color: var(--color-text-main) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    width: 160px !important;
    max-width: 160px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-subject-filter--search input {
    width: 100% !important;
    max-width: none !important;
    padding-left: 32px !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: 10px center !important;
    background-size: 14px 14px !important;
}

@media (min-width: 1024px) {
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-subject-filters {
        flex-wrap: nowrap !important;
    }
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix {
    width: 100% !important;
    border-collapse: collapse !important;
    border: 1px solid var(--color-border-light) !important;
    background: var(--color-bg-white) !important;
    table-layout: fixed !important;
    min-width: 780px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix th,
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix td {
    padding: var(--spacing-md) !important;
    border: 0.5px solid var(--color-border-light) !important;
    text-align: center !important;
    vertical-align: middle !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix tbody td:nth-child(2) {
    text-align: left !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
    background: var(--color-primary) !important;
    color: #fff !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix thead th:first-child {
    z-index: 3 !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix th:first-child,
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix td:first-child {
    text-align: left !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix th:nth-child(1),
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix td:nth-child(1) {
    width: 140px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix th:nth-child(2),
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix td:nth-child(2) {
    width: 220px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix th:nth-child(n+3),
:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix td:nth-child(n+3) {
    width: 70px !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix tbody tr:nth-child(even) td {
    background: var(--color-bg-white) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix tbody tr:nth-child(odd) td {
    background: var(--color-bg-lighter) !important;
}

:is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix tbody tr:hover td {
    background: #eef6ff !important;
}

@media (max-width: 768px) {
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix {
        min-width: 640px !important;
        table-layout: fixed !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix th:first-child,
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix td:first-child {
        position: sticky !important;
        left: 0 !important;
        z-index: 1 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix thead th:first-child {
        z-index: 3 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix th:nth-child(1),
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix td:nth-child(1),
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix th:nth-child(2),
    :is(#profile-template-wrapper, #university-template-wrapper) table.soso-sp-subject-matrix td:nth-child(2) {
        width: 110px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* Temporary fix: make decorative dashicons non-interactive so they don't
   block anchor/button taps on mobile Safari. Also ensure debug overlay
   buttons remain clickable. */
.soso-sp-apply-link-btn .dashicons,
.soso-sp-btn .dashicons,
.soso-sp-toc .dashicons,
.soso-sp-share .dashicons {
    pointer-events: none !important;
}

a.soso-sp-apply-link-btn {
    position: relative !important;
    z-index: 1 !important;
}

#soso-debug-toggle,
#soso-inspect-toggle {
    pointer-events: auto !important;
    z-index: 2147483647 !important;
}

/* End temporary fixes */

/* ========================================
   MOBILE PHONES ( < 640px )
   ======================================== */
@media (max-width: 640px) {
    /* Prevent accidental page-level horizontal scroll on phones (theme containers may already be full-width) */
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* Header actions: max 3 action buttons per row (actions auto-stretch to fill width). */
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions {
        display: grid !important;
        grid-template-columns: 32px 1fr 32px !important;
        align-items: start !important;
        gap: 8px !important;
        width: 100% !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions .soso-sp-header-nav-btn {
        width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
        justify-self: center !important;
        align-self: start !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions__actions {
        --soso-sp-header-actions-gap: 6px;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: var(--soso-sp-header-actions-gap) !important;
        align-items: stretch !important;
        min-width: 0 !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions__actions > a,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions__actions > button,
    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions__actions > span {
        flex: 1 1 calc((100% - 2 * var(--soso-sp-header-actions-gap)) / 3) !important;
        min-width: calc((100% - 2 * var(--soso-sp-header-actions-gap)) / 3) !important;
        padding: 8px 10px !important;
        border-radius: 10px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    :is(#profile-template-wrapper, #university-template-wrapper) .soso-sp-header-actions .dashicons {
        font-size: 14px !important;
        width: 14px !important;
        height: 14px !important;
        line-height: 14px !important;
    }
}
