/* Base Styles */
:root {
    --primary: #6868ac;
    --primary-light: rgba(107, 105, 177, 0.1);
    --secondary: #FAAB1D;
    --secondary-light: rgba(250, 171, 29, 0.1);
    --text-dark: #333;
    --text-light: #666;
    --white: #fff;
    --gray-100: #f7f7f7;
    --gray-200: #eee;
    --gray-300: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
    --topic-accent: #5B3F6D;
    --app-font-scale: 1;
    --app-focus-ring: rgba(104, 104, 172, 0.35);
    --a11y-panel-surface: rgba(255, 255, 255, 0.92);
    --a11y-panel-border: rgba(104, 104, 172, 0.18);
}

/* ปิดเลือกทั้งหน้า */
html,
body {
    -webkit-user-select: none;
    /* Safari/Chrome/iOS */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* เก่า/IE */
    user-select: none;
    -webkit-touch-callout: none;
    /* กันเมนูคัดลอกบน iOS Safari */
}

/* อนุญาตเฉพาะช่องกรอกให้เลือก/คัดลอกได้ตามปกติ */
input,
textarea,
[contenteditable="true"],
.selectable {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

/* กันลากรูปภาพ */
img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
    /* ถ้าไม่ต้องการให้คลิก/ลากภาพเลย */
}

@font-face {
    font-family: 'Kanit';
    src: url('../fonts/Kanit-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Kanit';
    src: url('../fonts/Kanit-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'sa-ard';
    src: url('../fonts/sa-ard.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

.sa-ard4 {
    font-family: 'sa-ard', sans-serif !important;
    font-weight: 400 ! important;
}

.kanit4 {
    font-family: 'Kanit', sans-serif !important;
    font-weight: 400 !important;
}

.kanit6 {
    font-family: 'Kanit', sans-serif !important;
    font-weight: 600 !important;
}

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

body {
    user-select: none;
    /* ป้องกันการ select ข้อความ */
    outline: none;
    /* ป้องกัน border เวลา focus */
    overflow-x: hidden;
    font-family: 'Kanit', sans-serif;
    font-size: calc(16px * var(--app-font-scale));
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #FAF4E7;

}

body.a11y-font-large {
    --app-font-scale: 1.08;
}

body.a11y-font-xlarge {
    --app-font-scale: 1.16;
}

body.a11y-focus-highlight :focus-visible {
    outline: 3px solid var(--app-focus-ring);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
}

body.a11y-reduce-motion *,
body.a11y-reduce-motion *::before,
body.a11y-reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

body.a11y-high-contrast {
    --primary: #163c73;
    --primary-light: rgba(22, 60, 115, 0.16);
    --secondary: #b05f00;
    --secondary-light: rgba(176, 95, 0, 0.12);
    --text-dark: #121212;
    --text-light: #2e2e2e;
    --gray-100: #f8f5e9;
    --gray-200: #e7e1c9;
    --gray-300: #9b8b4b;
    --shadow: 0 6px 12px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 14px 28px rgba(0, 0, 0, 0.16), 0 4px 10px rgba(0, 0, 0, 0.1);
    --topic-accent: #102f57;
    --app-focus-ring: rgba(255, 153, 0, 0.92);
    --a11y-panel-surface: rgba(255, 251, 238, 0.97);
    --a11y-panel-border: rgba(16, 47, 87, 0.24);
    background-color: #fffef5;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.questionnaire-panel {
    width: 100%;
    min-height: 80vh;
    height: auto;
    border: none;
}

.questionnaire-panel--message {
    height: auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1.25rem 0;
}

.questionnaire-status-card {
    width: min(640px, 100%);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(250, 171, 29, 0.35);
    background: linear-gradient(160deg, #fff7e8 0%, #ffffff 62%);
    box-shadow: 0 12px 30px rgba(104, 104, 172, 0.15);
    text-align: center;
}

.questionnaire-status-card--error {
    border-color: rgba(220, 53, 69, 0.25);
    background: linear-gradient(160deg, #fff5f6 0%, #ffffff 60%);
}

.questionnaire-status-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 999px;
    background: #28A745;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 600;
}

.questionnaire-status-title {
    margin: 0 0 0.5rem;
    color: #5B3F6D;
    font-size: 1.45rem;
    font-weight: 600;
}

.questionnaire-status-message {
    margin: 0;
    color: #4e4e67;
    font-size: 1rem;
    line-height: 1.6;
}

.questionnaire-status-no {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    background: rgba(104, 104, 172, 0.12);
    color: #6868ac;
    font-weight: 600;
}

.no-scroll {
    overflow: hidden;
    height: 100%;
    /* Prevent scrolling */
}

/* Layout */
.container {
    position: relative;
    max-width: 80vw;
    margin: 0 auto;
    padding-top: 1rem;
    padding-bottom: 4rem;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-top: -45vh;
}

/* Select Container Styles */
.select-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.select-container-group {
    border-radius: 10px;
    border-width: 1px;
    border-style: solid;
    border-color: #ddd;
    padding: 0.5rem;
    margin-bottom: 10px;
    background-color: #FEFDFA;
}

.entry-panels {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.entry-panel {
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(91, 63, 109, 0.08);
    overflow: hidden;
}

.entry-panel-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: none;
    background: linear-gradient(135deg, rgba(104, 104, 172, 0.12), rgba(250, 171, 29, 0.14));
    color: #5B3F6D;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.entry-panel-toggle:hover {
    background: linear-gradient(135deg, rgba(104, 104, 172, 0.18), rgba(250, 171, 29, 0.18));
}

.entry-panel-icon {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.entry-panel.is-open .entry-panel-icon {
    transform: rotate(180deg);
}

.entry-panel-body {
    box-sizing: border-box;
    padding: 1rem 1.1rem 1.1rem;
    border-top: 1px solid rgba(104, 104, 172, 0.12);
}

.entry-panel-collapse:not(.show) {
    display: none;
}

.entry-panel-collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

.entry-panel-body[hidden] {
    display: none;
}

#demo-selection .divider {
    display: none;
}

.menu-container {
    color: var(--primary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.custom-select {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    background-color: var(--white);
    box-shadow: var(--shadow);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236868ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.custom-select:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.custom-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.select-container label {
    font-weight: 500;
    color: var(--primary);
    font-size: 0.9rem;
}

.trial-mode-hint {
    margin: -0.15rem 0 0.75rem;
    color: #6b6586;
    font-size: 0.88rem;
    line-height: 1.4;
}

.trial-mode-status {
    min-height: 1.35rem;
    margin: 0;
    color: #5B3F6D;
    font-size: 0.92rem;
    line-height: 1.45;
}

.trial-mode-status--active {
    color: #216e39;
}

.trial-mode-status--pending {
    color: #7d5b12;
}

.trial-mode-status--inactive {
    color: #6b6586;
}

.term-selection {
    margin-top: 0.85rem;
    padding: 0.95rem 1.05rem;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(91, 63, 109, 0.08);
}

.term-selection[hidden] {
    display: none;
}

.term-selection label {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.term-selection .custom-select {
    width: 100%;
}

.term-selection-note {
    margin: 0.55rem 0 0;
    color: #6b6586;
    font-size: 0.86rem;
    line-height: 1.4;
}

.term-selection-note.is-future {
    color: #7d5b12;
}

.result-term-badge {
    display: block;
    margin-top: 0.45rem;
    color: #5d5f84;
    font-size: 0.88rem;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .entry-panel-icon,
    .entry-panel-collapsing {
        transition: none;
    }
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    /* Reduced margin to accommodate bottom SVG */
}

.header h1 {
    font-size: 2.5rem;
    color: #5B3F6D;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.content-wrapper {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    margin-top: -5rem;
}



/* Parallax Section */
.parallax-section {
    height: 60vh;
    /* Increased height to accommodate the SVG */
    position: relative;
    /* overflow: hidden; */
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-top: env(safe-area-inset-top);
    background:
        /* ชั้นบน: gradient fade */
        linear-gradient(to bottom,
            rgba(107, 105, 177, 0.4) 0%,
            #FAF4E7 70%,
            #FAF4E7 100%),
        /* ชั้นล่าง: svg pattern */
        linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
        url("../images/netbackground.svg");

    background-repeat: repeat;
    /* tile ให้ต่อเนื่อง */
    background-position: top center;
    /* ยึดบนตรงกลาง */
    background-size: auto;
    /* ใช้ขนาดจริงของ SVG */
    z-index: -1;
    transform: translateZ(0);
}

.btn {
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    background-color: #6868ac;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
    border-width: initial;
    border-style: none;
    border-color: initial;
    border-image: initial;
}

.qa-field {
    width: 80%;
    padding: 7px;
    border-radius: 5px;
    border-color: #6868ac !important;
    border: solid 2px;
    margin-bottom: 1em;
    font-family: inherit;
}

.qa-field:focus {
    box-shadow: 0 0 10px 10px rgba(250, 172, 30, 0.3);
}

.tab-qa {
    margin-bottom: 1em;
}

/* Top SVG Styles */
.top-svg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    align-items: center;
    z-index: 0;
}

.top-svg {
    max-width: 40%;
    height: auto;
    transform: translateZ(0);
}

/* Bottom SVG Styles */
.bottom-svg-container {
    position: relative;
    width: 100%;
    display: grid;
    place-items: center;
    margin-bottom: 0;
    top: -5rem;
    z-index: 0;
}

.bottom-svg {
    max-width: 40%;
    height: auto;
}

.parallax-element {
    user-select: none;
    /* ป้องกันการ select ข้อความ */
    outline: none;
    /* ป้องกัน border เวลา focus */
    will-change: transform;
}

.parallax-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6rem;
    background: linear-gradient(to top, transparent, transparent);
    z-index: 5;
}

/* Vertical Menu */
.vertical-menu {
    width: 100%;
    display: flex;
    flex-direction: column;
    /*gap: 1rem;*/
}

/* @media (min-width: 768px) {
    .vertical-menu {
        width: 33.333%;
    }
} */

strong u {
    color: #222;
    text-decoration: none;
    text-decoration-color: #D9534F;
}

.warning-text {
    color: #D9534F;
    font-weight: 400;
    font-size: 0.7rem;
    margin-top: 0.5rem;
    margin-bottom: 2em;
}

.instructions {
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.2rem;
    color: var(--text-light);
}

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    background-color: var(--white);
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: inherit;
    text-decoration: none;
}

.skill-insights-gated[hidden] {
    display: none !important;
}

.menu-item:hover {
    transform: scale(1.03);
    background-color: #f0f0ff;
    box-shadow: var(--shadow-lg);
}


.menu-item.awaiting-selection.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.menu-item:active {
    transform: scale(0.98);
}
.menu {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    background-color: var(--white);
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.menu:hover {
    transform: scale(1.03);
    background-color: #f0f0ff;
    box-shadow: var(--shadow-lg);
}


.menu.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.menu:active {
    transform: scale(0.98);
}

.icon-wrapper {
    padding: 0.75rem;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-text h3 {
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.menu-text p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.menu-item:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(104, 104, 172, 0.18), var(--shadow-lg);
}

.menu-item.qq-submitted .menu-text {
    width: 100%;
}

.menu-item.qq-submitted .qq-status-title {
    margin-bottom: 0.2rem;
    color: #5B3F6D;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

.menu-item.qq-submitted .qq-status-caption {
    margin-bottom: 0.4rem;
    color: #666;
    font-size: 0.8rem;
    line-height: 1.2;
}

.menu-item.qq-submitted .qq-status-code {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(220, 53, 69, 0.35);
    background: #fff;
    color: #DC3545;
    font-weight: 700;
    font-size: 1.65rem;
    line-height: 1;
    letter-spacing: 0.08em;
}

/* Image Display Area */
.image-display {
    align-self: flex-start;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-300);
    padding: 30px;
}

@media (min-width: 769px) {
    .image-display.fade-in-delay {
        position: sticky;
        top: calc(env(safe-area-inset-top, 0px) + 1rem);
        z-index: 6;
    }
}

/* @media (min-width: 768px) {
    .image-display {
        width: 66.666%;
    }
} */

.image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 62.5%;
    /* 8:5 aspect ratio */
    overflow: hidden;
    /* Added inner border */
    /* border: 2px solid var(--secondary); */
    border-radius: var(--radius);
    /* Added box shadow for depth */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.image-item {
    user-select: none;
    /* ป้องกันการ select ข้อความ */
    outline: none;
    /* ป้องกัน border เวลา focus */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.image-item.active {
    opacity: 1;
    visibility: visible;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    /* Added border inside the image */
    border: 4px solid white;
    box-sizing: border-box;
}

.image-item:hover img {
    transform: scale(1.05);
}

/* Added decorative corner accents */
.image-container::before,
.image-container::after {
    /* content: ''; */
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--primary);
    z-index: 10;
}

.image-container::before {
    top: 0;
    left: 0;
    border-top: 4px solid var(--primary);
    border-left: 4px solid var(--primary);
    border-top-left-radius: 4px;
}

.image-container::after {
    bottom: 0;
    right: 0;
    border-bottom: 4px solid var(--primary);
    border-right: 4px solid var(--primary);
    border-bottom-right-radius: 4px;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    /* Added border top for the overlay */
    /* border-top: 2px solid rgba(250, 171, 29, 0.5); */
}

.cmucolor {
    color: #6868ac;
}

.mobile-ai-disclaimer {
    display: none;
    color: #DC3545;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-size: 0.85rem;
}

.blackcolor {
    color: black;
}

.color-overlay {
    opacity: 30%;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background-image: linear-gradient(147deg, #FAAB1D 0%, #6868ac 74%);
    /* Added border top for the overlay */
    /* border-top: 2px solid rgba(250, 171, 29, 0.5); */
}

.image-overlay h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.image-overlay p {
    font-size: 1rem;
    opacity: 0.9;
}

.image-caption {
    padding: 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
    /* Added decorative border */
    border-top: 1px dashed var(--primary);
    margin-top: 8px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    display: none;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    overflow: auto;
    margin: 1rem;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Custom Scrollbar Styles */
.modal-container::-webkit-scrollbar {
    width: 12px;
    /* Width of the scrollbar */
}

.modal-container::-webkit-scrollbar-track {
    background: var(--gray-200);
    /* Track color */
    border-radius: 8px;
}

.modal-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    /* Thumb color */
    border-radius: 8px;
    border: 3px solid var(--gray-200);
    /* Adds padding around the thumb */
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
    /* Thumb hover color */
}

.modal.active .modal-container {
    opacity: 1;
    transform: scale(1);
}

.accessibility-modal-container {
    max-width: min(880px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    border: 1px solid var(--a11y-panel-border);
    background: linear-gradient(180deg, #fffdfa 0%, #ffffff 100%);
}

.accessibility-modal-header {
    align-items: flex-start;
}

.accessibility-modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.accessibility-modal-eyebrow {
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.accessibility-modal-header h2 {
    line-height: 1.15;
}

.accessibility-modal-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.accessibility-modal-intro,
.accessibility-modal-status,
.accessibility-modal-note {
    color: #5f5f75;
}

.accessibility-modal-status {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(104, 104, 172, 0.14);
    background: rgba(104, 104, 172, 0.06);
}

.accessibility-settings-card {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid var(--a11y-panel-border);
    background: var(--a11y-panel-surface);
    box-shadow: 0 10px 24px rgba(91, 63, 109, 0.08);
}

.accessibility-settings-header {
    margin-bottom: 0.9rem;
}

.accessibility-settings-header h3 {
    color: #5B3F6D;
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.accessibility-settings-header p {
    color: #5f5f75;
    font-size: 0.92rem;
}

.accessibility-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.a11y-toggle-card,
.a11y-select-card {
    min-height: 100%;
    border-radius: 14px;
    border: 1px solid rgba(104, 104, 172, 0.14);
    background: rgba(255, 255, 255, 0.92);
    padding: 0.95rem 1rem;
}

.a11y-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
}

.a11y-toggle-copy,
.a11y-select-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.a11y-toggle-title {
    color: #3f3150;
    font-weight: 600;
}

.a11y-toggle-description {
    color: #6a6780;
    font-size: 0.9rem;
    line-height: 1.45;
}

.a11y-switch {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.a11y-switch input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.a11y-switch-track {
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: #d6d6e7;
    position: relative;
    transition: background-color 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.a11y-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease;
}

.a11y-switch input:checked + .a11y-switch-track {
    background: linear-gradient(135deg, #6868ac 0%, #8d76c0 100%);
}

.a11y-switch input:checked + .a11y-switch-track::after {
    transform: translateX(22px);
}

.a11y-switch input:focus-visible + .a11y-switch-track {
    outline: 3px solid var(--app-focus-ring);
    outline-offset: 3px;
}

.a11y-select-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.a11y-select-input {
    width: 100%;
}

.accessibility-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.2rem;
}

.accessibility-reset-button {
    min-height: 44px;
}

.chart-accessibility-panel {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(104, 104, 172, 0.16);
    background: rgba(250, 244, 231, 0.7);
    box-shadow: 0 8px 18px rgba(91, 63, 109, 0.08);
}

.chart-accessibility-panel.is-visible {
    display: block;
}

.chart-accessibility-panel h3 {
    margin-bottom: 0.25rem;
    color: #5B3F6D;
    font-size: 1.05rem;
}

.chart-accessibility-panel p {
    color: #5f5f75;
}

.chart-accessibility-note {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #6a6780;
}

.chart-accessibility-summary {
    margin: 0.75rem 0 0;
    padding-left: 1.1rem;
    color: #3c3650;
}

.chart-accessibility-summary li + li {
    margin-top: 0.35rem;
}

.chart-accessibility-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.9rem;
    border-radius: 12px;
}

.chart-accessibility-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
    background: #fff;
}

.chart-accessibility-table th,
.chart-accessibility-table td {
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(104, 104, 172, 0.14);
    text-align: left;
    vertical-align: top;
}

.chart-accessibility-table th {
    background: rgba(104, 104, 172, 0.08);
    color: #4b3b5d;
}

body.a11y-high-contrast .select-container-group,
body.a11y-high-contrast .entry-panel,
body.a11y-high-contrast .menu-item,
body.a11y-high-contrast .menu,
body.a11y-high-contrast .image-display,
body.a11y-high-contrast .modal-container,
body.a11y-high-contrast .accessibility-settings-card,
body.a11y-high-contrast .a11y-toggle-card,
body.a11y-high-contrast .a11y-select-card,
body.a11y-high-contrast .chart-accessibility-panel,
body.a11y-high-contrast .admin-switch-card {
    background: #fffef6;
    border-color: rgba(16, 47, 87, 0.28);
}

body.a11y-high-contrast .entry-panel-toggle,
body.a11y-high-contrast .modal-header,
body.a11y-high-contrast .chart-accessibility-table th,
body.a11y-high-contrast .accessibility-modal-status {
    background: #f4ecd3;
    color: #102f57;
}

body.a11y-high-contrast .tab-button.active,
body.a11y-high-contrast .btn,
body.a11y-high-contrast .main-menu-back-button-icon,
body.a11y-high-contrast .icon-wrapper {
    background-color: #102f57;
    color: #fff;
}

body.a11y-high-contrast .custom-select,
body.a11y-high-contrast .admin-switch-input {
    background-color: #fff;
    border-color: rgba(16, 47, 87, 0.35);
    color: #121212;
}

body.a11y-high-contrast .site-footer {
    background: #08121f;
    color: #f8fbff;
}

body.a11y-high-contrast .site-footer a {
    color: #ffe29a;
}

body.a11y-high-contrast .color-overlay {
    opacity: 40%;
    background-image: linear-gradient(147deg, #f0a500 0%, #123c73 74%);
}

@media (max-width: 768px) {
    .accessibility-settings-grid {
        grid-template-columns: 1fr;
    }

    .accessibility-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.main-menu-back-button {
    position: fixed;
    left: auto;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 10010;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(104, 104, 172, 0.3);
    border-radius: 999px;
    padding: 0.55rem 1rem;
    background: rgba(255, 255, 255, 0.97);
    color: #5B3F6D;
    font-family: 'Kanit', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(91, 63, 109, 0.22);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.main-menu-back-button.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.main-menu-back-button:hover {
    box-shadow: 0 10px 20px rgba(91, 63, 109, 0.28);
}

.main-menu-back-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(104, 104, 172, 0.3), 0 8px 18px rgba(91, 63, 109, 0.22);
}

.main-menu-back-button-icon {
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: #6868ac;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    padding-bottom: 0;
    /* Increased padding */
    border-bottom: 1px solid var(--gray-300);
    position: sticky;
    /* Make header sticky */
    top: 0;
    background-color: white;
    z-index: 100;
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 100%;
}

.back-button,
.close-button {
    display: flex;
    align-items: center;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.back-button:hover,
.close-button:hover {
    background-color: var(--gray-100);
}

.modal-content {
    padding: 2rem;
    /* overflow-y: auto; */
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.card-loading-ai {
    color: #666;
    text-align: center;
    align-items: center;
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

.card-ai {
    color: #666;
    text-align: center;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    margin-top: 1rem;
    color: var(--text-light);
}

/* Results State */
.results-state {
    display: block;
}

.hidden {
    display: none;
}

/* Tabs */
.tabs-nav {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1em;
}

.tab-button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: none;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    background-color: var(--gray-100);
    color: var(--text-dark);
}

.tab-button:hover {
    background-color: var(--gray-200);
}

.tab-button.active {
    background-color: var(--primary);
    color: var(--white);
}

#sprite {
    display: none;
}

.tab-content {
    color: #5B3F6D;
    background-color: white;
    border-radius: var(--radius);
    min-height: 600px;
}

.tab-panel {
    display: none;
    /* animation: fadeIn 0.2s ease; */
}

.tab-panel.active {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.tab-panel h3 {
    font-size: 1.125rem;
    font-weight: 500;
    /* color: var(--primary); */
    margin-top: 0.75rem;
}

.tab-panel h2 {
    margin-top: 1em;
}

.tab-panel p {
    /* color: var(--text-dark); */
}

/* Chart Styles */
.chart-container {
    width: 100%;
    height: 400px;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background-color: var(--white);
}

.treechart-scroll-container {
    width: 100%;
    padding: 0.5rem 0.75rem 1rem;
    box-sizing: border-box;
}

.treechart-note {
    display: none;
}

@media (max-width: 992px) {
    .treechart-scroll-container {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        padding: 0.5rem 0.5rem 1rem;
    }

    .treechart-note {
        display: block;
        position: sticky;
        top: 0;
        left: 0;
        z-index: 4;
        margin: 0;
        padding: 0.25rem 0.5rem 0.5rem;
        color: #DC3545;
        background: #fff;
        font-weight: 500;
        font-size: 0.9rem;
    }

    .treechart-scroll-container .treechart-content {
        min-width: 1000px;
    }

    .treechart-scroll-container canvas {
        touch-action: pan-x pan-y !important;
    }
}

.chart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-col {
    flex: 1 1 100%;
    min-height: 450px;
    width: 100%;
}



@media (min-width: 768px) {
    .chart-col {
        flex: 1 1 calc(50% - 0.75rem);
    }

    .tab-panel.active {
        padding: 0.3em;
    }
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 0.75rem;
    text-align: center;
}

.chart-description {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    text-align: center;
}

.highcharts-drilldown-axis-label {
    cursor: pointer;
    text-decoration: underline;
    fill: var(--primary);
}

.highcharts-drilldown-point {
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease forwards;
}

.fade-in-delay {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease 0.4s forwards;
}

.detail-table {
    min-width: 900px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #9E76B3;
    border-radius: 12px;
    overflow-x: auto;
}

.detail-table-note {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 3;
    margin: 0;
    padding: 0.25rem 0.5rem 0.5rem;
    color: #DC3545;
    background: #fff;
    font-weight: 500;
    font-size: 0.9rem;
}

.detail-table td {
    border: 1px solid #aaa;
    padding: 8px 12px;
}

.detail-table th {
    border: 1px solid #aaa;
    padding: 1em;
}

.detail-table th:first-child {
    border-top-left-radius: 12px;
}

.detail-table th:last-child {
    border-top-right-radius: 12px;
}

.detail-table tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.detail-table tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.detail-table th {
    padding: 1em;
}

table {
    margin-top: 2em;
}


.swal-wide {
    width: auto !important;
    max-width: 80vw !important;
    height: auto !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

.swal-text-left {
    text-align: left !important;
    white-space: pre-wrap;
    /* ให้ขึ้นบรรทัดตาม JSON indent */
}

.highcharts-figure,
.highcharts-data-table table {
    min-width: 320px !important;
    max-width: 500px !important;
    margin: 3em auto !important;
}

#flowChart {
    max-width: 400px !important;
    margin: 1em auto !important;
}

#flowChart h4 {
    text-transform: none;
    font-size: 0.75rem;
    font-weight: normal !important;
}







#tilechartofidea {
    min-width: 380px;
    max-width: 700px;
    margin: 0 auto;
}

.highcharts-plot-border {
    border: none !important;
    stroke: none !important;

}

.highcharts-credits {
    display: none !important;
}


.card-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.card-header h1 {
    color: #5B3F6D;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.card-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.recommendation-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.selector-btn {
    text-decoration: none;
    background: #E6E4EA;
    border: 3px solid #6868AC;
    color: #6868AC;
    margin-top: 10px;
    padding: 5px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    text-align: center;
}

.selector-btn:hover {
    background: #6868AC;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(104, 104, 172, 0.3);
}

.selector-btn.active {
    background: #6868AC;
    color: white;
    box-shadow: 0 5px 15px rgba(104, 104, 172, 0.3);
}

.read-more-btn {
    background: none;
    border: none;
    font-family: 'Kanit', sans-serif;
    color: #6868AC;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 0.7rem;
    margin-left: 5px;
    text-decoration: underline;

    border-radius: 999px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
    overflow: hidden;
}

.course-skills {
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;

    height: 100%;
    /* ความสูงกรอบที่อยากให้โชว์ */
    overflow: hidden;
    /* ซ่อนส่วนที่เกิน */
    position: relative;
}

.skills-wrapper {
    /* display: flex; */
    /* flex-direction: column; */
}

.w-100 {
    width: 100% !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.d-none {
    display: none !important;
}

.position-absolute {
    position: absolute !important;
}

.list-group {
    list-style: none;
    /* เอา bullet ออก */
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    width: 30vw;
    max-width: 60vw;
}

.list-group li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    width: 30vw;
    max-width: 60vw;
}

.list-group li:last-child {
    border-bottom: none;
}

.list-group li:hover {
    background: #f7f7f7;
}

.occupation-mapping-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1em;
    margin-bottom: 1em;
}

.warning-occupation-sankey {
    text-align: center;
}

.occupation-mapping-form {
    width: 30vw;
    z-index: 30;
}

.free-elective-interest-form {
    width: min(760px, 100%) !important;
    max-width: 760px !important;
    position: relative;
    min-width: 0;
    flex: 0 1 760px;
    overflow: visible;
}

.free-elective-interest-container {
    width: min(760px, 100%);
    max-width: 760px;
}

.free-elective-interest-form .list-group,
.free-elective-interest-form .list-group li {
    width: 100%;
    max-width: 100%;
}

.free-elective-interest-form .list-group {
    max-height: min(55vh, 520px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.free-elective-interest-form .q-input,
.free-elective-interest-form .btn {
    width: 100%;
    max-width: 100%;
}

.free-elective-interest-selected {
    margin-top: 0.75rem;
    color: #5B3F6D;
    font-weight: 600;
}

.fe-course-codes-container {
    margin-top: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid #e7ddf3;
    background: #fff;
}

.fe-course-codes-container.is-loading {
    opacity: 0.75;
}

.fe-course-codes-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #4f2f69;
}

.fe-course-codes-list {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.fe-course-result-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid #efe6f8;
    border-radius: 10px;
    background: #faf7ff;
}

.fe-course-title-th,
.fe-course-title-en {
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
}

.fe-course-title-th {
    font-size: 1.125rem;
    font-weight: 700;
    color: #4f2f69;
}

.fe-course-title-en {
    font-size: 1.125rem;
    font-weight: 600;
    color: #6b5c7f;
}

.fe-course-faculty {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #5b3f6d;
    line-height: 1.35;
    word-break: break-word;
}

.fe-course-skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.fe-course-skill-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fe-course-skill-heading {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    color: #5b3f6d;
}

.fe-course-skill-heading-required {
    color: #5b3f6d;
}

.fe-course-skill-heading-other {
    color: #6b5c7f;
}

.fe-course-skill-tag {
    display: inline-block;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #d8c8ef;
    background: #f1ecfb;
    color: #4f2f69;
    font-size: 0.82rem;
    line-height: 1.2;
}

.fe-course-skill-tag-empty {
    background: #f9f4ee;
    border-color: #eadfd1;
    color: #856404;
}

.fe-course-desc-th {
    margin: 0;
    color: #5f5a6d;
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.fe-course-code-link {
    color: #5B3F6D;
    font-size: 0.86rem;
    text-decoration: none;
    font-weight: 600;
    align-self: flex-start;
}

.fe-course-code-link:hover {
    color: #DC3545;
    text-decoration: underline;
}

.fe-course-codes-empty {
    margin: 0.7rem 0 0;
    color: #7a7591;
    font-size: 0.92rem;
}

.fe-skill-tags {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2.25rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.fe-skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #f1ecfb;
    color: #5B3F6D;
    border: 1px solid #d6c7f2;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.fe-skill-tag-label {
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}

.fe-skill-tag-remove {
    border: none;
    background: transparent;
    color: #5B3F6D;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}

.fe-skill-tag-remove:hover {
    color: #DC3545;
}

.fe-skill-tag-placeholder {
    color: #7a7591;
    font-size: 0.92rem;
}

.occupation-mapping-btn {
    width: 20vw;
}

.occupationMappingChart {
    width: 100vw;/*เดิม90vw*/
}

.course-skills .skills-wrapper .skill {
    white-space: nowrap;
    /* margin: 0.5em 0.5em; */
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding: 4px 10px;
    display: inline-block;
    /* ✅ ป้องกันการตัดคำ */
}

#sprite-portal {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

#sprite {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: none !important;
    z-index: 9999;
}

#avatar {
    width: clamp(60px, 11.11vmin, 160px);
    height: auto;
    display: block;
}

/* ยึดบับเบิลกับอวาตาร์ด้วย position แทน transform แยก */
#bubble {
    position: absolute;
    left: 100%;
    /* ชิดขวาของอวาตาร์ */
    top: 0;
    transform: translate(-10px, -100%);
    /* ขยับไปทางซ้าย 10px แล้วลอยขึ้นเหนือหัว */
    min-width: 200px;
    max-width: 350px;
    pointer-events: none;
    overflow: hidden;
}

.tid-help-widget {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 10030;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    font-family: 'Kanit', sans-serif;
    pointer-events: none;
}

.tid-help-toggle,
.tid-help-panel {
    pointer-events: auto;
}

.tid-help-toggle {
    min-height: 48px;
    padding: 8px 14px 8px 8px;
    border: 2px solid #6868ac;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6868ac;
    background: #fff;
    box-shadow: 0 12px 28px rgba(104, 104, 172, 0.18);
    cursor: pointer;
    animation: tidHelpBounce 2.8s ease-in-out infinite;
    transform-origin: center bottom;
    transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.tid-help-toggle[hidden],
.tid-help-toggle.is-hidden {
    display: none !important;
}

.tid-help-toggle:hover,
.tid-help-toggle:focus-visible {
    color: #5B3F6D;
    background: #f9f8ff;
    box-shadow: 0 16px 36px rgba(104, 104, 172, 0.26);
    animation-duration: 1.25s;
}

@keyframes tidHelpBounce {
    0%,
    72%,
    100% {
        transform: translateY(0) scale(1);
    }

    78% {
        transform: translateY(-8px) scale(1.04, 0.96);
    }

    84% {
        transform: translateY(0) scale(0.98, 1.03);
    }

    90% {
        transform: translateY(-4px) scale(1.02, 0.98);
    }

    96% {
        transform: translateY(0) scale(1);
    }
}

.tid-help-toggle img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.tid-help-toggle span {
    font-size: 0.98rem;
    font-weight: 600;
    white-space: nowrap;
}

.tid-help-panel {
    width: min(380px, calc(100vw - 32px));
    max-height: min(620px, calc(100vh - 104px));
    border: 1px solid rgba(104, 104, 172, 0.22);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 54px rgba(30, 24, 58, 0.24);
    backdrop-filter: blur(10px);
}

.tid-help-panel[hidden] {
    display: none;
}

.tid-help-header {
    min-height: 64px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, rgba(104, 104, 172, 0.12), rgba(250, 171, 29, 0.16));
    border-bottom: 1px solid rgba(104, 104, 172, 0.14);
}

.tid-help-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tid-help-title img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex: 0 0 auto;
}

.tid-help-title strong,
.tid-help-title span {
    display: block;
}

.tid-help-title strong {
    color: #4f3b73;
    font-size: 1rem;
    line-height: 1.2;
}

.tid-help-title span {
    color: #655f78;
    font-size: 0.82rem;
    line-height: 1.35;
}

.tid-help-close,
.tid-help-submit {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tid-help-close {
    color: #5B3F6D;
    background: rgba(255, 255, 255, 0.7);
}

.tid-help-close:hover,
.tid-help-close:focus-visible {
    background: rgba(104, 104, 172, 0.14);
}

.tid-help-icon {
    width: 18px;
    height: 18px;
}

.tid-help-messages {
    flex: 1 1 auto;
    min-height: 220px;
    max-height: 390px;
    padding: 14px;
    overflow: auto;
    background: #fffaf0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tid-help-messages::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.tid-help-message {
    display: flex;
    margin-bottom: 10px;
}

.tid-help-message--user {
    justify-content: flex-end;
}

.tid-help-message-bubble {
    max-width: 86%;
    padding: 10px 12px;
    border-radius: 8px;
    color: #332c43;
    background: #fff;
    border: 1px solid rgba(104, 104, 172, 0.12);
    box-shadow: 0 6px 18px rgba(104, 104, 172, 0.08);
    font-size: 0.94rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tid-help-message--assistant .tid-help-message-bubble {
    white-space: normal;
}

.tid-help-message-bubble p {
    margin: 0 0 0.55rem;
}

.tid-help-message-bubble p:last-child {
    margin-bottom: 0;
}

.tid-help-message-bubble ul,
.tid-help-message-bubble ol {
    margin: 0.35rem 0 0.35rem 1.15rem;
    padding: 0;
}

.tid-help-message-bubble li {
    margin: 0.2rem 0;
}

.tid-help-message-bubble strong {
    font-weight: 600;
    color: #4f3b73;
}

.tid-help-message--user .tid-help-message-bubble {
    color: #fff;
    background: var(--primary);
    border-color: transparent;
}

.tid-help-chips {
    display: flex;
    gap: 8px;
    padding: 10px 12px 0;
    overflow-x: auto;
    background: #fffaf0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tid-help-chips::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.tid-help-chip {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid rgba(104, 104, 172, 0.22);
    border-radius: 8px;
    color: #4f3b73;
    background: #fff;
    font-family: 'Kanit', sans-serif;
    font-size: 0.84rem;
    cursor: pointer;
}

.tid-help-chip:hover,
.tid-help-chip:focus-visible {
    border-color: rgba(250, 171, 29, 0.7);
    background: rgba(250, 171, 29, 0.1);
}

.tid-help-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    background: #fffaf0;
    border-top: 1px solid rgba(104, 104, 172, 0.12);
}

.tid-help-input {
    flex: 1 1 auto;
    min-height: 42px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid rgba(104, 104, 172, 0.22);
    border-radius: 8px;
    resize: none;
    outline: none;
    color: #332c43;
    background: #fff;
    font-family: 'Kanit', sans-serif;
    font-size: 0.94rem;
    line-height: 1.45;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tid-help-input::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.tid-help-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(104, 104, 172, 0.16);
}

.tid-help-submit {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: #fff;
    background: var(--secondary);
}

.tid-help-submit:hover,
.tid-help-submit:focus-visible {
    background: #d9820f;
}

.tid-help-form.is-loading .tid-help-submit {
    opacity: 0.7;
    cursor: wait;
}

.tid-help-target-highlight {
    position: relative;
    z-index: 10020;
    outline: 3px solid #FAAB1D !important;
    outline-offset: 4px;
    scroll-margin: 120px;
    box-shadow: 0 0 0 8px rgba(250, 171, 29, 0.22), 0 0 28px rgba(104, 104, 172, 0.28) !important;
    animation: tidHelpTargetPulse 1.15s ease-in-out infinite;
}

.tid-help-target-callout {
    position: fixed;
    z-index: 10040;
    max-width: min(270px, calc(100vw - 24px));
    padding: 8px 11px;
    border: 1px solid rgba(104, 104, 172, 0.24);
    border-radius: 8px;
    color: #332c43;
    background: #fff;
    box-shadow: 0 14px 32px rgba(30, 24, 58, 0.22);
    font-family: 'Kanit', sans-serif;
    font-size: 0.9rem;
    line-height: 1.35;
    pointer-events: none;
}

.tid-help-target-callout[hidden] {
    display: none;
}

.tid-help-target-callout::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 12px;
    height: 12px;
    border-right: 1px solid rgba(104, 104, 172, 0.24);
    border-bottom: 1px solid rgba(104, 104, 172, 0.24);
    background: #fff;
    transform: translateX(-50%) rotate(45deg);
}

@keyframes tidHelpTargetPulse {
    0%,
    100% {
        box-shadow: 0 0 0 8px rgba(250, 171, 29, 0.2), 0 0 28px rgba(104, 104, 172, 0.24);
    }

    50% {
        box-shadow: 0 0 0 13px rgba(250, 171, 29, 0.08), 0 0 34px rgba(104, 104, 172, 0.32);
    }
}

body.a11y-reduce-motion .tid-help-target-highlight {
    animation: none;
}

@media (max-width: 768px) {
    .tid-help-widget {
        right: 12px;
        bottom: 12px;
    }

    .tid-help-panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 96px);
    }

    .tid-help-toggle span {
        font-size: 0.9rem;
    }
}

.course-card {

    background: #FAF4E7;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 5px solid #6868AC;
    /* opacity: 0;
    animation: fadeInUp 0.6s ease forwards; */
}

.course-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.course-card.advance {
    border-left-color: #6868AC;
}

.course-card.new {
    border-left-color: #FAAC1E;
}

.course-header {
    display: flex;
    align-items: center;
    margin: -25px -25px 15px -25px;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    position: relative;
    line-height: 130%;
    padding-top: 10%;
}

.advance .course-header {
    background: linear-gradient(to bottom, rgba(104, 104, 172, 0.7), rgba(104, 104, 172, 0));
}

.new .course-header {
    background: linear-gradient(to bottom, rgba(250, 172, 30, 0.7), rgba(250, 172, 30, 0));
}

.course-icon {
    width: 8.8rem;
    height: 2.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
    color: #6868ac;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.course-title-en {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 5px;
}

.course-title-th {
    font-size: 0.9rem;
    font-weight: 400;
    color: #333333;
    margin-bottom: 5px;
}

.course-category {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    margin-top: 5%;
}

.course-description {
    margin-bottom: 0px;
    color: #555;
    line-height: 1.6;
    font-size: 0.7rem;
    font-style: italic;
    color: #888;
}

.course-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.course-info {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #666;
}

.difficulty {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty.beginner {
    background: #d4edda;
    color: #155724;
}

.difficulty.intermediate {
    background: #fff3cd;
    color: #856404;
}

.difficulty.advanced {
    background: #ffd7be;
    color: #b0370b;
}

.difficulty.expert {
    background: #f8d7da;
    color: #721c24;
}

.text-danger {
    color: #DC3545;
}

.course-type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.course-type.Lecture {
    background: #d4edda;
    color: #155724;
}

.course-type.Laboratory {
    background: #f8d7da;
    color: #721c24;
}

.difficulty.unknown {
    background: #b6b6b6;
    color: #333;
}

.label.random-color {
    background: linear-gradient(45deg, #FF6B6B, #FFD93D, #6BCB77, #4D96FF, #A475FF);
    background-size: 400% 400%;
    animation: gradient 10s ease infinite;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
}


.enroll-btn {
    background: #6868AC;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 1rem;
}

.enroll-btn:hover {
    background: #5555a3;
    transform: translateY(-1px);
}

.new-skill .enroll-btn {
    background: #FAAC1E;
    color: #333333;
}

.new-skill .enroll-btn:hover {
    background: #e89b1a;
}

.filter-info {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(104, 104, 172, 0.1);
    border-radius: 10px;
    color: #6868AC;
    font-weight: 600;
}

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

.courses-grid {
    grid-template-columns: repeat(3, 1fr);
}

.stack-card-container {
    max-width: 400px;
    width: 100%;
}

.stack-option.advance {
    background: linear-gradient(to bottom, rgba(104, 104, 172, 0.7), rgba(104, 104, 172, 0));
    background-color: #FAF4E7;

}

.stack-option.new {
    background: linear-gradient(to bottom, rgba(250, 172, 30, 0.7), rgba(250, 172, 30, 0));
    background-color: #FAF4E7;

}

.stack-header {
    text-align: center;
    margin-bottom: 30px;
}

.stack-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stack-header p {
    opacity: .9;
    font-size: 1.1rem;
}

/* selection */
.stack-selection {
    display: block;
}

.stack-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.headercolor {
    color: #5B3F6D;
}

.stack-option {
    background: white;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .2);
}

.stack-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}

.stack-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.stack-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.stack-count {
    color: #666;
    font-weight: bold;
}

/* swiper */
.card-swiper {
    display: none;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    /* force GPU */
    backface-visibility: hidden;
    perspective: 1000px;
}

.course-card-back-button {
    background: rgba(255, 255, 255, .2);
    border: 2px solid white;
    color: #5B3F6D;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: background .2s ease;
}

.course-card-back-button:hover {
    background: rgba(255, 255, 255, .3);
}


/* OUTER swipe container (renamed from .course-card to avoid clash with your inner) */
.swipe-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    cursor: grab;
    transition: transform .3s ease, opacity .3s ease;
    user-select: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.swipe-card:active {
    cursor: grabbing;
}

.swipe-card.dragging {
    transition: none;
}

.swipe-card.swiped-left {
    transform: translateX(-100%) rotate(-30deg);
    opacity: 0;
}

.swipe-card.swiped-right {
    transform: translateX(100%) rotate(30deg);
    opacity: 0;
}



.like-indicator {
    position: absolute;
    right: 20px;
    color: #28A745;
}

.dislike-indicator {
    position: absolute;
    left: 20px;
    color: #DC3545;
}

/* Buttons + stats */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: transform .2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .2);
}

.action-btn:hover {
    transform: scale(1.1);
}

.dislike-btn {
    background: #DC3545;
    color: white;
}

.like-btn {
    background: #28A745;
    color: white;
}

.stats {
    color: #5B3F6D;
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-label {
    opacity: .8;
}

.no-more-cards {
    display: none;
    color: #5B3F6D;
    text-align: center;
    justify-items: center;
}

.no-more-cards h2 {
    margin-bottom: 10px;
}

.el-reselect-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 14px;
    padding: 0 18px;
    border: 1px solid rgba(91, 63, 109, .22);
    border-radius: 8px;
    background: linear-gradient(135deg, #5B3F6D 0%, #7E5C8F 58%, #FAAC1E 100%);
    color: #fff;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(91, 63, 109, .22);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.el-reselect-button:hover,
.el-reselect-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(91, 63, 109, .3);
    filter: brightness(1.03);
}

.el-reselect-button:focus-visible {
    outline: 3px solid rgba(250, 172, 30, .35);
    outline-offset: 3px;
}

.el-reselect-button svg {
    flex: 0 0 auto;
}

/* Stacking effect (targets OUTER swipe cards) */
.swipe-card:nth-child(2) {
    transform: scale(.95) translateY(10px);
    z-index: 1;
}

.swipe-card:nth-child(3) {
    transform: scale(.90) translateY(20px);
    z-index: 0;
}

.swipe-card:first-child {
    z-index: 2;
}

/* minimal inner tweaks so your markup breathes inside */
.swipe-card>.inner {
    padding: 18px;
    overflow: auto;
}




.stack-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stack-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}


.stack-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.stack-count {
    color: #666;
    font-weight: bold;
}

/* Added card swiper section styles */

.card-stack {
    position: relative;
    height: 600px;
}

.course-card {
    position: absolute;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.3s ease, opacity 0.3s ease;
    user-select: none;
}

.course-card:active {
    cursor: grabbing;
}

.course-card.dragging {
    animation: none !important;
    transition: none;
}

.course-card.swiped-left {
    transform: translateX(-100%) rotate(-30deg);
    opacity: 0;
}

.course-card.swiped-right {
    transform: translateX(100%) rotate(30deg);
    opacity: 0;
}

.card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: relative;
}

.card-content {
    padding: 25px;
    text-align: left;
}

.course-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.course-instructor {
    color: #666;
    margin-bottom: 15px;
    font-size: 1rem;
}

.course-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}


.detail-item {
    text-align: center;
}

.detail-value {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.detail-label {
    color: #666;
    font-size: 0.9rem;
}

.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #555;
}



/* Card stacking effect */
.course-card:nth-child(2) {
    transform: scale(0.95) translateY(10px);
    z-index: 1;
}

.course-card:nth-child(3) {
    transform: scale(0.9) translateY(20px);
    z-index: 0;
}

.course-card:first-child {
    z-index: 2;
}

/* ซ่อนตัวบอกสถานะเริ่มต้น */
.action-indicators {
    pointer-events: none;
}

.like-indicator,
.dislike-indicator {
    opacity: 0;
    font-weight: 700;
    letter-spacing: 2px;
    transition: opacity .2s ease;
}

/* แอนิเมชันบอกใบ้การปัด */
@keyframes swipeHint {
    0% {
        transform: translateX(0) rotate(0);
    }

    20% {
        transform: translateX(12px) rotate(2deg);
    }

    /* เหมือนจะปัดขวา */
    40% {
        transform: translateX(-12px) rotate(-2deg);
    }

    /* แล้วแย้มซ้าย */
    60% {
        transform: translateX(10px) rotate(1.6deg);
    }

    80% {
        transform: translateX(-10px) rotate(-1.6deg);
    }

    100% {
        transform: translateX(0) rotate(0);
    }

    /* กลับศูนย์ */
}

.course-card.hint {
    animation: swipeHint 1.6s ease-in-out .6s 1 both;
    /* หน่วง .6s แล้วค่อยขยับรอบเดียว */
}

.elective-selected-table-container {
    display: block;
    width: 100%;
    overflow-x: scroll;
    scrollbar-width: thin;
}

.elective-selected-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.site-footer {
    margin-top: 48px;
    border-top: 1px solid rgba(0, 0, 0, .08);
    background: #0b1020;
    /* โทนเข้มอ่านง่าย */
    color: #e8ebf0;
    padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
    font-family: "Kanit", sans-serif;
}

.site-footer a {
    color: #cfe1ff;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.site-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.ft-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.ft-col {
    min-width: 0;
}

.ft-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ft-title {
    font-weight: 600;
}

.ft-sub {
    font-size: 0.95rem;
    opacity: .9;
}

.ft-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    opacity: .8;
    font-size: .9rem;
}

.ft-heading {
    font-weight: 600;
    margin-bottom: 8px;
}

.ft-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.ft-text {
    margin: .5rem 0 1rem;
    opacity: .95;
}

.ft-btn {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, .25);
    background: transparent;
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.ft-btn:hover {
    background: rgba(255, 255, 255, .08);
}

.ft-bottom {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ft-lang a {
    padding: 0 4px;
}

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

/* Sticky footer แบบยืดหยุ่น */
html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
}

/* ไม่ให้ footer บัง modal */
#resultsModal {
    z-index: 1000;
}

.site-footer {
    z-index: 10;
    position: relative;
}

.insights-page {
    min-height: 100%;
    background:
        linear-gradient(to bottom, rgba(107, 105, 177, 0.22) 0%, #FAF4E7 360px, #FAF4E7 100%),
        url("../images/netbackground.svg");
    background-color: #FAF4E7;
    background-repeat: no-repeat, repeat-x;
    background-position: top center, top center;
    background-size: auto, auto;
    color: var(--text-dark);
}

.insights-main {
    width: 100%;
    margin: 0 auto;
    padding: calc(env(safe-area-inset-top, 0px) + 24px) 0 32px;
}

.insights-topbar {
    width: min(96vw, 1540px);
    min-height: 84px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0;
    row-gap: 0.75rem;
    margin: 0 auto;
    padding: 0.8rem 1.1rem;
    border: 1px solid rgba(104, 104, 172, 0.16);
    border-radius: 16px;
    background: rgba(254, 253, 250, 0.9);
    box-shadow: var(--shadow);
    overflow: visible;
}

.insights-brand {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.insights-brand img {
    width: clamp(168px, 15vw, 237px);
    height: auto;
    object-fit: contain;
    pointer-events: none;
}

.insights-nav {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow: visible;
    scrollbar-width: thin;
    padding: 0.55rem 0.65rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    touch-action: pan-y;
    user-select: none;
}

.insights-liquid-indicator {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 0;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
    isolation: isolate;
    transform: translate3d(0, 0, 0);
    background:
        radial-gradient(ellipse at 28% 22%, rgba(255, 255, 255, 0.96) 0 22%, transparent 54%),
        radial-gradient(ellipse at 82% 78%, rgba(202, 198, 248, 0.16) 0 30%, transparent 64%),
        linear-gradient(180deg, rgba(254, 254, 255, 0.97) 0%, rgba(249, 248, 255, 0.9) 50%, rgba(244, 243, 255, 0.92) 100%);
    box-shadow:
        inset 0 16px 26px -24px rgba(57, 46, 86, 0.2),
        inset 0 7px 16px -14px rgba(88, 74, 142, 0.12),
        inset 15px 15px 30px -21px rgba(58, 58, 68, 0.18),
        inset -15px -15px 30px -21px rgba(58, 58, 68, 0.14),
        inset -14px 14px 30px -23px rgba(255, 255, 255, 0.84),
        inset 14px -14px 30px -23px rgba(255, 255, 255, 0.72),
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        inset 0 -1px 0 rgba(95, 74, 160, 0.14),
        inset 1px 0 0 rgba(255, 255, 255, 0.42),
        inset -1px 0 0 rgba(126, 112, 196, 0.12);
    will-change: transform, width, height;
}

.insights-liquid-indicator.is-ready {
    opacity: 1;
    transition:
        transform 500ms cubic-bezier(.24, 1.18, .34, 1),
        width 500ms cubic-bezier(.24, 1.08, .34, 1),
        height 500ms cubic-bezier(.24, 1.08, .34, 1),
        opacity 180ms ease;
}

.insights-liquid-indicator::before,
.insights-liquid-indicator::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.insights-liquid-indicator::before {
    z-index: 0;
    inset: 1.5px;
    background: transparent;
    opacity: 0.48;
    filter: blur(0.8px);
    box-shadow:
        inset 18px 18px 22px -20px rgba(72, 72, 82, 0.36),
        inset -18px -18px 22px -20px rgba(72, 72, 82, 0.24),
        inset -18px 18px 22px -22px rgba(255, 255, 255, 0.94),
        inset 18px -18px 22px -22px rgba(255, 255, 255, 0.84),
        inset 0 0 20px rgba(116, 105, 188, 0.08);
}

.insights-liquid-indicator::after {
    z-index: 2;
    padding: 1.1px;
    background:
        conic-gradient(
            from 0deg,
            rgba(255, 255, 255, 0.98) 0deg,
            rgba(255, 255, 255, 0.94) 70deg,
            rgba(100, 100, 100, 0.36) 118deg,
            rgba(100, 100, 100, 0.22) 160deg,
            rgba(255, 255, 255, 0.98) 208deg,
            rgba(255, 255, 255, 0.9) 250deg,
            rgba(100, 100, 100, 0.38) 298deg,
            rgba(100, 100, 100, 0.24) 340deg,
            rgba(255, 255, 255, 0.98) 360deg
        );
    opacity: 0.38;
    filter: blur(0.35px);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
}

.insights-liquid-magnifier {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    overflow: hidden;
}

.insights-liquid-track {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    transform-origin: 0 0;
    will-change: transform;
}

.insights-liquid-indicator.is-ready .insights-liquid-track {
    transition: transform 500ms cubic-bezier(.24, 1.18, .34, 1);
}

.insights-liquid-indicator.is-dragging,
.insights-liquid-indicator.is-ready.is-dragging .insights-liquid-track {
    transition: none;
}

.insights-nav.is-liquid-dragging,
.insights-nav.is-liquid-dragging .insights-nav-item {
    cursor: grabbing;
}

.insights-liquid-copy {
    flex: 0 0 auto;
    box-sizing: border-box;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 18px;
    color: #392850;
    font-family: 'Kanit', sans-serif;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.1;
    padding: 0.7rem 0.85rem;
    white-space: nowrap;
}

.insights-liquid-indicator.is-bouncing {
    animation: insightsLiquidBounce 500ms cubic-bezier(.24, 1.04, .34, 1) both;
}

.insights-nav-item {
    flex: 0 0 auto;
    min-height: 48px;
    position: relative;
    z-index: 1;
    border: 1px solid transparent;
    border-radius: 18px;
    background: transparent;
    color: #5B3F6D;
    font-family: 'Kanit', sans-serif;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.1;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    touch-action: pan-y;
    transition:
        border-color 0.18s ease,
        color 0.18s ease;
}

.insights-nav-label {
    position: relative;
    z-index: 1;
    display: inline-block;
    white-space: nowrap;
    transition: color 0.18s ease;
}

.insights-nav-item:hover,
.insights-nav-item:focus-visible {
    border-color: rgba(104, 104, 172, 0.18);
    outline: none;
}

.insights-nav-item.is-active {
    border-color: transparent;
    background: transparent;
    color: #4c3760;
}

.insights-nav-item.is-active .insights-nav-label {
    transform: none;
    text-shadow: none;
}

@keyframes insightsLiquidBounce {
    0% {
        border-radius: 18px;
        scale: 1;
    }

    28% {
        border-radius: 18px;
        scale: 1.006;
    }

    56% {
        border-radius: 18px;
        scale: 0.998;
    }

    78% {
        border-radius: 18px;
        scale: 1.002;
    }

    100% {
        border-radius: 18px;
        scale: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .insights-liquid-indicator,
    .insights-liquid-indicator::before,
    .insights-liquid-indicator::after,
    .insights-liquid-track,
    .insights-nav-item,
    .insights-nav-label,
    .insights-skill-chord-canvas svg,
    .insights-spider-chart .highcharts-container {
        animation: none !important;
        transition: none !important;
    }

    .insights-nav-item.is-active .insights-nav-label {
        transform: none;
    }
}

.insights-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 0;
    max-width: 100%;
    margin-left: clamp(0.9rem, 2vw, 1.8rem);
}

.insights-term-chip {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(250, 171, 29, 0.36);
    border-radius: 999px;
    background: #fff8e9;
    color: #7d5b12;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.1;
    padding: 0.45rem 0.75rem;
    white-space: nowrap;
}

.insights-action-button {
    flex: 0 0 auto;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid rgba(104, 104, 172, 0.24);
    border-radius: 999px;
    background: #fff;
    color: #5B3F6D;
    font-family: 'Kanit', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.48rem 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(87, 77, 133, 0.08);
}

.insights-action-button:hover,
.insights-action-button:focus-visible {
    border-color: rgba(104, 104, 172, 0.45);
    background: #f7f7ff;
    outline: none;
}

.insights-action-button--icon {
    width: 38px;
    padding-inline: 0;
}

.insights-action-button--career {
    min-width: 112px;
    padding-inline: 1rem;
}

.insights-loading-spinner {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(104, 104, 172, 0.22);
    border-top-color: #6868ac;
    border-radius: 50%;
    animation: spin 760ms linear infinite;
}

.insights-local-loading {
    position: relative;
}

.insights-local-loader {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: grid;
    place-items: center;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.72);
    pointer-events: none;
}

.insights-local-loader-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: min(92%, 360px);
    border: 1px solid rgba(104, 104, 172, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #4c3760;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.65rem 0.85rem;
    box-shadow: 0 12px 28px rgba(60, 45, 83, 0.16);
    text-align: center;
}

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

    .insights-loading-spinner,
    .insights-occupation-searchbox.is-loading::after,
    .insights-occupation-status.is-loading::before,
    .insights-occupation-recommendations-status.is-loading::before,
    .insights-spider-status.is-loading::before,
    .insights-curriculum-status.is-loading::before,
    .insights-occupation-save.is-loading::before {
        animation: none !important;
    }

    .insights-spider-chart.has-clickable-drilldown .insights-spider-clickable-label {
        animation: none !important;
        filter: drop-shadow(0 0 5px rgba(104, 104, 172, 0.24));
    }
}

.insights-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 3vw, 2rem);
    background: rgba(53, 42, 72, 0.28);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.insights-modal-backdrop[hidden] {
    display: none;
}

.insights-occupation-modal {
    width: min(94vw, 680px);
    max-height: calc(100dvh - 36px);
    display: grid;
    gap: 1rem;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 60px rgba(60, 45, 83, 0.24);
    padding: clamp(1rem, 2.6vw, 1.45rem);
}

.insights-occupation-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.insights-occupation-kicker {
    margin: 0 0 0.25rem;
    color: #7d5b12;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.insights-occupation-modal h2 {
    margin: 0;
    color: #4c3760;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 600;
    line-height: 1.2;
}

.insights-occupation-close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 50%;
    background: #fff;
    color: #5B3F6D;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.insights-occupation-close:hover,
.insights-occupation-close:focus-visible {
    border-color: rgba(104, 104, 172, 0.42);
    background: #f7f6ff;
    outline: none;
}

.insights-occupation-close[disabled] {
    cursor: not-allowed;
    opacity: 0.42;
}

.insights-occupation-message {
    margin: 0;
    border: 1px solid rgba(250, 171, 29, 0.28);
    border-radius: 12px;
    background: #fff8e9;
    color: #6b4d12;
    font-size: 0.96rem;
    line-height: 1.55;
    padding: 0.72rem 0.85rem;
}

.insights-occupation-selected {
    min-height: 48px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.insights-occupation-selected:empty::before {
    content: "ยังไม่มีอาชีพที่เลือก";
    color: #746580;
    font-size: 0.9rem;
}

.insights-occupation-chip {
    min-width: 0;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 999px;
    background: #f7f6ff;
    color: #4c3760;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.15;
    padding: 0.45rem 0.48rem 0.45rem 0.72rem;
}

.insights-occupation-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-occupation-chip button {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(91, 63, 109, 0.1);
    color: #5B3F6D;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.insights-occupation-chip button:hover,
.insights-occupation-chip button:focus-visible {
    background: rgba(91, 63, 109, 0.18);
    outline: none;
}

.insights-occupation-recommendations {
    display: grid;
    gap: 0.62rem;
    border: 1px solid rgba(104, 104, 172, 0.14);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(247, 246, 255, 0.92), rgba(255, 255, 255, 0.96));
    padding: 0.78rem;
}

.insights-occupation-recommendations-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.insights-occupation-recommendations-eyebrow {
    margin: 0 0 0.1rem;
    color: #7d5b12;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.insights-occupation-recommendations h3 {
    margin: 0;
    color: #4c3760;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.insights-occupation-recommendations-status {
    min-width: max-content;
    margin: 0.12rem 0 0;
    color: #746580;
    font-size: 0.78rem;
    line-height: 1.35;
}

.insights-occupation-recommendations-status.is-error {
    color: #a13d3d;
}

.insights-occupation-recommendations-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
}

.insights-occupation-recommendation {
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(104, 104, 172, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: #4c3760;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    padding: 0.52rem 0.58rem;
    text-align: left;
}

.insights-occupation-recommendation:hover,
.insights-occupation-recommendation:focus-visible {
    border-color: rgba(104, 104, 172, 0.36);
    background: #fff;
    box-shadow: 0 8px 18px rgba(60, 45, 83, 0.1);
    outline: none;
}

.insights-occupation-recommendation[disabled] {
    cursor: not-allowed;
    opacity: 0.58;
}

.insights-occupation-recommendation.is-selected {
    border-color: rgba(47, 119, 80, 0.22);
    background: rgba(236, 248, 241, 0.92);
}

.insights-occupation-recommendation-rank {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #5B3F6D;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.insights-occupation-recommendation-body {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}

.insights-occupation-recommendation-body strong,
.insights-occupation-recommendation-body span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-occupation-recommendation-body strong {
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.22;
}

.insights-occupation-recommendation-body span {
    color: #746580;
    font-size: 0.74rem;
    font-weight: 500;
}

.insights-occupation-recommendations-empty {
    grid-column: 1 / -1;
    margin: 0;
    color: #746580;
    font-size: 0.84rem;
    line-height: 1.45;
}

.insights-occupation-search {
    display: grid;
    gap: 0.42rem;
}

.insights-occupation-search label {
    color: #4c3760;
    font-size: 0.86rem;
    font-weight: 700;
}

.insights-occupation-searchbox {
    position: relative;
}

.insights-occupation-searchbox.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0.85rem;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(104, 104, 172, 0.2);
    border-top-color: #6868ac;
    border-radius: 50%;
    animation: spin 760ms linear infinite;
    pointer-events: none;
}

.insights-occupation-searchbox input {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(104, 104, 172, 0.22);
    border-radius: 12px;
    background: #fff;
    color: #3f3150;
    font-family: 'Kanit', sans-serif;
    font-size: 0.96rem;
    line-height: 1.2;
    padding: 0.72rem 0.85rem;
}

.insights-occupation-searchbox.is-loading input {
    padding-right: 2.65rem;
}

.insights-occupation-searchbox input:focus {
    border-color: rgba(104, 104, 172, 0.5);
    box-shadow: 0 0 0 3px rgba(104, 104, 172, 0.12);
    outline: none;
}

.insights-occupation-suggestions {
    width: 100%;
    max-height: min(300px, 36dvh);
    overflow-y: auto;
    display: grid;
    gap: 0.28rem;
    margin: 0.42rem 0 0;
    padding: 0.35rem;
    border: 1px solid rgba(104, 104, 172, 0.16);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(60, 45, 83, 0.12);
    list-style: none;
}

.insights-occupation-suggestions[hidden] {
    display: none;
}

.insights-occupation-option {
    width: 100%;
    display: grid;
    gap: 0.14rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #4c3760;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.58rem 0.62rem;
    text-align: left;
}

.insights-occupation-option small {
    color: #746580;
    font-size: 0.78rem;
    font-weight: 500;
}

.insights-occupation-option:hover,
.insights-occupation-option:focus-visible {
    background: #f7f6ff;
    outline: none;
}

.insights-occupation-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.insights-occupation-status {
    min-width: 0;
    margin: 0;
    color: #746580;
    font-size: 0.86rem;
    line-height: 1.35;
}

.insights-occupation-status.is-error {
    color: #a13d3d;
}

.insights-occupation-status.is-success {
    color: #2f7750;
}

.insights-occupation-status.is-loading,
.insights-occupation-recommendations-status.is-loading,
.insights-spider-status.is-loading,
.insights-curriculum-status.is-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.insights-occupation-status.is-loading::before,
.insights-occupation-recommendations-status.is-loading::before,
.insights-spider-status.is-loading::before,
.insights-curriculum-status.is-loading::before {
    content: "";
    flex: 0 0 auto;
    width: 0.86rem;
    height: 0.86rem;
    border: 2px solid rgba(104, 104, 172, 0.22);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 760ms linear infinite;
}

.insights-occupation-save {
    flex: 0 0 auto;
    min-height: 42px;
    min-width: 136px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 0;
    border-radius: 999px;
    background: #5B3F6D;
    color: #fff;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.72rem 1rem;
    box-shadow: 0 10px 18px rgba(91, 63, 109, 0.18);
}

.insights-occupation-save:hover,
.insights-occupation-save:focus-visible {
    background: #4c3760;
    outline: none;
}

.insights-occupation-save[disabled] {
    cursor: not-allowed;
    opacity: 0.56;
}

.insights-occupation-save.is-loading::before {
    content: "";
    flex: 0 0 auto;
    width: 0.92rem;
    height: 0.92rem;
    border: 2px solid rgba(255, 255, 255, 0.36);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 760ms linear infinite;
}

.insights-profilebar {
    width: min(96vw, 1540px);
    min-height: 74px;
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.65fr);
    align-items: stretch;
    gap: 0.8rem;
    margin: 0.65rem auto 0;
    padding: 0.58rem;
    border: 1px solid rgba(104, 104, 172, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(91, 63, 109, 0.07);
}

.insights-profile-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.72rem;
    padding: 0.45rem 0.62rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(104, 104, 172, 0.1), rgba(250, 171, 29, 0.08));
}

.insights-profile-avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #5B3F6D;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
}

.insights-profile-nameblock {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
}

.insights-profile-eyebrow,
.insights-profile-stat span {
    color: #746580;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
}

.insights-profile-nameblock strong {
    min-width: 0;
    overflow: hidden;
    color: #4c3760;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-profile-nameblock > span:last-child {
    min-width: 0;
    overflow: hidden;
    color: #5f5f78;
    font-size: 0.82rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-profile-stats {
    min-width: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.45rem;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.insights-profile-stats.is-auto-scrolling {
    scroll-behavior: auto;
}

.insights-profile-stat {
    flex: 0 0 104px;
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 0.22rem;
    padding: 0.44rem 0.58rem;
    border: 1px solid rgba(104, 104, 172, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
}

.insights-profile-stat strong {
    min-width: 0;
    overflow: hidden;
    color: #4c3760;
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-back-row {
    flex: 0 0 auto;
    width: max-content;
    margin: 0;
    display: flex;
    justify-content: flex-start;
}

.insights-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #5B3F6D;
    font-weight: 600;
    line-height: 1;
    padding: 0.48rem 0.78rem;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(91, 63, 109, 0.08);
}

.insights-back-link:hover,
.insights-back-link:focus-visible {
    border-color: rgba(104, 104, 172, 0.34);
    background: #fff;
    color: var(--primary);
    outline: none;
}

.insights-heading {
    width: min(96vw, 1540px);
    margin: 0 auto;
    padding: clamp(0.7rem, 1.6vw, 1rem) 0 0.8rem;
}

.insights-kicker {
    margin: 0 0 0.45rem;
    color: #7d5b12;
    font-size: 0.95rem;
    font-weight: 600;
}

.insights-title-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(0.85rem, 2vw, 1.25rem);
    width: max-content;
    max-width: 100%;
}

.insights-heading h1 {
    margin: 0;
    color: #5B3F6D;
    font-size: clamp(2.1rem, 6vw, 4.25rem);
    line-height: 1.05;
    font-weight: 600;
}

.insights-title-logo {
    flex: 0 1 auto;
    display: block;
    width: min(420px, 100%);
    aspect-ratio: 1440 / 428.25;
    height: auto;
    margin-top: 0;
    border: 0;
    pointer-events: none;
}

.insights-heading p:not(.insights-kicker) {
    max-width: 760px;
    margin: 1rem 0 0;
    color: #4e4e67;
    font-size: 1.05rem;
    line-height: 1.7;
}

.insights-workspace {
    width: min(96vw, 1540px);
    margin: 0 auto;
}

.insights-overview-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.72fr);
    gap: clamp(0.9rem, 2vw, 1.25rem);
    margin-bottom: clamp(0.9rem, 2vw, 1.25rem);
}

.insights-overview-card,
.insights-plan-shell {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(104, 104, 172, 0.16);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.9)),
        #fff;
    box-shadow: 0 14px 30px rgba(91, 63, 109, 0.08);
    animation: insightsDashboardEnter 520ms cubic-bezier(.2, .78, .24, 1) both;
}

.insights-overview-card::before,
.insights-plan-shell::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #6868ac, #2f9e9a 45%, #FAAB1D);
    opacity: 0.88;
}

.insights-overview-card {
    display: grid;
    align-content: start;
    gap: 1rem;
    padding: clamp(1.05rem, 2.2vw, 1.45rem);
}

.insights-overview-highlights-card {
    animation-delay: 70ms;
}

.insights-overview-card-header,
.insights-plan-card-header,
.insights-plan-header {
    min-width: 0;
}

.insights-overview-card-header h2,
.insights-plan-header h2,
.insights-plan-card-header h3 {
    margin: 0;
    color: #5B3F6D;
    font-weight: 700;
    line-height: 1.18;
}

.insights-overview-card-header h2 {
    font-size: clamp(1.08rem, 2vw, 1.38rem);
}

.insights-overview-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.72rem;
}

.insights-overview-metric {
    --insights-metric-accent: #6868ac;
    --insights-metric-soft: rgba(104, 104, 172, 0.1);
    min-width: 0;
    display: grid;
    gap: 0.34rem;
    align-content: start;
    min-height: 132px;
    padding: 0.86rem;
    border: 1px solid rgba(104, 104, 172, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.insights-overview-metric.is-teal {
    --insights-metric-accent: #2f9e9a;
    --insights-metric-soft: rgba(47, 158, 154, 0.12);
}

.insights-overview-metric.is-gold {
    --insights-metric-accent: #d99312;
    --insights-metric-soft: rgba(250, 171, 29, 0.16);
}

.insights-overview-metric.is-green {
    --insights-metric-accent: #3a8f63;
    --insights-metric-soft: rgba(58, 143, 99, 0.12);
}

.insights-overview-metric span {
    color: rgba(91, 63, 109, 0.66);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.18;
}

.insights-overview-metric strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #33283f;
    font-size: clamp(1.04rem, 2vw, 1.42rem);
    font-weight: 800;
    line-height: 1.18;
}

.insights-overview-metric small {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #746580;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.42;
}

.insights-overview-metric i {
    position: relative;
    display: block;
    height: 6px;
    margin-top: auto;
    overflow: hidden;
    border-radius: 999px;
    background: var(--insights-metric-soft);
}

.insights-overview-metric i::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--insights-metric-progress, 0%);
    border-radius: inherit;
    background: var(--insights-metric-accent);
    transform-origin: left center;
    animation: insightsMeterSweep 780ms cubic-bezier(.2, .8, .2, 1) both;
}

.insights-overview-highlight-list {
    display: grid;
    gap: 0.68rem;
}

.insights-overview-highlight {
    --insights-highlight-accent: #6868ac;
    min-width: 0;
    display: grid;
    gap: 0.18rem;
    padding: 0.78rem 0.86rem 0.78rem 0.92rem;
    border-left: 4px solid var(--insights-highlight-accent);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.insights-overview-highlight.is-green {
    --insights-highlight-accent: #3a8f63;
}

.insights-overview-highlight.is-gold {
    --insights-highlight-accent: #d99312;
}

.insights-overview-highlight.is-muted {
    --insights-highlight-accent: #8f8797;
}

.insights-overview-highlight span {
    color: var(--insights-highlight-accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
}

.insights-overview-highlight strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #4c3760;
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.25;
}

.insights-overview-highlight p,
.insights-plan-header p,
.insights-plan-focus-item p,
.insights-plan-timeline-item p {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: #746580;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.55;
}

.insights-overview-map-panel {
    margin-top: 0;
}

.insights-overview-skill-map {
    min-width: 0;
    display: grid;
    gap: 0.68rem;
    padding: 0.82rem 0.9rem;
    border: 1px solid rgba(47, 158, 154, 0.16);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(241, 252, 250, 0.9), rgba(255, 249, 235, 0.62));
}

.insights-overview-skill-map-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.insights-overview-skill-map-title strong {
    min-width: 0;
    color: #4c3760;
    font-size: 0.92rem;
    font-weight: 800;
}

.insights-overview-skill-map-title span {
    flex: 0 0 auto;
    color: #637371;
    font-size: 0.74rem;
    font-weight: 700;
}

.insights-overview-skill-map-rows {
    display: grid;
    gap: 0.52rem;
}

.insights-overview-skill-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.3rem 0.65rem;
    align-items: center;
}

.insights-overview-skill-row span {
    min-width: 0;
    overflow: hidden;
    color: #5B3F6D;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.28;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-overview-skill-row strong {
    color: #2f706f;
    font-size: 0.78rem;
    font-weight: 800;
}

.insights-overview-skill-row i {
    position: relative;
    grid-column: 1 / -1;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(104, 104, 172, 0.11);
}

.insights-overview-skill-row i::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--insights-skill-row-progress, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, #6868ac, #2f9e9a);
    transform-origin: left center;
    animation: insightsMeterSweep 760ms cubic-bezier(.2, .8, .2, 1) both;
}

.insights-dashboard-empty {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.6;
}

@keyframes insightsDashboardEnter {
    from {
        opacity: 0;
        transform: translate3d(0, 12px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes insightsMeterSweep {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.insights-spider-panel {
    display: block;
}

.insights-spider-layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(250px, 3fr);
    gap: clamp(0.9rem, 2vw, 1.25rem);
    align-items: stretch;
}

.insights-spider-graph {
    min-width: 0;
    display: grid;
    gap: 0.9rem;
    padding: clamp(1.1rem, 2.4vw, 1.6rem);
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px rgba(91, 63, 109, 0.08);
}

.insights-spider-header,
.insights-career-panel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.insights-spider-header > div,
.insights-career-panel-header > div {
    min-width: 0;
}

.insights-spider-header .insights-kicker,
.insights-career-panel-header .insights-kicker {
    margin-bottom: 0.22rem;
}

.insights-spider-header h2,
.insights-career-panel h3 {
    margin: 0;
    color: #5B3F6D;
    font-size: clamp(1.18rem, 2.2vw, 1.55rem);
    font-weight: 600;
    line-height: 1.2;
}

.insights-spider-description {
    position: relative;
    max-width: 760px;
    min-height: clamp(2.65rem, 5vw, 3.35rem);
    margin: 0.42rem 0 0;
    padding-left: clamp(3.05rem, 5.4vw, 4rem);
    color: rgba(91, 63, 109, 0.76);
    font-size: clamp(0.82rem, 1.2vw, 0.96rem);
    font-weight: 400;
    line-height: 1.7;
}

.insights-spider-description-highlight {
    display: inline;
    margin-inline: 0.05em;
    padding: 0.02em 0.28em;
    border-radius: 999px;
    background: rgba(250, 171, 29, 0.14);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    color: #5B3F6D;
    font-weight: 600;
}

.insights-spider-description.is-typing::after {
    content: "";
    display: inline-block;
    width: 0.48em;
    height: 1.08em;
    margin-left: 0.14em;
    border-radius: 999px;
    background: rgba(91, 63, 109, 0.55);
    vertical-align: -0.18em;
    animation: insights-description-caret 0.82s ease-in-out infinite;
}

@keyframes insights-description-caret {
    0%,
    100% {
        opacity: 0.2;
        transform: translateY(0);
    }
    45% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

.insights-spider-description::before {
    content: "";
    position: absolute;
    top: 0.08rem;
    left: 0;
    width: clamp(2.4rem, 4.8vw, 3.25rem);
    aspect-ratio: 1;
    background: url("../images/tid-head/webp/t-advice.webp") center / contain no-repeat;
    transform: scaleX(-1);
    transform-origin: center;
}

.insights-spider-drillback {
    margin-top: 0.45rem;
    border: 1px solid rgba(104, 104, 172, 0.2);
    border-radius: 999px;
    background: #fff;
    color: #5B3F6D;
    font: 600 0.82rem/1.1 Kanit, sans-serif;
    padding: 0.48rem 0.78rem;
    box-shadow: 0 8px 18px rgba(91, 63, 109, 0.08);
    cursor: pointer;
}

.insights-spider-drillback:hover,
.insights-spider-drillback:focus-visible {
    border-color: rgba(250, 171, 29, 0.5);
    color: #3f3150;
    outline: none;
}

.insights-relation-filter {
    min-width: 0;
    min-inline-size: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.42rem;
    margin: 0.68rem 0 0;
    padding: 0;
    border: 0;
}

.insights-relation-filter[hidden] {
    display: none;
}

.insights-occupation-filter-disclosure {
    min-width: 0;
    display: grid;
    gap: 0.5rem;
    margin: 0.68rem 0 0;
    position: relative;
}

.insights-occupation-filter-disclosure[hidden] {
    display: none !important;
}

.insights-occupation-filter-toggle {
    display: none;
}

.insights-occupation-filter-panel {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.42rem 0.7rem;
}

.insights-occupation-filter-panel .insights-relation-filter {
    margin: 0;
}

.insights-relation-filter legend {
    margin: 0 0.08rem 0 0;
    padding: 0;
    color: rgba(91, 63, 109, 0.62);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
}

.insights-relation-filter-option {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #5B3F6D;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.38rem 0.58rem;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.insights-relation-filter-option:has(input:checked) {
    border-color: rgba(250, 171, 29, 0.54);
    background: rgba(250, 171, 29, 0.14);
    color: #4c3760;
    box-shadow: 0 8px 16px rgba(91, 63, 109, 0.06);
}

.insights-relation-filter-option:hover,
.insights-relation-filter-option:focus-within {
    border-color: rgba(104, 104, 172, 0.34);
}

.insights-relation-filter-option input {
    width: 0.92rem;
    height: 0.92rem;
    flex: 0 0 auto;
    margin: 0;
    accent-color: #FAAB1D;
}

.insights-relation-filter-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.insights-relation-filter.is-compact {
    margin-top: 0.5rem;
}

.insights-spider-status {
    min-height: 1.35em;
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: right;
}

.insights-spider-status.is-error {
    color: #a13d3d;
}

.insights-spider-chart {
    width: 100%;
    height: clamp(440px, 54vw, 680px);
    min-height: 440px;
    overflow: visible;
}

.insights-spider-chart:not(.is-chord) {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(104, 104, 172, 0.12);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 247, 255, 0.72));
}

.insights-spider-chart .insights-local-loader {
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 44%, rgba(250, 171, 29, 0.12), transparent 34%),
        rgba(255, 255, 255, 0.82);
}

.insights-spider-chart .highcharts-container {
    max-width: 100%;
}

.insights-spider-chart:not(.is-chord) .highcharts-container {
    border-radius: inherit;
}

.insights-spider-chart .highcharts-series-group,
.insights-gap-chart .highcharts-series-group {
    transform-box: fill-box;
    transform-origin: center;
}

.insights-spider-chart.is-filter-updating .highcharts-series-group,
.insights-gap-chart.is-filter-updating .highcharts-series-group {
    animation: insightsFilterUpdate 620ms cubic-bezier(.2, .82, .28, 1) both;
}

.insights-spider-chart.is-web-collapsing .highcharts-xaxis-grid .highcharts-grid-line,
.insights-gap-chart.is-web-collapsing .highcharts-xaxis-grid .highcharts-grid-line {
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

@keyframes insightsFilterUpdate {
    0% {
        filter: saturate(0.96) drop-shadow(0 0 0 rgba(104, 104, 172, 0));
        transform: scale(0.992);
    }
    42% {
        filter: saturate(1.04) drop-shadow(0 10px 22px rgba(104, 104, 172, 0.16));
        transform: scale(1.012);
    }
    100% {
        filter: saturate(1) drop-shadow(0 0 0 rgba(104, 104, 172, 0));
        transform: scale(1);
    }
}

.insights-spider-chart.has-clickable-drilldown .insights-spider-clickable-label {
    cursor: pointer;
    fill: #5B3F6D !important;
    stroke: rgba(255, 255, 255, 0.72);
    stroke-width: 2px;
    paint-order: stroke;
    text-decoration: none !important;
    transform-box: fill-box;
    transform-origin: center;
    animation: insightsDrillLabelPulse 2.3s ease-in-out infinite;
    animation-delay: var(--insights-drill-label-delay, 0ms);
}

.insights-spider-chart.has-clickable-drilldown .insights-spider-clickable-label:hover,
.insights-spider-chart.has-clickable-drilldown .insights-spider-clickable-label:focus {
    fill: #3f3150 !important;
    filter: drop-shadow(0 0 7px rgba(104, 104, 172, 0.32));
    outline: none;
    text-decoration: none !important;
    animation-duration: 760ms;
}

@keyframes insightsDrillLabelPulse {
    0%,
    100% {
        opacity: 0.78;
        filter: drop-shadow(0 0 0 rgba(104, 104, 172, 0));
        transform: scale(1);
    }
    42% {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(104, 104, 172, 0.28));
        transform: scale(1.045);
    }
}

.insights-spider-empty {
    display: grid;
    min-height: 360px;
    place-items: center;
    color: #746580;
    font-weight: 600;
    text-align: center;
}

.insights-profile-stat--wide {
    flex-basis: 190px;
}

.insights-spider-chart.is-chord {
    height: auto;
    min-height: 0;
}

.insights-skill-chord {
    display: grid;
    gap: 1rem;
}

.insights-skill-chord-canvas svg.is-drill-enter {
    animation: insightsDrillEnter 520ms cubic-bezier(.18, .98, .32, 1) both;
}

.insights-skill-chord-canvas svg.is-drill-return {
    animation: insightsDrillReturn 260ms cubic-bezier(.54, 0, .78, .18) both;
}

.insights-spider-chart .highcharts-container.is-drill-out {
    transform-origin: var(--insights-drill-x, 50%) var(--insights-drill-y, 50%);
    animation: insightsDrillOut 480ms cubic-bezier(.18, .98, .32, 1) both;
}

@keyframes insightsDrillEnter {
    0% {
        opacity: 0;
        filter: blur(8px);
        transform: scale(0.18);
    }
    58% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1.035);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

@keyframes insightsDrillReturn {
    0% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
    100% {
        opacity: 0;
        filter: blur(7px);
        transform: scale(0.2);
    }
}

@keyframes insightsDrillOut {
    0% {
        opacity: 0;
        filter: blur(6px);
        transform: scale(0.72);
    }
    62% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1.018);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

.insights-skill-chord-canvas {
    min-height: 420px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(104, 104, 172, 0.12);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 247, 255, 0.72));
}

.insights-skill-chord-canvas svg {
    width: 100%;
    max-width: 820px;
    height: auto;
    display: block;
    transform-origin: var(--insights-drill-x, 50%) var(--insights-drill-y, 50%);
    will-change: transform, opacity, filter;
}

.insights-skill-chord-division-overlay {
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 2;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.insights-skill-chord-canvas svg.is-node-dividing .insights-skill-chord-edge {
    animation: insightsChordEdgeDivide 520ms cubic-bezier(.2, .86, .28, 1) both;
}

.insights-skill-chord-node.is-splitting-in,
.insights-skill-chord-node.is-split-moving,
.insights-skill-chord-node.is-splitting-out {
    transform-box: fill-box;
    transform-origin: center;
    will-change: transform, opacity, filter;
}

.insights-skill-chord-node.is-splitting-in {
    animation: insightsChordNodeDivideIn 560ms cubic-bezier(.16, .92, .28, 1) both;
}

.insights-skill-chord-node.is-split-moving {
    animation: insightsChordNodeDivideMove 500ms cubic-bezier(.2, .86, .28, 1) both;
}

.insights-skill-chord-node.is-splitting-out {
    animation: insightsChordNodeDivideOut 430ms cubic-bezier(.54, 0, .78, .18) both;
}

@keyframes insightsChordNodeDivideIn {
    0% {
        opacity: 0.08;
        filter: blur(5px);
        transform: translate(var(--chord-split-x, 0), var(--chord-split-y, 0)) scale(0.46);
    }
    62% {
        opacity: 1;
        filter: blur(0);
        transform: translate(0, 0) scale(1.08);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translate(0, 0) scale(1);
    }
}

@keyframes insightsChordNodeDivideMove {
    0% {
        opacity: 0.82;
        filter: blur(2px);
        transform: translate(var(--chord-split-x, 0), var(--chord-split-y, 0)) scale(0.92);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translate(0, 0) scale(1);
    }
}

@keyframes insightsChordNodeDivideOut {
    0% {
        opacity: 0.92;
        filter: blur(0);
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        filter: blur(5px);
        transform: translate(var(--chord-split-x, 0), var(--chord-split-y, 0)) scale(0.34);
    }
}

@keyframes insightsChordEdgeDivide {
    0% {
        opacity: 0;
        stroke-width: 0.45;
    }
    68% {
        opacity: 0.9;
        stroke-width: 1.35;
    }
    100% {
        opacity: 1;
        stroke-width: 1.15;
    }
}

.insights-skill-chord-orbit {
    display: none;
}

.insights-skill-chord-edge {
    fill: none;
    stroke: #6868AC;
    stroke-width: 1.15;
}

.insights-skill-chord-center circle {
    fill: rgba(255, 255, 255, 0.88);
    stroke: rgba(104, 104, 172, 0.18);
    stroke-width: 1.2;
}

.insights-skill-chord-center {
    cursor: pointer;
    outline: none;
}

.insights-skill-chord-center:focus-visible circle,
.insights-skill-chord-center:hover circle {
    fill: rgba(255, 255, 255, 0.96);
    stroke: rgba(250, 171, 29, 0.58);
}

.insights-skill-chord-center-value {
    fill: #5B3F6D;
    font-family: Kanit, sans-serif;
    font-size: 1.32rem;
    font-weight: 700;
    dominant-baseline: middle;
}

.insights-skill-chord-center-label-path {
    fill: none;
    stroke: none;
    pointer-events: none;
}

.insights-skill-chord-center-label {
    fill: rgba(91, 63, 109, 0.62);
    font-family: Kanit, sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0;
    pointer-events: none;
    dominant-baseline: middle;
}

.insights-skill-chord-center-back {
    fill: rgba(91, 63, 109, 0.78);
    font-family: Kanit, sans-serif;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0;
    pointer-events: none;
    dominant-baseline: middle;
}

.insights-skill-chord-node circle {
    stroke-width: 2.2;
    transition: filter 160ms ease, stroke 160ms ease, stroke-width 160ms ease, transform 160ms ease;
}

.insights-skill-chord-node.is-clickable {
    cursor: pointer;
    outline: none;
}

.insights-skill-chord-node.is-learned circle {
    fill: #6868AC;
    stroke: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 5px 10px rgba(104, 104, 172, 0.24));
}

.insights-skill-chord-node.is-partial circle {
    fill: #9B8CC0;
    stroke: rgba(250, 171, 29, 0.72);
    filter: drop-shadow(0 5px 10px rgba(104, 104, 172, 0.18));
}

.insights-skill-chord-node.is-missing circle {
    fill: #D5D1DA;
    stroke: rgba(255, 255, 255, 0.86);
}

.insights-skill-chord-node.is-clickable:hover circle,
.insights-skill-chord-node.is-clickable:focus-visible circle,
.insights-skill-chord-node.is-clickable.is-selected circle {
    stroke: rgba(250, 171, 29, 0.88);
    stroke-width: 3;
    filter: drop-shadow(0 8px 14px rgba(250, 171, 29, 0.24));
}

.insights-skill-chord-label {
    fill: #5B3F6D;
    font-family: Kanit, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
}

.insights-skill-chord-node.is-missing .insights-skill-chord-label {
    fill: #8f8797;
}

.insights-skill-chord-node.is-partial .insights-skill-chord-label {
    fill: #6d5680;
}

.insights-skill-chord-node.is-clickable:hover .insights-skill-chord-label,
.insights-skill-chord-node.is-clickable:focus-visible .insights-skill-chord-label,
.insights-skill-chord-node.is-clickable.is-selected .insights-skill-chord-label {
    fill: #4c3760;
}

.insights-skill-chord-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    color: rgba(91, 63, 109, 0.72);
    font-size: 0.82rem;
    font-weight: 500;
}

.insights-skill-chord-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.insights-skill-chord-legend i,
.insights-skill-chord-item-marker {
    width: 0.72rem;
    height: 0.72rem;
    flex: 0 0 auto;
    border-radius: 999px;
}

.insights-skill-chord-legend i.is-learned,
.insights-skill-chord-item.is-learned .insights-skill-chord-item-marker {
    background: #6868AC;
}

.insights-skill-chord-legend i.is-partial,
.insights-skill-chord-item.is-partial .insights-skill-chord-item-marker {
    background: #9B8CC0;
    box-shadow: inset 0 0 0 2px rgba(250, 171, 29, 0.75);
}

.insights-skill-chord-legend i.is-missing,
.insights-skill-chord-item.is-missing .insights-skill-chord-item-marker {
    background: #C7C2CC;
}

.insights-skill-chord-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.58rem;
}

.insights-skill-chord-item {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.78rem;
    border: 1px solid rgba(104, 104, 172, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    appearance: none;
    -webkit-appearance: none;
    color: #4c3760;
    font-family: Kanit, sans-serif;
    text-align: left;
}

.insights-skill-chord-item.is-clickable {
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.insights-skill-chord-item.is-clickable:hover,
.insights-skill-chord-item.is-clickable:focus-visible,
.insights-skill-chord-item.is-selected {
    border-color: rgba(250, 171, 29, 0.42);
    box-shadow: 0 10px 20px rgba(91, 63, 109, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.insights-skill-chord-item.is-missing {
    background: rgba(246, 245, 248, 0.72);
}

.insights-skill-chord-item.is-partial {
    background: rgba(250, 171, 29, 0.08);
}

.insights-skill-chord-item-body {
    min-width: 0;
    display: grid;
    gap: 0.14rem;
}

.insights-skill-chord-item-body strong {
    overflow: hidden;
    color: #4c3760;
    font-size: 0.88rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-skill-chord-item-body span {
    color: rgba(91, 63, 109, 0.58);
    font-size: 0.76rem;
    font-weight: 500;
}

.insights-skill-chord-status {
    justify-self: end;
    border-radius: 999px;
    padding: 0.3rem 0.56rem;
    background: rgba(104, 104, 172, 0.12);
    color: #5B3F6D;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.insights-skill-chord-item.is-missing .insights-skill-chord-status {
    background: rgba(143, 135, 151, 0.14);
    color: #77707d;
}

.insights-skill-chord-item.is-partial .insights-skill-chord-status {
    background: rgba(250, 171, 29, 0.16);
    color: #7d5b12;
}

.insights-career-panel {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.85rem;
    padding: clamp(1.1rem, 2.4vw, 1.6rem);
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px rgba(91, 63, 109, 0.08);
}

.insights-career-panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
}

.insights-career-title-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.insights-career-title-row .insights-action-button--career {
    min-width: 104px;
    padding-inline: 0.9rem;
}

.insights-career-menu {
    min-height: 64px;
    display: grid;
    gap: 0.58rem;
}

.insights-career-button {
    width: 100%;
    min-height: 62px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid rgba(104, 104, 172, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    color: #5B3F6D;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    line-height: 1.25;
    padding: 0.72rem 0.8rem;
    text-align: left;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.insights-career-button-detail {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.insights-career-button-detail strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
    font-weight: 700;
}

.insights-career-button-detail span {
    color: #746580;
    font-size: 0.78rem;
    font-weight: 500;
}

.insights-career-readiness {
    min-width: 70px;
    display: grid;
    justify-items: end;
    gap: 0.05rem;
    padding: 0.38rem 0.5rem;
    border: 1px solid rgba(250, 171, 29, 0.24);
    border-radius: 12px;
    background: rgba(255, 248, 233, 0.74);
    color: #7d5b12;
    line-height: 1;
}

.insights-career-readiness strong {
    color: #5B3F6D;
    font-size: 1rem;
    font-weight: 700;
}

.insights-career-readiness span {
    color: #8f7352;
    font-size: 0.66rem;
    font-weight: 600;
}

.insights-career-button:hover,
.insights-career-button:focus-visible {
    border-color: rgba(104, 104, 172, 0.34);
    background: #fff;
    box-shadow: 0 10px 20px rgba(91, 63, 109, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.insights-career-button.is-active {
    border-color: rgba(104, 104, 172, 0.45);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(242, 239, 255, 0.88));
    box-shadow: 0 12px 24px rgba(91, 63, 109, 0.12);
}

.insights-career-empty {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

.insights-view[hidden] {
    display: none !important;
}

.insights-plan-view {
    display: grid;
    gap: clamp(0.9rem, 2vw, 1.25rem);
}

.insights-plan-shell {
    display: grid;
    gap: clamp(0.95rem, 2vw, 1.25rem);
    padding: clamp(1.08rem, 2.4vw, 1.65rem);
}

.insights-plan-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.insights-plan-header h2 {
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

.insights-plan-header p:not(.insights-kicker) {
    max-width: 780px;
    margin-top: 0.32rem;
    font-size: 0.95rem;
}

.insights-plan-status {
    min-height: 1.35em;
    margin: 0;
    color: var(--text-light);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: right;
}

.insights-plan-status.is-loading::before {
    content: "";
    display: inline-block;
    width: 0.72em;
    height: 0.72em;
    margin-right: 0.42rem;
    border: 2px solid rgba(104, 104, 172, 0.22);
    border-top-color: #6868ac;
    border-radius: 999px;
    animation: spin 760ms linear infinite;
    vertical-align: -0.08em;
}

.insights-plan-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
    grid-template-areas:
        "priority course"
        "priority timeline";
    gap: clamp(0.82rem, 1.8vw, 1.1rem);
}

.insights-plan-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.86rem;
    padding: clamp(0.95rem, 2vw, 1.22rem);
    border: 1px solid rgba(104, 104, 172, 0.13);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.insights-plan-priority-card {
    grid-area: priority;
}

.insights-plan-course-card {
    grid-area: course;
}

.insights-plan-timeline-card {
    grid-area: timeline;
}

.insights-plan-card-header h3 {
    font-size: clamp(1rem, 1.8vw, 1.24rem);
}

.insights-plan-priority-list,
.insights-plan-course-focus,
.insights-plan-timeline {
    display: grid;
    gap: 0.65rem;
}

.insights-plan-priority-item {
    --insights-plan-priority-progress: 0%;
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 78px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.72rem;
    overflow: hidden;
    border: 1px solid rgba(104, 104, 172, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
    color: #4c3760;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    padding: 0.78rem 0.86rem;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.insights-plan-priority-item::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 4px;
    width: var(--insights-plan-priority-progress, 0%);
    background: linear-gradient(90deg, #FAAB1D, #2f9e9a);
    transform-origin: left center;
    animation: insightsMeterSweep 780ms cubic-bezier(.2, .8, .2, 1) both;
}

.insights-plan-priority-item:hover,
.insights-plan-priority-item:focus-visible {
    border-color: rgba(104, 104, 172, 0.36);
    box-shadow: 0 12px 24px rgba(91, 63, 109, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.insights-plan-rank {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(250, 171, 29, 0.16);
    color: #7d5b12;
    font-size: 0.92rem;
    font-weight: 800;
}

.insights-plan-priority-body {
    min-width: 0;
    display: grid;
    gap: 0.14rem;
}

.insights-plan-priority-body strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #4c3760;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.28;
}

.insights-plan-priority-body span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #746580;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
}

.insights-plan-priority-score {
    min-width: 3.25rem;
    justify-self: end;
    padding: 0.38rem 0.5rem;
    border: 1px solid rgba(47, 158, 154, 0.2);
    border-radius: 999px;
    background: rgba(241, 252, 250, 0.88);
    color: #2f706f;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.insights-plan-focus-item {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.72rem;
    padding: 0.82rem;
    border: 1px solid rgba(47, 158, 154, 0.14);
    border-radius: 14px;
    background: rgba(249, 253, 252, 0.82);
}

.insights-plan-focus-item strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #3f3150;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.28;
}

.insights-plan-focus-item p {
    margin-top: 0.16rem;
    font-size: 0.78rem;
}

.insights-plan-focus-action,
.insights-plan-inline-action {
    min-height: 2.28rem;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 999px;
    background: #fff;
    color: #5B3F6D;
    cursor: pointer;
    font: 800 0.78rem/1 Kanit, sans-serif;
    padding: 0.48rem 0.78rem;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.insights-plan-focus-action:hover,
.insights-plan-focus-action:focus-visible,
.insights-plan-inline-action:hover,
.insights-plan-inline-action:focus-visible {
    border-color: rgba(250, 171, 29, 0.48);
    background: rgba(255, 248, 233, 0.92);
    box-shadow: 0 8px 16px rgba(91, 63, 109, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.insights-plan-inline-action {
    justify-self: start;
}

.insights-plan-timeline {
    position: relative;
}

.insights-plan-timeline-item {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    padding: 0.2rem 0;
}

.insights-plan-timeline-marker {
    width: 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(104, 104, 172, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #746580;
    font-size: 0.8rem;
    font-weight: 800;
}

.insights-plan-timeline-item.is-done .insights-plan-timeline-marker {
    border-color: rgba(58, 143, 99, 0.26);
    background: rgba(58, 143, 99, 0.12);
    color: #2f734f;
}

.insights-plan-timeline-item.is-current .insights-plan-timeline-marker {
    border-color: rgba(250, 171, 29, 0.38);
    background: rgba(250, 171, 29, 0.16);
    color: #7d5b12;
    box-shadow: 0 0 0 4px rgba(250, 171, 29, 0.08);
}

.insights-plan-timeline-item strong {
    min-width: 0;
    color: #4c3760;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
}

.insights-gap-view {
    display: grid;
    gap: clamp(0.9rem, 2vw, 1.25rem);
}

.insights-gap-workspace {
    margin-top: 0;
}

.insights-gap-folder {
    position: relative;
    isolation: isolate;
    display: grid;
}

.insights-gap-select-wrap {
    display: none;
}

.insights-gap-tablist {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: -1px;
    padding: 0 0.9rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.insights-gap-tab {
    position: relative;
    min-width: min(280px, 58vw);
    max-width: 320px;
    display: grid;
    gap: 0.16rem;
    margin-left: -0.85rem;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 246, 255, 0.82)),
        linear-gradient(90deg, rgba(104, 104, 172, 0.08), rgba(250, 171, 29, 0.06));
    color: #5B3F6D;
    cursor: pointer;
    font-family: Kanit, sans-serif;
    padding: 0.84rem 1.05rem 0.74rem;
    text-align: left;
    transform: translateY(7px);
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.insights-gap-tab:first-child {
    margin-left: 0;
}

.insights-gap-tab strong {
    min-width: 0;
    overflow: hidden;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.24;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-gap-tab span {
    color: rgba(91, 63, 109, 0.62);
    font-size: 0.74rem;
    font-weight: 600;
}

.insights-gap-tab:hover,
.insights-gap-tab:focus-visible {
    border-color: rgba(104, 104, 172, 0.34);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 20px rgba(91, 63, 109, 0.08);
    outline: none;
    transform: translateY(3px);
}

.insights-gap-tab.is-active {
    z-index: 5;
    border-color: rgba(104, 104, 172, 0.24);
    background: #fff;
    box-shadow: 0 -8px 18px rgba(91, 63, 109, 0.06);
    transform: translateY(1px);
}

.insights-gap-tab.is-active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -3px;
    left: 0;
    height: 5px;
    background: #fff;
    pointer-events: none;
}

.insights-gap-sheet {
    position: relative;
    z-index: 2;
    display: grid;
    gap: clamp(1rem, 2vw, 1.35rem);
    padding: clamp(1rem, 2.2vw, 1.55rem);
    border: 1px solid rgba(104, 104, 172, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 38px rgba(91, 63, 109, 0.1);
}

.insights-gap-sheet::before,
.insights-gap-sheet::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border: 1px solid rgba(104, 104, 172, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
}

.insights-gap-sheet::before {
    z-index: -1;
    inset: 10px 14px -10px;
}

.insights-gap-sheet::after {
    z-index: -2;
    inset: 20px 28px -18px;
    background: rgba(248, 246, 255, 0.42);
}

.insights-gap-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.insights-gap-sheet-header .insights-kicker {
    margin-bottom: 0.22rem;
}

.insights-gap-sheet-header h2 {
    margin: 0;
    color: #5B3F6D;
    font-size: clamp(1.28rem, 2.4vw, 1.85rem);
    font-weight: 700;
    line-height: 1.18;
}

.insights-gap-sheet-header p:not(.insights-kicker) {
    max-width: 720px;
    margin: 0.38rem 0 0;
    color: rgba(76, 55, 96, 0.68);
    font-size: 0.94rem;
    line-height: 1.65;
}

.insights-gap-sheet-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
    gap: clamp(0.9rem, 2vw, 1.25rem);
    align-items: stretch;
}

.insights-gap-chart-card,
.insights-gap-missing-panel,
.insights-gap-course-panel {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.9rem;
    border: 1px solid rgba(104, 104, 172, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    padding: clamp(0.95rem, 2vw, 1.25rem);
}

.insights-gap-chart-card {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-height: 620px;
}

.insights-gap-missing-panel,
.insights-gap-course-panel {
    grid-column: 2;
}

.insights-gap-chart-frame {
    min-width: 0;
    display: grid;
    gap: 0.68rem;
}

.insights-gap-chart-tools {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.insights-gap-chart-title,
.insights-gap-missing-panel h3,
.insights-gap-course-panel h3 {
    margin: 0;
    color: #5B3F6D;
    font-size: clamp(1.08rem, 1.8vw, 1.32rem);
    font-weight: 700;
    line-height: 1.25;
}

.insights-gap-description {
    max-width: 760px;
    min-height: 0;
    margin: 0.38rem 0 0;
    color: rgba(91, 63, 109, 0.72);
    font-size: 0.9rem;
    line-height: 1.7;
}

.insights-gap-chart-frame .insights-gap-description {
    max-width: none;
    margin: 0;
}

.insights-gap-chart-tools .insights-gap-drillback {
    flex: 0 0 auto;
    margin-top: 0;
}

.insights-gap-chart {
    min-height: 500px;
}

.insights-gap-missing-panel,
.insights-gap-course-panel {
    gap: 1.2rem;
}

.insights-gap-detail-tab {
    display: none;
}

.insights-gap-course-section[hidden] {
    display: none !important;
}

.insights-gap-missing-panel .insights-kicker,
.insights-gap-course-panel .insights-kicker {
    margin-bottom: -0.45rem;
}

.insights-gap-missing-list,
.insights-gap-course-list {
    display: grid;
    gap: 0.55rem;
}

.insights-gap-missing-item {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid rgba(104, 104, 172, 0.14);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.82);
    color: #5B3F6D;
    font-family: Kanit, sans-serif;
    line-height: 1.25;
    padding: 0.72rem 0.78rem;
    text-align: left;
}

.insights-gap-missing-item {
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.insights-gap-missing-item:hover,
.insights-gap-missing-item:focus-visible,
.insights-gap-missing-item.is-selected {
    border-color: rgba(250, 171, 29, 0.42);
    box-shadow: 0 10px 20px rgba(91, 63, 109, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.insights-gap-missing-item.is-selected {
    background: rgba(250, 171, 29, 0.12);
}

.insights-gap-missing-body {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}

.insights-gap-missing-body strong {
    min-width: 0;
    overflow: hidden;
    color: #4c3760;
    font-size: 0.9rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-gap-missing-body span {
    color: rgba(91, 63, 109, 0.58);
    font-size: 0.76rem;
    font-weight: 600;
}

.insights-gap-missing-score {
    justify-self: end;
    border-radius: 999px;
    background: rgba(250, 171, 29, 0.14);
    color: #7d5b12;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.32rem 0.52rem;
    white-space: nowrap;
}

.insights-gap-advisory-note {
    margin: 0.18rem 0 0;
    border-left: 3px solid rgba(185, 52, 52, 0.42);
    border-radius: 8px;
    background: rgba(185, 52, 52, 0.06);
    color: #b93434;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.55;
    padding: 0.5rem 0.62rem;
}

.insights-gap-missing-empty,
.insights-gap-course-list p,
.insights-gap-empty p {
    margin: 0;
    color: rgba(91, 63, 109, 0.64);
    font-size: 0.9rem;
    line-height: 1.65;
}

.insights-gap-course-context {
    border-radius: 8px;
    background: rgba(104, 104, 172, 0.08);
    color: #5B3F6D !important;
    font-size: 0.78rem !important;
    font-weight: 700;
    padding: 0.5rem 0.62rem;
}

.insights-gap-course-empty.is-loading {
    color: #7d5b12;
}

.insights-gap-course-item {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
    overflow: hidden;
    border: 1px solid rgba(104, 104, 172, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.84);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.insights-gap-course-item.is-completed {
    background: rgba(104, 104, 172, 0.07);
}

.insights-gap-course-item:hover,
.insights-gap-course-item:focus-within,
.insights-gap-course-item.is-expanded {
    border-color: rgba(250, 171, 29, 0.34);
    box-shadow: 0 10px 20px rgba(91, 63, 109, 0.08);
}

.insights-gap-course-toggle {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 0.18rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-family: Kanit, sans-serif;
    padding: 0.72rem 0.78rem;
    text-align: left;
}

.insights-gap-course-toggle:focus-visible {
    outline: 2px solid rgba(250, 171, 29, 0.52);
    outline-offset: -2px;
}

.insights-gap-course-item-head {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.insights-gap-course-item-head > strong {
    min-width: 0;
    overflow: hidden;
    color: #4c3760;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.28;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-gap-course-plan-badge {
    flex: 0 0 auto;
    border: 1px solid rgba(104, 104, 172, 0.16);
    border-radius: 999px;
    background: rgba(104, 104, 172, 0.1);
    color: #5B3F6D;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.3rem 0.46rem;
    white-space: nowrap;
}

.insights-gap-course-plan-badge.is-planned {
    border-color: rgba(104, 104, 172, 0.22);
    background: rgba(104, 104, 172, 0.12);
    color: #4d438f;
}

.insights-gap-course-plan-badge.is-major_elective {
    border-color: rgba(250, 171, 29, 0.32);
    background: rgba(250, 171, 29, 0.16);
    color: #7d5b12;
}

.insights-gap-course-plan-badge.is-free_elective {
    border-color: rgba(32, 128, 118, 0.25);
    background: rgba(32, 128, 118, 0.12);
    color: #1f6e66;
}

.insights-gap-course-plan-badge.is-unknown {
    border-color: rgba(143, 135, 151, 0.24);
    background: rgba(143, 135, 151, 0.12);
    color: #6f6579;
}

.insights-gap-course-title-th {
    min-width: 0;
    overflow: hidden;
    color: rgba(91, 63, 109, 0.78);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-gap-course-faculty {
    min-width: 0;
    overflow: hidden;
    color: rgba(91, 63, 109, 0.56);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-gap-course-meta {
    color: rgba(91, 63, 109, 0.56);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.45;
}

.insights-gap-course-accordion {
    display: grid;
    gap: 0.72rem;
    border-top: 1px solid rgba(104, 104, 172, 0.12);
    background: rgba(248, 247, 255, 0.48);
    padding: 0.78rem;
}

.insights-gap-course-accordion[hidden] {
    display: none;
}

.insights-gap-course-detail-block {
    display: grid;
    gap: 0.38rem;
}

.insights-gap-course-detail-block > strong {
    color: #4c3760;
    font-size: 0.78rem;
    font-weight: 800;
}

.insights-gap-course-detail-block p,
.insights-gap-course-skill-empty {
    margin: 0;
    color: rgba(91, 63, 109, 0.68);
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.62;
}

.insights-gap-course-skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.insights-gap-course-skill-chip {
    min-width: 0;
    display: inline-grid;
    gap: 0.08rem;
    max-width: 100%;
    border: 1px solid rgba(104, 104, 172, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    padding: 0.42rem 0.5rem;
}

.insights-gap-course-skill-chip.is-already-earned {
    border-color: rgba(143, 135, 151, 0.22);
    background: rgba(246, 245, 248, 0.82);
}

.insights-gap-course-skill-chip.is-essential {
    border-color: rgba(250, 171, 29, 0.36);
    background: rgba(250, 171, 29, 0.1);
}

.insights-gap-course-skill-chip.is-optional {
    border-color: rgba(73, 141, 139, 0.28);
    background: rgba(73, 141, 139, 0.09);
}

.insights-gap-course-skill-chip.is-knowledge {
    box-shadow: inset 3px 0 0 rgba(91, 63, 109, 0.28);
}

.insights-gap-course-skill-chip.is-skill-competence {
    box-shadow: inset 3px 0 0 rgba(73, 141, 139, 0.32);
}

.insights-gap-course-skill-chip strong {
    min-width: 0;
    overflow: hidden;
    color: #5B3F6D;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-gap-course-skill-chip.is-already-earned strong {
    color: rgba(91, 63, 109, 0.72);
}

.insights-gap-course-skill-chip span {
    min-width: 0;
    overflow: hidden;
    color: rgba(91, 63, 109, 0.54);
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-gap-course-skill-chip em {
    min-width: 0;
    overflow: hidden;
    color: #7d5b12;
    font-size: 0.64rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insights-gap-empty {
    display: grid;
    justify-items: start;
    gap: 0.8rem;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    padding: clamp(1.1rem, 2.4vw, 1.6rem);
    box-shadow: 0 12px 28px rgba(91, 63, 109, 0.08);
}

.insights-gap-empty h2 {
    margin: 0;
    color: #5B3F6D;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    font-weight: 700;
}

.insights-curriculum-view {
    width: min(96vw, 1540px);
    margin: clamp(0.9rem, 2vw, 1.25rem) auto 0;
}

.insights-curriculum-shell {
    overflow: hidden;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px rgba(91, 63, 109, 0.08);
}

.insights-curriculum-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1rem, 2vw, 1.35rem) clamp(1.05rem, 2.2vw, 1.55rem);
    border-bottom: 1px solid rgba(104, 104, 172, 0.14);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 255, 0.86)),
        linear-gradient(90deg, rgba(104, 104, 172, 0.08), rgba(250, 171, 29, 0.08));
}

.insights-curriculum-header .insights-kicker {
    margin-bottom: 0.22rem;
}

.insights-curriculum-header h2 {
    margin: 0;
    color: #5B3F6D;
    font-size: clamp(1.3rem, 2.4vw, 1.85rem);
    font-weight: 600;
    line-height: 1.15;
}

.insights-curriculum-status {
    min-height: 1.3em;
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: right;
}

.insights-curriculum-status.is-error {
    color: #a13d3d;
}

.insights-curriculum-frame-wrap {
    position: relative;
    min-height: 720px;
    background: #FAF4E7;
}

.insights-curriculum-frame {
    width: 100%;
    height: max(720px, 78vh);
    min-height: 720px;
    display: block;
    border: 0;
    background: #FAF4E7;
    opacity: 0;
    overflow: hidden;
    transition: opacity 180ms ease;
}

.insights-curriculum-frame.is-loaded {
    opacity: 1;
}

@media (max-width: 1024px) and (orientation: portrait) {
    .insights-gap-select-wrap {
        position: relative;
        z-index: 3;
        display: grid;
        gap: 0.38rem;
        margin: 0 0 0.75rem;
        color: #5B3F6D;
        font-family: Kanit, sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
    }

    .insights-gap-select {
        width: 100%;
        min-height: 46px;
        border: 1px solid rgba(104, 104, 172, 0.2);
        border-radius: 14px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 246, 255, 0.86));
        color: #4c3760;
        font: 700 0.9rem/1.2 Kanit, sans-serif;
        padding: 0.64rem 2.25rem 0.64rem 0.78rem;
        box-shadow: 0 10px 20px rgba(91, 63, 109, 0.08);
    }

    .insights-gap-select:focus {
        border-color: rgba(250, 171, 29, 0.5);
        box-shadow: 0 0 0 3px rgba(250, 171, 29, 0.14);
        outline: none;
    }

    .insights-gap-tablist {
        display: none;
    }

    .insights-gap-sheet {
        border-radius: 18px;
    }
}

@media (max-width: 1024px) {
    .insights-topbar {
        width: min(94vw, 960px);
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "brand actions"
            "nav nav";
        gap: 0.65rem 0.9rem;
    }

    .insights-brand {
        grid-area: brand;
    }

    .insights-nav {
        grid-area: nav;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.65rem 0.45rem;
    }

    .insights-actions {
        grid-area: actions;
        justify-content: flex-end;
        overflow-x: auto;
        margin-left: 0;
        padding-bottom: 0.1rem;
    }

    .insights-back-row {
        width: max-content;
    }

    .insights-profilebar {
        width: min(94vw, 960px);
        grid-template-columns: 1fr;
    }

    .insights-profile-stats {
        display: flex;
        overflow-x: auto;
        padding-bottom: 0.12rem;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .insights-profile-stat {
        flex: 0 0 136px;
    }

    .insights-profile-stat--wide {
        flex-basis: 220px;
    }

    .insights-overview-dashboard {
        grid-template-columns: 1fr;
    }

    .insights-overview-snapshot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insights-plan-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "priority"
            "course"
            "timeline";
    }

    .insights-spider-layout {
        grid-template-columns: 1fr;
    }

    .insights-career-panel {
        padding: clamp(1rem, 2.8vw, 1.35rem);
    }

    .insights-career-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insights-skill-chord-list {
        grid-template-columns: 1fr;
    }

    .insights-gap-sheet-grid {
        grid-template-columns: 1fr;
    }

    .insights-gap-chart-card {
        grid-column: 1;
        grid-row: auto;
        min-height: 560px;
    }

    .insights-gap-missing-panel,
    .insights-gap-course-panel {
        grid-column: 1;
        align-items: start;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .insights-occupation-filter-disclosure {
        width: 100%;
        margin-top: 0.58rem;
        z-index: 30;
    }

    .insights-occupation-filter-toggle {
        width: 100%;
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.55rem;
        border: 1px solid rgba(104, 104, 172, 0.18);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.86);
        color: #5B3F6D;
        cursor: pointer;
        font: 700 0.84rem/1.15 Kanit, sans-serif;
        padding: 0.58rem 0.72rem;
        box-shadow: 0 8px 18px rgba(91, 63, 109, 0.06);
    }

    .insights-occupation-filter-toggle::after {
        content: "+";
        width: 1.28rem;
        height: 1.28rem;
        flex: 0 0 auto;
        display: inline-grid;
        place-items: center;
        border-radius: 999px;
        background: rgba(250, 171, 29, 0.16);
        color: #6b4e11;
        font-size: 1rem;
        line-height: 1;
    }

    .insights-occupation-filter-disclosure.is-open .insights-occupation-filter-toggle::after {
        content: "-";
    }

    .insights-occupation-filter-toggle:focus-visible {
        border-color: rgba(250, 171, 29, 0.52);
        outline: none;
        box-shadow: 0 0 0 3px rgba(250, 171, 29, 0.16);
    }

    .insights-occupation-filter-toggle-summary {
        overflow: hidden;
        color: rgba(91, 63, 109, 0.62);
        font-size: 0.7rem;
        font-weight: 600;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .insights-occupation-filter-panel {
        --filter-parallax-x: 0px;
        --filter-parallax-y: 0px;
        --filter-parallax-zoom: 1.08;
        position: absolute;
        top: calc(100% + 0.48rem);
        left: 0;
        right: 0;
        z-index: 40;
        display: grid;
        gap: 0.58rem;
        isolation: isolate;
        border: 1px solid rgba(104, 104, 172, 0.12);
        border-radius: 13px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(248, 247, 255, 0.12)),
            rgba(104, 104, 172, 0.08);
        box-shadow: 0 18px 42px rgba(76, 55, 96, 0.18);
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        padding: 0.62rem;
        transform: translateY(-6px) scale(0.985);
        transform-origin: top center;
        transition: opacity 160ms ease, transform 180ms cubic-bezier(.2, .86, .28, 1), visibility 160ms ease;
        visibility: hidden;
        -webkit-backdrop-filter: blur(3px) saturate(1.18);
        backdrop-filter: blur(3px) saturate(1.18);
    }

    .insights-occupation-filter-panel::before {
        content: "";
        position: absolute;
        inset: -30%;
        z-index: 0;
        pointer-events: none;
        transform: translate3d(var(--filter-parallax-x), var(--filter-parallax-y), 0) scale(var(--filter-parallax-zoom));
        transition: transform 180ms ease-out;
    }

    .insights-occupation-filter-disclosure.is-open .insights-occupation-filter-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
        visibility: visible;
    }

    .insights-occupation-filter-disclosure.is-open .insights-occupation-filter-panel::before {
        animation: insightsFilterParallaxZoom 5.8s ease-in-out infinite alternate;
    }

    .insights-occupation-filter-panel .insights-relation-filter {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.42rem;
    }

    .insights-occupation-filter-panel .insights-relation-filter legend {
        margin: 0;
    }

    .insights-occupation-filter-panel .insights-relation-filter-option {
        justify-content: flex-start;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.28);
        padding: 0.5rem 0.58rem;
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }

    .insights-gap-sheet {
        --insights-gap-mobile-viewport-height: 100vh;
        --insights-gap-mobile-panel-width: min(86vw, 380px);
        --insights-gap-mobile-panel-right: max(0.68rem, env(safe-area-inset-right));
        --insights-gap-mobile-panel-actual-width: min(var(--insights-gap-mobile-panel-width), calc(100vw - 3.25rem));
        --insights-gap-mobile-panel-border: rgba(104, 104, 172, 0.12);
        --insights-gap-mobile-panel-surface: #fbf9ff;
        --insights-gap-mobile-panel-glow: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0));
        --insights-gap-mobile-panel-shadow: 0 24px 56px rgba(76, 55, 96, 0.22);
        --insights-gap-tab-join-overlap: 1px;
        --filter-parallax-x: 0px;
        --filter-parallax-y: 0px;
        --filter-parallax-zoom: 1.08;
    }

    .insights-gap-detail-tab {
        --insights-gap-tab-translate-x: 0px;
        position: fixed;
        top: min(calc(var(--insights-gap-mobile-viewport-height) - 68px), var(--insights-gap-mobile-tab-start, calc(var(--insights-gap-mobile-panel-top, 86px) + 70px)));
        right: 0;
        z-index: 82;
        width: 42px;
        min-height: 126px;
        display: grid;
        place-items: center;
        gap: 0.3rem;
        border: 1px solid rgba(104, 104, 172, 0.14);
        border-right: 0;
        border-radius: 14px 0 0 14px;
        background: var(--insights-gap-mobile-panel-surface);
        color: #5B3F6D;
        cursor: pointer;
        font-family: Kanit, sans-serif;
        isolation: isolate;
        overflow: hidden;
        padding: 0.52rem 0.34rem;
        box-shadow: var(--insights-gap-mobile-panel-shadow);
        filter: none;
        opacity: 1;
        transform: translate3d(var(--insights-gap-tab-translate-x), -50%, 0);
        transition:
            background 160ms ease,
            border-color 160ms ease,
            opacity 180ms ease,
            transform 220ms cubic-bezier(.2, .86, .28, 1);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .insights-gap-detail-tab[hidden] {
        display: none !important;
    }

    .insights-gap-detail-tab::before {
        content: "";
        position: absolute;
        inset: -26%;
        z-index: 0;
        pointer-events: none;
        background: var(--insights-gap-mobile-panel-glow);
        opacity: 0.72;
        transform: translate3d(var(--filter-parallax-x), var(--filter-parallax-y), 0) scale(var(--filter-parallax-zoom));
        transition: transform 180ms ease-out;
    }

    .insights-gap-detail-tab span {
        position: relative;
        z-index: 1;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        color: inherit;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0;
        line-height: 1;
    }

    .insights-gap-detail-tab small {
        position: relative;
        z-index: 1;
        color: rgba(91, 63, 109, 0.64);
        font-size: 0.58rem;
        font-weight: 700;
        line-height: 1;
    }

    .insights-gap-detail-tab::after {
        content: "+";
        width: 1.24rem;
        height: 1.24rem;
        display: grid;
        place-items: center;
        position: relative;
        z-index: 1;
        border-radius: 999px;
        background: rgba(250, 171, 29, 0.18);
        color: #6b4e11;
        font-size: 1rem;
        font-weight: 800;
        line-height: 1;
    }

    .insights-gap-detail-tab[aria-expanded="true"] {
        border-color: var(--insights-gap-mobile-panel-border);
        background: var(--insights-gap-mobile-panel-surface);
    }

    .insights-gap-detail-tab[aria-expanded="true"]::after {
        content: "-";
    }

    .insights-gap-detail-tab:focus-visible {
        border-color: rgba(250, 171, 29, 0.52);
        outline: none;
        box-shadow: 0 0 0 3px rgba(250, 171, 29, 0.16), var(--insights-gap-mobile-panel-shadow);
    }

    .insights-gap-course-tab {
        top: min(calc(var(--insights-gap-mobile-viewport-height) - 60px), calc(var(--insights-gap-mobile-tab-start, calc(var(--insights-gap-mobile-panel-top, 86px) + 70px)) + 140px));
        min-height: 112px;
    }

    .insights-gap-sheet .insights-gap-mobile-panel {
        --filter-parallax-x: 0px;
        --filter-parallax-y: 0px;
        --filter-parallax-zoom: 1.08;
        position: fixed;
        top: var(--insights-gap-mobile-panel-top, max(86px, calc(env(safe-area-inset-top) + 72px)));
        right: var(--insights-gap-mobile-panel-right);
        z-index: 81;
        width: var(--insights-gap-mobile-panel-actual-width);
        height: auto;
        max-height: calc(var(--insights-gap-mobile-viewport-height) - var(--insights-gap-mobile-panel-top, 86px) - max(0.78rem, env(safe-area-inset-bottom)) - 0.8rem);
        max-width: var(--insights-gap-mobile-panel-actual-width);
        display: grid;
        grid-template-columns: 1fr;
        align-content: start;
        gap: 0.72rem;
        isolation: isolate;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-x: none;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--insights-gap-mobile-panel-border);
        border-radius: 16px;
        background: var(--insights-gap-mobile-panel-surface);
        box-shadow: var(--insights-gap-mobile-panel-shadow);
        opacity: 0;
        padding: 0.72rem;
        pointer-events: none;
        transform: translate3d(calc(100% + 1.2rem), 0, 0) scale(0.985);
        transform-origin: right center;
        transition: opacity 180ms ease, transform 220ms cubic-bezier(.2, .86, .28, 1), visibility 180ms ease;
        visibility: hidden;
        will-change: transform, opacity;
        contain: layout paint;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .insights-gap-sheet .insights-gap-mobile-panel::-webkit-scrollbar,
    .insights-gap-mobile-panel > .insights-gap-missing-list::-webkit-scrollbar,
    .insights-gap-mobile-panel > .insights-gap-course-list::-webkit-scrollbar {
        display: none;
    }

    .insights-gap-sheet .insights-gap-missing-panel {
        max-height: none;
        overflow: hidden;
    }

    .insights-gap-sheet .insights-gap-course-panel {
        min-width: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-x: none;
        touch-action: pan-y;
    }

    .insights-gap-sheet .insights-gap-course-panel * {
        max-width: 100%;
    }

    .insights-gap-mobile-panel::before {
        content: "";
        position: absolute;
        inset: -26%;
        z-index: 0;
        pointer-events: none;
        background: var(--insights-gap-mobile-panel-glow);
        opacity: 0.72;
        transform: translate3d(var(--filter-parallax-x), var(--filter-parallax-y), 0) scale(var(--filter-parallax-zoom));
        transition: transform 180ms ease-out;
    }

    .insights-gap-detail-tab::before,
    .insights-gap-mobile-panel::before {
        display: none;
    }

    .insights-gap-sheet.is-gap-detail-open .insights-gap-missing-panel,
    .insights-gap-sheet.is-gap-course-open .insights-gap-course-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translate3d(0, 0, 0) scale(1);
        visibility: visible;
    }

    .insights-gap-sheet.is-gap-detail-open .insights-gap-detail-tab:not(.insights-gap-course-tab),
    .insights-gap-sheet.is-gap-course-open .insights-gap-course-tab {
        --insights-gap-tab-translate-x: calc(var(--insights-gap-tab-join-overlap) - var(--insights-gap-mobile-panel-actual-width) - var(--insights-gap-mobile-panel-right));
        z-index: 83;
        border-color: var(--insights-gap-mobile-panel-border);
    }

    .insights-gap-sheet.is-gap-detail-open .insights-gap-course-tab,
    .insights-gap-sheet.is-gap-course-open .insights-gap-detail-tab:not(.insights-gap-course-tab) {
        --insights-gap-tab-translate-x: 0px;
        z-index: 80;
        filter: none;
        opacity: 0.48;
    }

    .insights-gap-mobile-panel > * {
        position: relative;
        z-index: 1;
    }

    .insights-gap-mobile-panel > .insights-gap-missing-list,
    .insights-gap-mobile-panel > .insights-gap-course-list,
    .insights-gap-mobile-panel > .insights-gap-advisory-note {
        min-width: 0;
        max-width: 100%;
        border: 1px solid rgba(104, 104, 172, 0.1);
        border-radius: 13px;
        background: rgba(255, 255, 255, 0.28);
        padding: 0.68rem;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

@supports (height: 100svh) {
    @media (max-width: 768px) and (orientation: portrait) {
        .insights-gap-sheet {
            --insights-gap-mobile-viewport-height: 100svh;
        }
    }
}

@keyframes insightsFilterParallaxZoom {
    0% {
        opacity: 0.56;
        transform: translate3d(calc(var(--filter-parallax-x) - 4px), calc(var(--filter-parallax-y) - 3px), 0) scale(calc(var(--filter-parallax-zoom) + 0.015));
    }
    100% {
        opacity: 0.82;
        transform: translate3d(calc(var(--filter-parallax-x) + 5px), calc(var(--filter-parallax-y) + 4px), 0) scale(calc(var(--filter-parallax-zoom) + 0.055));
    }
}

@media (prefers-reduced-motion: reduce) {
    .insights-overview-card,
    .insights-plan-shell,
    .insights-overview-metric i::after,
    .insights-overview-skill-row i::after,
    .insights-plan-priority-item::before,
    .insights-plan-status.is-loading::before,
    .insights-occupation-filter-disclosure.is-open .insights-occupation-filter-panel::before,
    .insights-gap-sheet.is-gap-detail-open .insights-gap-missing-panel::before,
    .insights-gap-sheet.is-gap-course-open .insights-gap-course-panel::before,
    .insights-gap-sheet.is-gap-detail-open .insights-gap-detail-tab:not(.insights-gap-course-tab)::before,
    .insights-gap-sheet.is-gap-course-open .insights-gap-course-tab::before {
        animation: none;
    }
}

@media (max-width: 576px) {
    .insights-topbar {
        width: calc(100% - 20px);
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand actions"
            "nav nav";
        align-items: center;
        gap: 0.55rem;
        padding: 0.65rem;
    }

    .insights-brand {
        justify-content: flex-start;
    }

    .insights-brand img {
        width: clamp(86px, 28vw, 108px);
    }

    .insights-nav {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.55rem 0.35rem;
    }

    .insights-nav-item,
    .insights-liquid-copy {
        min-height: 44px;
        border-radius: 16px;
        font-size: 0.88rem;
        padding: 0.62rem 0.74rem;
    }

    .insights-actions {
        justify-content: flex-end;
        overflow-x: auto;
        margin-left: 0;
        padding-bottom: 0.15rem;
    }

    .insights-action-button span:last-child {
        display: none;
    }

    .insights-action-button--career span:last-child {
        display: inline;
    }

    .insights-term-chip,
    .insights-action-button {
        min-height: 36px;
        font-size: 0.82rem;
        padding-block: 0.42rem;
    }

    .insights-action-button--career {
        min-width: 92px;
        padding-inline: 0.8rem;
    }

    .insights-action-button--icon {
        width: 36px;
    }

    .insights-title-row {
        display: block;
    }

    .insights-back-row {
        display: none;
    }

    .insights-modal-backdrop {
        place-items: center;
        align-content: center;
        padding: max(0.8rem, env(safe-area-inset-top, 0px)) 0.75rem max(0.8rem, env(safe-area-inset-bottom, 0px));
    }

    .insights-occupation-modal {
        width: 100%;
        max-height: calc(100dvh - 1.2rem);
        border-radius: 16px;
        padding: 0.95rem;
    }

    .insights-occupation-recommendations-list {
        grid-template-columns: 1fr;
    }

    .insights-occupation-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .insights-occupation-save {
        width: 100%;
    }

    .insights-profilebar,
    .insights-heading,
    .insights-workspace,
    .insights-curriculum-view {
        width: calc(100% - 24px);
    }

    .insights-profilebar {
        gap: 0.55rem;
        padding: 0.5rem;
    }

    .insights-profile-identity {
        padding: 0.5rem;
    }

    .insights-profile-avatar {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .insights-profile-nameblock strong {
        font-size: 0.95rem;
    }

    .insights-profile-stats {
        display: none;
    }

    .insights-profile-stat {
        flex-basis: 124px;
        padding: 0.42rem 0.52rem;
    }

    .insights-profile-stat--wide {
        flex-basis: 190px;
    }

    .insights-overview-dashboard,
    .insights-plan-grid {
        gap: 0.72rem;
    }

    .insights-overview-card,
    .insights-plan-shell,
    .insights-plan-card {
        border-radius: 14px;
    }

    .insights-overview-card,
    .insights-plan-shell {
        padding: 0.86rem;
    }

    .insights-overview-snapshot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .insights-overview-metric {
        min-height: 118px;
        border-radius: 11px;
        padding: 0.72rem;
    }

    .insights-overview-metric strong {
        font-size: clamp(0.92rem, 4.8vw, 1.16rem);
    }

    .insights-overview-highlight,
    .insights-overview-skill-map,
    .insights-plan-priority-item,
    .insights-plan-focus-item {
        border-radius: 12px;
    }

    .insights-overview-skill-row span {
        white-space: normal;
    }

    .insights-plan-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.38rem;
    }

    .insights-plan-status {
        text-align: left;
    }

    .insights-plan-priority-item {
        min-height: 72px;
        grid-template-columns: auto minmax(0, 1fr);
        padding: 0.7rem;
    }

    .insights-plan-priority-score {
        grid-column: 2;
        justify-self: start;
    }

    .insights-plan-focus-item {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .insights-plan-focus-action {
        justify-self: start;
    }

    .insights-spider-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .insights-spider-description.is-mobile-chart-caption {
        max-width: none;
        min-height: 0;
        margin: -0.08rem 0 0;
        padding-left: clamp(2.65rem, 11vw, 3.25rem);
        font-size: 0.82rem;
        line-height: 1.62;
    }

    .insights-spider-description.is-mobile-chart-caption::before {
        width: clamp(2.1rem, 9vw, 2.75rem);
    }

    .insights-spider-status {
        min-height: 1.2em;
        text-align: left;
    }

    .insights-spider-chart {
        height: clamp(380px, 95vw, 520px);
        min-height: 380px;
    }

    .insights-spider-chart.is-chord {
        height: auto;
        min-height: 0;
    }

    .insights-skill-chord-canvas {
        min-height: 300px;
    }

    .insights-skill-chord-label {
        font-size: 0.64rem;
    }

    .insights-spider-graph,
    .insights-career-panel {
        border-radius: 14px;
        padding: 0.95rem;
    }

    .insights-career-menu {
        grid-template-columns: 1fr;
    }

    .insights-career-button {
        min-height: 54px;
        border-radius: 12px;
        padding: 0.64rem 0.72rem;
    }

    .insights-career-readiness {
        min-width: 62px;
        padding: 0.34rem 0.42rem;
    }

    .insights-career-readiness strong {
        font-size: 0.92rem;
    }

    .insights-career-readiness span {
        font-size: 0.6rem;
    }

    .insights-gap-folder {
        grid-template-columns: 1fr;
    }

    .insights-gap-tablist {
        margin: 0 0 -1px;
        padding: 0 0.42rem;
    }

    .insights-gap-tab {
        margin-top: -0.42rem;
        border-radius: 14px 14px 0 0;
        padding: 0.62rem 0.64rem;
        transform: translateY(5px);
    }

    .insights-gap-tab strong {
        font-size: 0.78rem;
        line-height: 1.28;
    }

    .insights-gap-tab span {
        font-size: 0.64rem;
    }

    .insights-gap-tab:hover,
    .insights-gap-tab:focus-visible {
        transform: translateY(3px);
    }

    .insights-gap-tab.is-active {
        transform: translateY(1px);
    }

    .insights-gap-sheet {
        border-radius: 15px;
        padding: 0.9rem;
    }

    .insights-gap-sheet::before,
    .insights-gap-sheet::after {
        display: none;
    }

    .insights-gap-sheet-header {
        flex-direction: column;
        gap: 0.65rem;
    }

    .insights-gap-chart-card,
    .insights-gap-missing-panel,
    .insights-gap-course-panel {
        border-radius: 14px;
        padding: 0.85rem;
    }

    .insights-gap-chart-card {
        min-height: 500px;
    }

    .insights-gap-chart-tools {
        flex-direction: column;
        gap: 0.58rem;
    }

    .insights-gap-chart {
        min-height: 420px;
    }

    .insights-gap-missing-panel,
    .insights-gap-course-panel {
        grid-template-columns: 1fr;
    }

    .insights-curriculum-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
        padding: 0.95rem;
    }

    .insights-curriculum-status {
        text-align: left;
    }

    .insights-curriculum-shell {
        border-radius: 14px;
    }

    .insights-curriculum-frame {
        height: 76dvh;
        min-height: 620px;
    }
}

@media (max-width: 380px) {
    .insights-topbar {
        width: calc(100% - 14px);
        padding: 0.55rem;
    }

    .insights-profilebar {
        width: calc(100% - 14px);
    }

    .insights-brand img {
        width: 82px;
    }

    .insights-nav {
        gap: 0.28rem;
        padding-inline: 0.28rem;
    }

    .insights-nav-item,
    .insights-liquid-copy {
        min-height: 42px;
        font-size: 0.84rem;
        padding: 0.56rem 0.64rem;
    }

    .insights-skill-chord-canvas {
        min-height: 260px;
    }

    .insights-gap-chart-card {
        min-height: 460px;
    }

    .insights-gap-chart {
        min-height: 390px;
    }

    .insights-term-chip {
        font-size: 0.78rem;
        padding-inline: 0.55rem;
    }

    .insights-profile-stat {
        flex-basis: 116px;
    }

    .insights-profile-stat--wide {
        flex-basis: 176px;
    }
}

/* กระพริบ LIKE ช่วงครึ่งแรก */
@keyframes hintLike {

    0%,
    15%,
    100% {
        opacity: 0;
    }

    16%,
    32% {
        opacity: .9;
    }

    33% {
        opacity: 0;
    }
}

/* กระพริบ PASS ช่วงครึ่งหลัง */
@keyframes hintDislike {

    0%,
    55%,
    100% {
        opacity: 0;
    }

    56%,
    72% {
        opacity: .9;
    }

    73% {
        opacity: 0;
    }
}

.course-card.hint .like-indicator {
    animation: hintLike 1.6s ease-in-out .6s 1 both;
}

.course-card.hint .dislike-indicator {
    animation: hintDislike 1.6s ease-in-out .6s 1 both;
}

/* เคารพการตั้งค่า reduce motion */
@media (prefers-reduced-motion: reduce) {

    .course-card.hint,
    .course-card.hint .like-indicator,
    .course-card.hint .dislike-indicator {
        animation: none !important;
    }
}

/* ครอบทั้งใบเพื่อจัดกลาง */
.course-card .action-indicators {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

/* สไตล์ตราประทับ */
.course-card .like-indicator,
.course-card .dislike-indicator {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%) rotate(-12deg) scale(1);
    padding: 10px 18px;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    border: 6px solid;
    border-radius: 8px;
    mix-blend-mode: multiply;
    opacity: 0;
    transition: opacity .1s linear, transform .1s linear;
    z-index: 10;
    /* กันโดนปกหัวการ์ด */
    text-align: center;
}

.course-card .like-indicator {
    color: #2e7d32;
    border-color: #2e7d32;
}

.course-card .dislike-indicator {
    color: #c62828;
    border-color: #c62828;
    transform: translate(-50%, -50%) rotate(12deg) scale(1);
}

/* เผื่อผู้ใช้เปิด reduce motion */
@media (prefers-reduced-motion: reduce) {

    .course-card .like-indicator,
    .course-card .dislike-indicator {
        transition: none;
    }
}

.speech-bubble {
    padding: 10px;
    background: #EEEEEE;
    color: #000;
    position: relative;
    box-shadow: rgba(0, 0, 0, 0.5) 0 3px 5px -3px;
    margin: 20px 0;
    z-index: 9999;
}

.speech-bubble:after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    position: absolute;
    top: 0px;
    border-color: #BBB;
    z-index: 9999;
}

.speech-bubble.speech-bubble-bottom-left {
    margin-bottom: 40px;
    border-radius: 10px;
    z-index: 9999;
}

.speech-bubble.speech-bubble-bottom-left:after {
    border-width: 0 0 20px 24px;
    /* 20px * 1.2 = 24px */
    border-top-color: transparent !important;
    border-right-color: transparent !important;
    border-bottom-color: transparent !important;
    top: auto;
    left: 20px;
    bottom: -20px;
    z-index: 9999;

}

.login-container {
    display: block;
    justify-items: center;
    line-height: 3em;
    text-align: center;
    align-items: center;
    background-color: transparent;
    text-decoration: none;
    margin-bottom: 1em;
    margin-top: 1em;
    font-size: 1rem;
}

.admin-switch-card {
    width: min(540px, 100%);
    margin: 0.25rem auto 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(104, 104, 172, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
}

.admin-switch-label {
    display: block;
    margin-bottom: 0.45rem;
    line-height: 1.4;
    text-align: left;
    color: #5B3F6D;
    font-size: 0.95rem;
    font-weight: 600;
}

.admin-switch-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-switch-input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0.65rem 0.8rem;
    border: 1px solid #cfc8da;
    border-radius: 10px;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    color: #2f2f48;
    background: #fff;
}

.admin-switch-input:focus {
    outline: none;
    border-color: #6868ac;
    box-shadow: 0 0 0 3px rgba(104, 104, 172, 0.15);
}

.admin-switch-btn {
    min-height: 44px;
    min-width: 132px;
    line-height: 1.2;
}

.admin-switch-status {
    min-height: 1.2rem;
    margin: 0.45rem 0 0;
    line-height: 1.2;
    text-align: left;
    font-size: 0.88rem;
    color: #5f5f75;
}

.admin-switch-status--success {
    color: #198754;
}

.admin-switch-status--error {
    color: #DC3545;
}

@media (max-width: 768px) {
    .admin-switch-row {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-switch-btn {
        width: 100%;
    }
}

.newregcolor {
    color: #5B3F6D !important;
}

.reg-logo {
    text-align: center;
}

.reg-logo img {
    width: 50%
}

.qa-wrap {
    font-family: 'Kanit', sans-serif;
    color: #5B3F6D;
    line-height: 1.45;
    width: 80vw
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    /* จัดข้อความให้อยู่กลาง */
    width: 100%;
    /* กินเต็มความกว้าง */
    color: #666;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    /* ขยายเต็มด้านซ้าย/ขวา */
    border-bottom: 1px solid #ccc;
}

.divider::before {
    margin-right: 0.75em;
}

.divider::after {
    margin-left: 0.75em;
}

.qa-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px
}

.qa-title {
    font-weight: 700
}

.pill {
    background: #6868ac;
    color: white;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 15px
}

.muted {
    color: #6b7280;
    font-size: 12px
}

.row {
    margin: 10px 0
}

.filter {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    outline: none
}

.filter:focus {
    border-color: #faac1e;
    box-shadow: 0 0 0 3px rgba(250, 172, 30, .15)
}

.topic-box {
    max-height: 260px;
    overflow: auto;
    border: 1px solid #9E76B3;
    border-radius: 12px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px
}

.match-treshold-parent {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    width: min(960px, 100%);
    max-width: 100%;
    margin: 0.35rem auto 0.9rem;
    padding: 0.95rem 1rem;
    box-sizing: border-box;
    border: 1px solid rgba(104, 104, 172, 0.18);
    border-radius: 14px;
    background: linear-gradient(180deg, #f8f8ff 0%, #ffffff 100%);
    box-shadow: 0 8px 20px rgba(104, 104, 172, 0.08);
}

.match-treshold-parent label h1 {
    margin: 0;
    color: #5B3F6D;
    font-size: 1.15rem;
    line-height: 1.35;
}

.match-treshold-parent output {
    min-width: 3.25rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(104, 104, 172, 0.24);
    background: #fff;
    color: #5B3F6D;
    font-family: 'Kanit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0 0.7rem;
    box-shadow: inset 0 1px 2px rgba(104, 104, 172, 0.08);
}

#tresholdValueDescription {
    color: #5f5f75;
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
}

.sankey-simple-mode-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: min(960px, 100%);
    max-width: 100%;
    box-sizing: border-box;
    margin: 1em auto 0.75rem;
}

.sankey-mode-toggle {
    position: relative;
    width: min(430px, 100%);
    min-height: 48px;
    padding: 4px;
    border: 1px solid #d6d7e6;
    border-radius: 999px;
    background: linear-gradient(180deg, #f8f8fc 0%, #eceef9 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
}

.sankey-mode-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(104, 104, 172, 0.2);
}

.sankey-mode-label {
    position: relative;
    z-index: 2;
    text-align: center;
    font-family: 'Kanit', sans-serif;
    font-size: 0.93rem;
    font-weight: 600;
    user-select: none;
    transition: color 0.2s ease;
}

.sankey-mode-toggle .sankey-mode-label--simple {
    color: #7f8096;
}

.sankey-mode-toggle .sankey-mode-label--detailed {
    color: #ffffff;
}

.sankey-mode-toggle.is-simple .sankey-mode-label--simple {
    color: #ffffff;
}

.sankey-mode-toggle.is-simple .sankey-mode-label--detailed {
    color: #7f8096;
}

.sankey-mode-thumb {
    position: absolute;
    top: 4px;
    left: calc(50% + 2px);
    width: calc(50% - 6px);
    height: calc(100% - 8px);
    border-radius: 999px;
    background: linear-gradient(135deg, #6868ac 0%, #7f6fb9 100%);
    box-shadow: 0 4px 10px rgba(87, 77, 133, 0.22);
    transition: left 0.22s ease;
}

.sankey-mode-toggle.is-simple .sankey-mode-thumb {
    left: 4px;
}

.sankey-mode-toggle:active .sankey-mode-thumb {
    filter: brightness(0.96);
}

.sankey-simple-mode-note {
    color: #5f5f75;
    font-size: 0.9rem;
    line-height: 1.3;
}

.sankey-top-limit-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
}

.sankey-top-limit-btn {
    border: 1px solid #b9b6d9;
    background: #fff;
    color: #5B3F6D;
    border-radius: 999px;
    padding: 0.28rem 0.78rem;
    font-family: 'Kanit', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.sankey-top-limit-btn.is-on {
    border-color: #faac1e;
    background: #fff8e9;
    color: #a05b00;
}

.sankey-top-limit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.skill-mapping-focus-controls {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(104, 104, 172, 0.25);
}

.skill-mapping-focus-status {
    flex: 1 1 auto;
    color: #5B3F6D;
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
    line-height: 1.35;
    word-break: break-word;
}

.skill-mapping-focus-actions {
    flex: 0 0 auto;
}

#skillMappingBackButton.skill-mapping-back-button-inline {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    margin: 0 !important;
    white-space: nowrap;
}

.chk {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #efefff;
    border: 1px solid #9E76B3;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    user-select: none
}

.chk:hover {
    border-color: #5B3F6D
}

.chk input {
    flex: 0 0 auto;
}

.chk input[type="checkbox"] {
    accent-color: var(--topic-accent);
    width: 14px;
    height: 14px;
    /* ปรับขนาดตามชอบ */
}

.chk input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(250, 172, 30, .25);
    /* วงโฟกัสสีเดียวกัน */
    border-radius: 4px;
    /* ให้เงาโฟกัสดูโค้งนิดนึง */
}

.k {
    font-family: 'Kanit', sans-serif;
    ;
    font-size: 12px
}

.cnt {
    margin-left: auto;
    color: #6b7280;
    font-size: 12px
}

.note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px
}

.error {
    color: #b91c1c
}

.q-row {
    display: flex;
    gap: 8px;
    align-items: center
}

.q-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    font-family: inherit
}

.q-input:focus {
    border-color: #faac1e;
    box-shadow: 0 0 0 3px rgba(250, 172, 30, .15)
}

.btn {
    background: #6868ac;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: transform .03s ease;
    text-decoration: none;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed
}

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

.shake {
    animation: shake .2s linear 1
}

.topic-box::-webkit-scrollbar {
    width: 12px;
    /* Width of the scrollbar */
}

.answerQA {
    display: none;
    border: 1px solid #e5e7eb;
    padding: 3em;
    border-radius: 10px;
    background-color: #FAF4E7;
}

.questionQA {
    display: none;
    border: 1px solid #e5e7eb;
    padding: 1em;
    margin-top: 1em;
    border-radius: 10px;
    background-color: #e8e8ff;
    font-size: 2rem;
    font-weight: 600;
}

.askAgain {
    display: none;
    margin-top: 1em;
    text-align: center;
    margin-bottom: 2em;
}

.instruction ul ul {
    margin-left: 20px;
    /* ระยะ indent */
    list-style-type: circle;
    /* bullet เป็นวงกลม */
}

.topic-box::-webkit-scrollbar-track {
    background: var(--gray-200);
    /* Track color */
    border-radius: 8px;
}

.topic-box::-webkit-scrollbar-thumb {
    background: var(--primary);
    /* Thumb color */
    border-radius: 8px;
    border: 3px solid var(--gray-200);
    /* Adds padding around the thumb */
}

.topic-box::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
    /* Thumb hover color */
}

@keyframes shake {
    0% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-2px)
    }

    50% {
        transform: translateX(2px)
    }

    75% {
        transform: translateX(-2px)
    }

    100% {
        transform: translateX(0)
    }
}

.match-treshold-range {
    width: min(560px, 100%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    height: 2.6rem;
    margin: 0;
    padding: 0;
    accent-color: #6868ac;
}

.match-treshold-range:focus {
    outline: none;
}

/* Chromium/Safari/Opera */
.match-treshold-range::-webkit-slider-runnable-track {
    height: 14px;
    border-radius: 999px;
    border: 1px solid #c9cbe3;
    background: linear-gradient(90deg, #d7d7ff 0%, #efe7ff 50%, #ffe8bf 100%);
    box-shadow: inset 0 1px 3px rgba(76, 77, 113, 0.16);
}

.match-treshold-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    margin-top: -8px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: linear-gradient(145deg, #faac1e 0%, #f07c00 100%);
    box-shadow: 0 3px 8px rgba(240, 124, 0, 0.35), 0 0 0 1px rgba(85, 63, 109, 0.18);
}

.match-treshold-range:hover::-webkit-slider-thumb {
    transform: scale(1.06);
}

.match-treshold-range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 5px rgba(250, 172, 30, 0.24), 0 3px 8px rgba(240, 124, 0, 0.35);
}

/* Firefox */
.match-treshold-range::-moz-range-track {
    height: 14px;
    border-radius: 999px;
    border: 1px solid #c9cbe3;
    background: linear-gradient(90deg, #d7d7ff 0%, #efe7ff 50%, #ffe8bf 100%);
    box-shadow: inset 0 1px 3px rgba(76, 77, 113, 0.16);
}

.match-treshold-range::-moz-range-progress {
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(104, 104, 172, 0.45) 0%, rgba(250, 172, 30, 0.5) 100%);
}

.match-treshold-range::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: linear-gradient(145deg, #faac1e 0%, #f07c00 100%);
    box-shadow: 0 3px 8px rgba(240, 124, 0, 0.35), 0 0 0 1px rgba(85, 63, 109, 0.18);
}

.match-treshold-range:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 5px rgba(250, 172, 30, 0.24), 0 3px 8px rgba(240, 124, 0, 0.35);
}

/* Legacy Edge/IE */
.match-treshold-range::-ms-track {
    height: 14px;
    border-radius: 999px;
    background: transparent;
    border-color: transparent;
    color: transparent;
}

.match-treshold-range::-ms-fill-lower {
    border-radius: 999px;
    border: 1px solid #c9cbe3;
    background: rgba(104, 104, 172, 0.35);
}

.match-treshold-range::-ms-fill-upper {
    border-radius: 999px;
    border: 1px solid #c9cbe3;
    background: rgba(250, 172, 30, 0.3);
}

.match-treshold-range::-ms-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #faac1e;
    box-shadow: 0 3px 8px rgba(240, 124, 0, 0.35), 0 0 0 1px rgba(85, 63, 109, 0.18);
    margin-top: 0;
}

.match-treshold-range::-ms-tooltip {
    display: none;
}






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

    .match-treshold-parent {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }

    .sankey-simple-mode-wrap {
        width: 100%;
        max-width: 100%;
    }

    .match-treshold-range {
        width: 72%;
    }

    .modal-container {
        max-width: 95vw;
        max-height: 95vh;
    }

    .container {
        max-width: 100vw;
    }

    .bottom-svg-container {
        margin-bottom: 2rem;
        top: -4rem;
    }

    .tab-content {
        padding: 1rem;
    }

    .top-svg,
    .bottom-svg {
        max-width: 70%;
    }

    .main-menu-back-button {
        max-width: calc(100vw - 28px);
        font-size: 0.88rem;
        padding: 0.5rem 0.9rem;
    }
}

@media (max-width: 992px) {
    .tab-content {
        padding: 1rem;
    }

    .modal-content {
        padding: 0;
    }

    .course-card {
        max-width: 40vw;
    }

    .top-svg,
    .bottom-svg {
        max-width: 70%;
    }

    .bottom-svg-container {
        margin-bottom: 2rem;
        top: -2rem;
        /* Less margin on smaller screens */
    }

    .modal-container {
        width: 100vw;
        height: 95vh;
    }

    .chart-col {
        min-height: 400px;
    }
}

@media (max-width: 768px) {

    /*Mobile*/
    .image-display.fade-in-delay {
        display: none;
    }

    .mobile-ai-disclaimer {
        display: block;
    }

    .qa-head {
        display: flex;
        align-items: end;
        flex-direction: column;
    }

    .warning-text {
        line-height: 1.2em;
    }

    .occupation-mapping-container {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .occupation-mapping-form {
        width: 80%;
    }

    .list-group {
        width: 60vw;
    }

    .match-treshold-parent {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }

    .sankey-simple-mode-wrap {
        width: 100%;
        max-width: 100%;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0 0.75rem;
    }

    .sankey-mode-toggle {
        width: 100%;
    }

    .sankey-top-limit-wrap {
        width: 100%;
        justify-content: center;
    }

    .match-treshold-range {
        width: 92%;
    }

    .skill-mapping-focus-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .skill-mapping-focus-actions {
        width: 100%;
    }

    #skillMappingBackButton.skill-mapping-back-button-inline {
        width: 100%;
    }

    .main-menu-back-button {
        left: auto;
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        max-width: calc(100vw - 20px);
        padding: 0.48rem 0.78rem;
        font-size: 0.84rem;
    }

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

    .header h1 {
        font-size: 2rem;
    }

    .selector-btn {
        min-width: 150px;
        padding: 12px 20px;
    }

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

    .course-details {
        flex-direction: column;
        align-items: flex-start;
    }

    .courses-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .course-header {
        flex-direction: column;
        text-align: center;
    }

    .course-card {
        max-width: 100%;
    }

    .course-icon {
        width: 100%;
        margin-bottom: 0.4em;
    }

    .tab-content {
        padding: 1rem;
    }

    .parallax-section {
        height: 50vh;
    }

    .top-svg,
    .bottom-svg {
        max-width: 100%;

    }

    .container {
        margin-top: -40vh;
        /* Adjusted for smaller screens */
        padding-top: 0.5rem;
    }

    .bottom-svg-container {
        margin-bottom: 2rem;
        top: -2rem;
        /* Less margin on smaller screens */
    }

    .content-wrapper {
        padding: 3em;
        flex-direction: column;
    }

    .modal-container {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        margin: 0;
    }

    .modal-content {
        padding: 0rem;
        overflow-y: auto;
        padding-top: 1rem;
    }

    .chart-row {
        flex-direction: column;
    }

    .chart-col {
        flex: 1 1 100%;
        min-height: 350px;
    }
}


@media (max-width: 576px) {
    .tab-content {
        padding: 0.3rem;
    }

    .content-wrapper {
        padding: 0;
    }

    .course-icon {
        width: 8.8rem;
        margin-bottom: 0.4em;
    }

    .top-svg,
    .bottom-svg {
        max-width: 100%;
    }

    .container {
        margin-top: -38vh;
        max-width: 85vw;
    }
}

@media (max-width: 480px) {
    .tab-content {
        padding: 1rem;
    }

    .top-svg,
    .bottom-svg {
        max-width: 100%;
    }

    .container {
        margin-top: -35vh;
        padding-right: 0;
        padding-left: 0;
        max-width: 90vw;
        /* Wider container on mobile */
        padding-top: 0;
    }

    .bottom-svg-container {
        margin-bottom: 1.5rem;
        top: -4rem;
        /* Even less margin on mobile */
    }
}
