:root {
    --learn-ink: #102a2b;
    --learn-teal: #0f766e;
    --learn-teal-dark: #0b5d56;
    --learn-lime: #d9f99d;
    --learn-amber: #f59e0b;
    --learn-coral: #f97316;
    --learn-sky: #0ea5e9;
}

.learning-progress-rail {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    height: 5px;
    background: rgba(255, 255, 255, 0.65);
    pointer-events: none;
}

.learning-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(90deg, var(--learn-teal), var(--learn-sky), var(--learn-coral));
    box-shadow: 0 0 18px rgba(14, 165, 233, 0.38);
    transition: width 0.12s linear;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 1100;
    padding: 10px 16px;
    border-radius: 999px;
    color: #fff;
    background: #0f172a;
    font-weight: 800;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.18s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.75);
    outline-offset: 3px;
}

.learning-journey {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: 24px;
    align-items: stretch;
}

.journey-overview {
    position: relative;
    padding: 26px;
    border-radius: 28px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(217, 249, 157, 0.26), transparent 30%),
        linear-gradient(145deg, #092f2d, #0f766e 66%, #0d9488);
    box-shadow: 0 24px 54px -36px rgba(15, 118, 110, 0.78);
}

.journey-overview::after {
    content: "";
    position: absolute;
    right: -56px;
    bottom: -86px;
    width: 210px;
    aspect-ratio: 1;
    border: 32px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.journey-overview > * {
    position: relative;
    z-index: 1;
}

.journey-overview h3 {
    margin: 14px 0 8px;
    font-family: 'Kanit', sans-serif;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1.18;
}

.journey-overview p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.75;
}

.journey-score {
    display: flex;
    align-items: end;
    gap: 8px;
    margin-top: 22px;
}

.journey-score strong {
    font-family: 'Kanit', sans-serif;
    font-size: clamp(3rem, 7vw, 5.2rem);
    line-height: 0.86;
}

.journey-score span {
    padding-bottom: 5px;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 700;
}

.journey-meter {
    height: 10px;
    margin: 18px 0 22px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.journey-meter > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #fef08a, var(--learn-lime));
    transition: width 0.45s ease;
}

.journey-list {
    display: grid;
    gap: 12px;
}

.journey-step-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.journey-step-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.3);
    box-shadow: 0 18px 36px -30px rgba(15, 23, 42, 0.5);
}

.journey-step-card[data-done="true"] {
    border-color: rgba(15, 118, 110, 0.28);
    background: linear-gradient(100deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.86));
}

.journey-index {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--learn-teal);
    background: rgba(15, 118, 110, 0.1);
    font-family: 'Kanit', sans-serif;
    font-size: 1.02rem;
    font-weight: 800;
}

.journey-step-card[data-done="true"] .journey-index {
    color: #fff;
    background: var(--learn-teal);
}

.journey-copy strong,
.journey-copy span {
    display: block;
}

.journey-copy strong {
    color: var(--learn-ink);
    font-family: 'Kanit', sans-serif;
    font-size: 1.05rem;
}

.journey-copy span {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
}

.journey-state {
    padding: 7px 10px;
    border-radius: 999px;
    color: #64748b;
    background: #f1f5f9;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.journey-step-card[data-done="true"] .journey-state {
    color: #0f766e;
    background: #ccfbf1;
}

.challenge-shell {
    display: grid;
    grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.28fr);
    gap: 22px;
}

.challenge-intro {
    position: relative;
    padding: 24px;
    overflow: hidden;
    border-radius: 26px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 12%, rgba(254, 240, 138, 0.25), transparent 30%),
        linear-gradient(150deg, #7c2d12, #ea580c 62%, #f59e0b);
}

.challenge-intro h3 {
    margin: 12px 0 8px;
    font-family: 'Kanit', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    line-height: 1.18;
}

.challenge-intro p {
    margin: 0;
    color: rgba(255, 255, 255, 0.87);
    line-height: 1.75;
}

.challenge-time {
    display: inline-flex;
    margin-top: 20px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 800;
}

.challenge-form {
    display: grid;
    gap: 16px;
}

.challenge-question {
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
}

.challenge-question legend {
    width: 100%;
    padding: 0;
    color: var(--learn-ink);
    font-family: 'Kanit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.55;
}

.challenge-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.challenge-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #fff;
    cursor: pointer;
    font-weight: 650;
    line-height: 1.45;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.challenge-option:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.4);
    background: #f0fdfa;
}

.challenge-option:has(input:checked) {
    border-color: var(--learn-teal);
    background: #ccfbf1;
}

.challenge-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--learn-teal);
    flex: 0 0 auto;
}

.challenge-feedback {
    display: none;
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 14px;
    line-height: 1.6;
}

.challenge-question[data-result="correct"] {
    border-color: rgba(15, 118, 110, 0.42);
    background: #f0fdfa;
}

.challenge-question[data-result="incorrect"] {
    border-color: rgba(234, 88, 12, 0.38);
    background: #fff7ed;
}

.challenge-question[data-result] .challenge-feedback {
    display: block;
}

.challenge-question[data-result="correct"] .challenge-feedback {
    color: #115e59;
    background: #ccfbf1;
}

.challenge-question[data-result="incorrect"] .challenge-feedback {
    color: #9a3412;
    background: #ffedd5;
}

.challenge-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.challenge-submit,
.example-chip,
.progress-find {
    border: 0;
    font: inherit;
    cursor: pointer;
}

.challenge-submit {
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--learn-teal), var(--learn-teal-dark));
    font-weight: 800;
    box-shadow: 0 16px 30px -22px rgba(15, 118, 110, 0.85);
}

.challenge-score {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 16px;
    color: #0f766e;
    background: #ccfbf1;
    font-weight: 800;
}

.survey-progress-card {
    position: sticky;
    top: 10px;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid rgba(14, 165, 233, 0.24);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 44px -32px rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(14px);
    opacity: 0.76;
    transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.survey-progress-card.is-active {
    opacity: 1;
    border-color: rgba(14, 165, 233, 0.42);
    box-shadow: 0 20px 48px -30px rgba(14, 116, 144, 0.42);
}

.survey-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.survey-progress-meta strong {
    color: #0f172a;
    font-family: 'Kanit', sans-serif;
}

.survey-progress-meta span {
    color: #0369a1;
    font-size: 0.88rem;
    font-weight: 800;
}

.survey-progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e0f2fe;
}

.survey-progress-track > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0ea5e9, #14b8a6);
    transition: width 0.3s ease;
}

.survey-progress-note {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.45;
}

.progress-find {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 999px;
    color: #075985;
    background: #e0f2fe;
    font-weight: 800;
    white-space: nowrap;
}

.progress-find:hover {
    background: #bae6fd;
}

.question-attention {
    animation: questionAttention 1.1s ease;
}

@keyframes questionAttention {
    0%, 100% { box-shadow: inherit; }
    30%, 70% { box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.2); }
}

.example-lab {
    margin: 20px 0 22px;
    padding: 18px;
    border: 1px dashed rgba(14, 165, 233, 0.42);
    border-radius: 20px;
    background: linear-gradient(120deg, rgba(240, 249, 255, 0.94), rgba(240, 253, 250, 0.92));
}

.example-lab strong {
    display: block;
    color: #0f172a;
    font-family: 'Kanit', sans-serif;
    font-size: 1.02rem;
}

.example-lab p {
    margin: 4px 0 12px;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
}

.example-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.example-chip {
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: 999px;
    color: #075985;
    background: #fff;
    font-weight: 800;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.example-chip:hover {
    transform: translateY(-1px);
    border-color: #0ea5e9;
    background: #e0f2fe;
}

.example-chip[aria-pressed="true"] {
    color: #fff;
    border-color: var(--learn-teal);
    background: var(--learn-teal);
}

@media (max-width: 840px) {
    .learning-journey,
    .challenge-shell {
        grid-template-columns: 1fr;
    }

    .challenge-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .journey-step-card {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .journey-index {
        width: 44px;
        height: 44px;
    }

    .journey-state {
        grid-column: 2;
        justify-self: start;
    }

    .survey-progress-card {
        top: 7px;
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .progress-find {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
