/* 
 * 마이페이지 스타일시트
 * 관리자 페이지 라이트 테마와 동일한 고급진 회색 테마
 */

/* ===== CSS Variables - Premium Gray Theme ===== */
:root {
    /* Primary Colors - Blue accent (like admin) */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --calendar-weekday-bg: #488cef;
    --calendar-nav-bg: #f8f8f8;
    --calendar-accent-blue: #3b82f6;

    /* Background Colors - Premium Gray */
    --bg-dark: #e4e4e4;
    --bg-darker: #f1f1f1;
    --bg-card: #ffffff;
    --bg-secondary: #d4d4d4;
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-soft: #f8fafc;
    --bg-white: #ffffff;

    /* Themed text colors — light values equal the original literals (no change
       in light mode); dark overrides live in the html[data-theme="dark"] block. */
    --c-0f172a: #0f172a; --c-111827: #111827; --c-1e293b: #1e293b; --c-1f2937: #1f2937;
    --c-334155: #334155; --c-374151: #374151; --c-475569: #475569; --c-4b5563: #4b5563;
    --c-64748b: #64748b; --c-94a3b8: #94a3b8; --c-7a7a7a: #7a7a7a; --c-7d8694: #7d8694;
    --c-1d4ed8: #1d4ed8; --c-4338ca: #4338ca; --c-4f46e5: #4f46e5;
    /* Themed border colors (light = original literal) */
    --b-e2e8f0: #e2e8f0; --b-e5e7eb: #e5e7eb; --b-dbe4f0: #dbe4f0; --b-cbd5e1: #cbd5e1;
    --b-c7d2fe: #c7d2fe; --b-a5b4fc: #a5b4fc; --b-dbeafe: #dbeafe; --b-e3e8f5: #e3e8f5;
    --b-dce5f4: #dce5f4; --b-dbe5f4: #dbe5f4; --b-d9d9d9: #d9d9d9;

    /* Text Colors */
    --text-primary: #545961;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Border */
    --border: rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;

    /* Font */
    --font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Mobile enrollment choices */
@media (max-width: 768px) {
    #orderFormModal .class-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
    }

    #orderFormModal .class-type-card {
        min-height: 96px;
        padding: 0.65rem !important;
        gap: 0.5rem !important;
        align-items: center !important;
    }

    #orderFormModal .class-type-card > div:first-child {
        font-size: 1.55rem !important;
    }

    #orderFormModal .class-type-card > div:last-child {
        min-width: 0;
    }

    #orderFormModal .class-type-card h4 {
        margin-bottom: 0.3rem !important;
        font-size: 0.9rem !important;
    }

    #orderFormModal .class-type-card p {
        font-size: 0.68rem !important;
        line-height: 1.3 !important;
    }

    #orderFormModal .order-level-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.6rem !important;
    }

    #orderFormModal .order-level-choice-card--leveltest {
        grid-column: 1 / -1;
    }

    #orderFormModal .order-level-choice-card--leveltest > p {
        display: none !important;
    }

    #orderFormModal .order-level-choice-card--quick,
    #orderFormModal .order-level-choice-card--direct {
        min-width: 0;
        height: 100%;
    }

    #orderFormModal .order-level-choice-card--quick > p,
    #orderFormModal .order-level-choice-card--direct > p {
        display: block !important;
        font-size: 0.7rem !important;
        line-height: 1.35 !important;
        white-space: normal !important;
        word-break: keep-all;
        overflow-wrap: break-word;
    }

    #orderFormModal .mobile-natural-copy-break {
        display: none;
    }

    #orderFormModal .order-level-choice-card--quick .order-level-choice-button,
    #orderFormModal .order-level-choice-card--direct .order-level-choice-button {
        padding-inline: 0.45rem !important;
        font-size: 0.78rem !important;
    }
}

/* Mobile app-store action shared by level test, enrollment, app sync, and App UID. */
.mobile-app-step-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.mobile-app-download-row {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.mobile-app-download-qr {
    flex-shrink: 0;
    box-sizing: border-box;
}

.mobile-app-download-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
}

.mobile-app-store-link {
    display: inline-flex;
    min-height: 42px;
    padding: 0.55rem 0.85rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid #111827;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.mobile-app-store-link:hover,
.mobile-app-store-link:focus-visible {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
    outline: 3px solid rgba(59, 130, 246, 0.25);
    outline-offset: 2px;
}

.mypage-app-sync-handoff-time {
    margin-top: 0.4rem;
    color: #078f3a;
    font-size: 1rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.app-sync-handoff-open-link,
.mypage-app-sync-retry-button {
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.7rem;
    padding: 0.6rem 1rem;
    border: 0;
    border-radius: 8px;
    background: #119548;
    color: #ffffff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.mypage-app-sync-retry-button {
    background: #1f2937;
}

.app-sync-handoff-open-link[hidden],
.mypage-app-sync-retry-button[hidden],
.mypage-app-sync-handoff-time[hidden] {
    display: none !important;
}

.mypage-app-sync-mobile-copy {
    display: none;
}

@media (min-width: 769px) {
    .mypage-app-sync-handoff-action {
        display: none !important;
    }
}

@media (min-width: 769px) {
    #appSyncStep1 .app-sync-download-row {
        display: grid;
        grid-template-columns: 170px minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        column-gap: 1rem;
        row-gap: 0.55rem;
    }

    #appSyncStep1 .mobile-app-download-qr {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    #appSyncStep1 .mobile-app-download-copy {
        display: contents;
    }

    #appSyncStep1 .mobile-app-download-copy > p {
        grid-column: 2;
    }

    #appSyncStep1 .mobile-app-step-actions,
    #appUidStep2 .mobile-app-step-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, max-content);
        align-items: center;
        justify-content: center;
        column-gap: 0.55rem;
        row-gap: 0.45rem;
    }

    #appSyncStep1 .mobile-app-step-actions {
        grid-column: 1 / -1;
        margin-top: 0.35rem;
    }

    #appSyncStep1 .mobile-app-step-actions > button,
    #appUidStep2 .mobile-app-step-actions > button {
        grid-column: 1 / -1;
        justify-self: center;
        margin-top: 0.25rem;
    }
}

#appInstallRecommendationModal.app-install-recommendation-overlay {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#appInstallRecommendationModal.app-install-recommendation-overlay[hidden] {
    display: none !important;
}

#appInstallRecommendationModal .app-install-recommendation-modal {
    position: relative;
    width: min(576px, 100%);
    max-width: 100%;
    max-height: min(92vh, 850px);
    max-height: min(92dvh, 850px);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
    transform: none;
    transition: none;
    animation: app-install-recommendation-enter 180ms ease-out;
}

.app-install-recommendation-header {
    min-height: 58px;
    padding: 0.8rem 1rem 0.8rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
    box-sizing: border-box;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.app-install-recommendation-header h3 {
    margin: 0;
    color: #111827;
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1.35;
}

.app-install-recommendation-close {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #334155;
    font-size: 1.15rem;
    cursor: pointer;
}

.app-install-recommendation-close:hover,
.app-install-recommendation-close:focus-visible {
    background: #e2e8f0;
    color: #0f172a;
    outline: 3px solid rgba(16, 185, 129, 0.24);
    outline-offset: 2px;
}

.app-install-recommendation-image {
    width: 100%;
    aspect-ratio: 800 / 330;
    margin: 0;
    overflow: hidden;
    flex: 0 0 auto;
    background: #ffc400;
}

.app-install-recommendation-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.app-install-recommendation-content {
    min-height: 0;
    padding: 1.1rem 1.35rem;
    overflow-y: auto;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.65;
    overscroll-behavior: contain;
}

.app-install-recommendation-content p {
    margin: 0;
    letter-spacing: 0;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.app-install-recommendation-lead {
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.45;
    text-align: center;
}

.app-install-recommendation-points {
    margin: 0;
    padding: 0.85rem 0 0.95rem 1.2rem;
    display: grid;
    gap: 0.55rem;
    color: #334155;
}

.app-install-recommendation-points li {
    padding-left: 0.15rem;
    line-height: 1.58;
    letter-spacing: 0;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.app-install-recommendation-points li::marker {
    color: #111827;
    font-size: 1.05em;
}

.app-install-recommendation-notice {
    position: relative;
    width: 100%;
    padding: 0.75rem 0.85rem;
    margin: 0.15rem auto 0;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    box-sizing: border-box;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #16a34a;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(22, 101, 52, 0.08);
}

.app-install-recommendation-notice.is-confirmation-required {
    border-color: #f97316;
    border-left-color: #ea580c;
    background: #fff7ed;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18), 0 5px 16px rgba(154, 52, 18, 0.14);
    animation: app-install-confirmation-nudge 320ms ease-out;
}

.app-install-recommendation-confirm-bubble {
    position: absolute;
    left: 0.55rem;
    bottom: calc(100% + 10px);
    width: min(280px, calc(100vw - 3rem));
    max-width: 100%;
    padding: 0.55rem 0.72rem;
    box-sizing: border-box;
    border-radius: 7px;
    background: #1f2937;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: 0;
    word-break: keep-all;
    overflow-wrap: break-word;
    pointer-events: none;
    z-index: 4;
}

.app-install-recommendation-confirm-bubble::after {
    content: '';
    position: absolute;
    left: 18px;
    top: 100%;
    width: 0;
    height: 0;
    border: 7px solid transparent;
    border-top-color: #1f2937;
}

.app-install-recommendation-confirm-bubble[hidden] {
    display: none !important;
}

.app-install-recommendation-notice input {
    width: 22px;
    height: 22px;
    margin: 0.12rem 0 0;
    flex: 0 0 auto;
    accent-color: #16a34a;
    cursor: pointer;
}

.app-install-recommendation-notice-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    line-height: 1.45;
}

.app-install-recommendation-notice-copy strong,
.app-install-recommendation-notice-copy span {
    display: block;
}

.app-install-recommendation-notice-copy strong {
    color: #14532d;
    font-size: 1.02rem;
    font-weight: 900;
}

.app-install-recommendation-notice-copy > span {
    color: #92400e;
    font-weight: 900;
}

.app-install-recommendation-actions {
    padding: 1rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.app-install-recommendation-actions .btn {
    min-height: 48px;
    padding: 0.75rem 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 8px;
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
    cursor: pointer;
}

.app-install-recommendation-sync {
    border: 1px solid #047857;
    background: #047857;
    color: #ffffff;
}

.app-install-recommendation-sync:hover,
.app-install-recommendation-sync:focus-visible {
    border-color: #065f46;
    background: #065f46;
    color: #ffffff;
}

.app-install-recommendation-continue {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.app-install-recommendation-continue:hover,
.app-install-recommendation-continue:focus-visible {
    border-color: #64748b;
    background: #f1f5f9;
    color: #0f172a;
}

html[data-theme="dark"] .app-install-recommendation-modal,
html[data-theme="dark"] .app-install-recommendation-header {
    border-color: #334155;
    background: #0f172a;
}

html[data-theme="dark"] .app-install-recommendation-header h3,
html[data-theme="dark"] .app-install-recommendation-lead {
    color: #f8fafc;
}

html[data-theme="dark"] .app-install-recommendation-content {
    color: #cbd5e1;
}

html[data-theme="dark"] .app-install-recommendation-lead {
    border-bottom-color: #334155;
}

html[data-theme="dark"] .app-install-recommendation-points {
    color: #cbd5e1;
}

html[data-theme="dark"] .app-install-recommendation-points li::marker {
    color: #f8fafc;
}

html[data-theme="dark"] .app-install-recommendation-close,
html[data-theme="dark"] .app-install-recommendation-actions {
    border-color: #334155;
    background: #1e293b;
    color: #e2e8f0;
}

html[data-theme="dark"] .app-install-recommendation-notice {
    border-color: #166534;
    border-left-color: #4ade80;
    background: #052e16;
    color: #bbf7d0;
}

html[data-theme="dark"] .app-install-recommendation-notice.is-confirmation-required {
    border-color: #fb923c;
    border-left-color: #fb923c;
    background: #431407;
    box-shadow: 0 0 0 4px rgba(251, 146, 60, 0.2), 0 6px 18px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .app-install-recommendation-notice-copy strong {
    color: #dcfce7;
}

html[data-theme="dark"] .app-install-recommendation-notice-copy > span {
    color: #fdba74;
}

html[data-theme="dark"] .app-install-recommendation-continue {
    border-color: #64748b;
    background: #0f172a;
    color: #e2e8f0;
}

@keyframes app-install-recommendation-enter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes app-install-confirmation-nudge {
    0%, 100% { transform: translateX(0); }
    35% { transform: translateX(5px); }
    70% { transform: translateX(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .app-install-recommendation-notice.is-confirmation-required {
        animation: none;
    }
}

@media (min-width: 769px) and (max-height: 760px) {
    #appInstallRecommendationModal.app-install-recommendation-overlay {
        padding: 0.75rem;
    }

    #appInstallRecommendationModal .app-install-recommendation-modal {
        max-height: calc(100dvh - 1.5rem);
    }

    .app-install-recommendation-header {
        min-height: 50px;
        padding: 0.45rem 0.75rem 0.45rem 1rem;
    }

    .app-install-recommendation-close {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .app-install-recommendation-image {
        aspect-ratio: 800 / 250;
    }

    .app-install-recommendation-content {
        padding: 0.65rem 1.15rem;
        font-size: 0.88rem;
        line-height: 1.5;
    }

    .app-install-recommendation-lead {
        padding-bottom: 0.45rem;
        font-size: 1.05rem;
    }

    .app-install-recommendation-points {
        padding: 0.5rem 0 0.6rem 1.1rem;
        gap: 0.3rem;
        font-size: 0.84rem;
    }

    .app-install-recommendation-notice {
        padding: 0.5rem 0.65rem;
        gap: 0.55rem;
    }

    .app-install-recommendation-notice input {
        width: 20px;
        height: 20px;
    }

    .app-install-recommendation-notice-copy strong {
        font-size: 0.92rem;
    }

    .app-install-recommendation-notice-copy > span {
        font-size: 0.8rem;
    }

    .app-install-recommendation-actions {
        padding: 0.6rem 1rem;
    }

    .app-install-recommendation-actions .btn {
        min-height: 44px;
        padding: 0.6rem 1rem;
    }
}

@media (max-width: 768px) {
    #appInstallRecommendationModal.app-install-recommendation-overlay {
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }

    #appInstallRecommendationModal .app-install-recommendation-modal {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        border-width: 0;
        border-radius: 0;
        animation-name: app-install-recommendation-mobile-enter;
    }

    .app-install-recommendation-header {
        min-height: 56px;
        padding: 0.65rem 0.75rem 0.65rem 1rem;
    }

    .app-install-recommendation-header h3 {
        font-size: 1.1rem;
    }

    .app-install-recommendation-image {
        aspect-ratio: 800 / 390;
    }

    .app-install-recommendation-content {
        flex: 1 1 auto;
        padding: 0.95rem 1rem;
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .app-install-recommendation-lead {
        padding-bottom: 0.7rem;
        font-size: 1.08rem;
    }

    .app-install-recommendation-points {
        padding-top: 0.7rem;
        padding-bottom: 0.8rem;
        gap: 0.45rem;
        font-size: 0.84rem;
    }

    .app-install-recommendation-notice {
        padding: 0.7rem 0.75rem;
    }

    .app-install-recommendation-notice-copy strong {
        font-size: 0.94rem;
    }

    .app-install-recommendation-notice-copy > span {
        font-size: 0.84rem;
    }

    .app-install-recommendation-actions {
        padding: 0.8rem 1rem max(0.8rem, env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .app-install-recommendation-actions .btn {
        width: 100%;
        min-width: 0;
        min-height: 46px;
    }
}

@keyframes app-install-recommendation-mobile-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #appInstallRecommendationModal .app-install-recommendation-modal {
        animation: none;
    }
}

.order-first-time-intro,
.order-first-time-intro-text {
    display: block;
    min-width: 0;
    text-align: left;
}

@media (max-width: 768px) {
    .mypage-app-sync-desktop-copy {
        display: none;
    }

    .mypage-app-sync-mobile-copy {
        display: block;
    }

    [data-sync-protocol="handoff"] .mypage-app-sync-handoff-qr {
        display: none !important;
    }

    [data-sync-protocol="handoff"] .mypage-app-sync-handoff-action:not([hidden]) {
        display: inline-flex !important;
        width: min(100%, 320px);
        box-sizing: border-box;
    }

    .mypage-app-sync-retry-button:not([hidden]) {
        display: inline-flex;
        width: min(100%, 320px);
    }

    .mobile-app-store-link:not([hidden]) {
        display: inline-flex;
    }

    .level-test-wizard-store-action,
    .order-wizard-store-actions {
        margin-top: 5px !important;
    }

    .mobile-app-step-actions > .btn,
    .mobile-app-step-actions > button {
        min-height: 42px;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .mobile-app-download-row {
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        text-align: left !important;
    }

    .mobile-app-download-qr {
        width: 112px !important;
        height: 112px !important;
        flex: 0 0 112px;
        padding: 5px !important;
    }

    .mobile-app-download-copy {
        width: auto !important;
        min-width: 0;
        flex: 1 1 auto !important;
        align-items: stretch !important;
        text-align: left !important;
    }

    .mobile-app-download-copy > p {
        margin: 0 !important;
        text-align: left !important;
    }

    .mobile-app-download-copy .mobile-app-step-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.3rem;
        margin-top: 0.1rem;
    }

    .mobile-app-download-copy .mobile-app-store-link {
        min-height: 38px;
        padding: 0.45rem 0.55rem;
        gap: 0.3rem;
        font-size: 0.72rem;
    }

    .mobile-app-download-copy .mobile-app-step-actions > button {
        min-height: 38px;
        padding: 0.45rem 1rem !important;
        font-size: 0.75rem !important;
    }

    #orderFormModal .order-level-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }

    #orderFormModal .order-level-choice-card {
        width: 100%;
        min-width: 0;
        padding: 0.8rem !important;
        align-items: stretch !important;
        box-sizing: border-box;
    }

    #orderFormModal .order-level-choice-button {
        width: 100%;
        min-height: 44px;
        max-width: 100%;
        padding: 0.68rem 0.8rem !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    #orderFormModal .order-level-choice-card > p {
        margin: 0.5rem 0 0 !important;
        text-align: center !important;
    }

    #levelSelectionFieldset,
    #levelSelectionFieldsetFlexible {
        padding: 1rem !important;
    }

    #orderFormModal .order-first-time-intro {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        text-align: left !important;
    }

    #orderFormModal .order-preferred-time-search-row {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center !important;
        gap: 0.35rem !important;
        flex-wrap: nowrap !important;
        width: 100%;
        min-width: 0;
    }

    #orderFormModal .order-preferred-time-period {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }

    #orderFormModal .order-preferred-time-period .ampm-btn {
        min-width: 0 !important;
        padding: 0.6rem 0.65rem !important;
    }

    #orderFormModal #preferredHourModal {
        width: 100%;
        min-width: 0 !important;
        padding: 0.6rem 0.5rem !important;
        flex: 1 1 auto !important;
    }

    #orderFormModal #classTimeSearchBtn {
        min-width: 0;
        padding: 0.6rem 0.75rem !important;
    }

    #textbookSelectionFieldset .order-textbook-category-info-row,
    #textbookSelectionFieldsetFlexible .order-textbook-category-info-row {
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    #categoryInfoPanel,
    #categoryInfoPanelFlexible {
        padding: 0.75rem !important;
    }

    #categoryImageContainer,
    #categoryImageContainerFlexible {
        width: 82px !important;
        height: 116px !important;
        flex: 0 0 82px !important;
        border-radius: 8px !important;
    }

    #categoryInfoPanel .order-textbook-category-copy,
    #categoryInfoPanelFlexible .order-textbook-category-copy {
        flex: 1 1 auto !important;
        width: calc(100% - 94px);
        min-width: 0 !important;
    }

    #categoryLevelBadge,
    #categoryLevelBadgeFlexible {
        display: flex !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    #categoryLevelText,
    #categoryLevelTextFlexible {
        display: block;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #categoryDescription,
    #categoryDescriptionFlexible {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    #appRegistrationSection .order-app-video-panel,
    #levelTestStickerModal .level-test-app-video-panel {
        order: 2;
        margin-top: 0.25rem;
    }

    #appSyncModal .app-sync-modal-body {
        min-height: 0;
        flex: 1 1 auto;
        flex-direction: column !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #appSyncModal .app-sync-modal-left {
        width: 100% !important;
        flex: 0 0 auto !important;
    }

    #appSyncModal .app-sync-modal-left > div {
        padding: 1rem !important;
    }

    #appSyncModal .app-sync-modal-right {
        width: 100%;
        min-height: 0;
        flex: 0 0 auto !important;
        aspect-ratio: 16 / 9;
    }

    #appSyncModal .app-sync-modal-right video {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
}

@media (max-width: 360px) {
    .mobile-app-download-row {
        gap: 0.55rem !important;
    }

    .mobile-app-download-qr {
        width: 88px !important;
        height: 88px !important;
        flex: 0 0 88px;
        padding: 4px !important;
    }

    .mobile-app-download-copy {
        gap: 0.4rem;
    }

    .mobile-app-download-copy > p {
        font-size: 0.72rem !important;
        line-height: 1.35 !important;
    }

    .mobile-app-download-copy .mobile-app-step-actions {
        gap: 0.2rem;
    }

    .mobile-app-download-copy .mobile-app-store-link {
        min-height: 34px;
        padding: 0.35rem 0.35rem;
        gap: 0.2rem;
        font-size: 0.66rem;
    }

    .mobile-app-download-copy .mobile-app-step-actions > button {
        min-height: 34px;
        padding: 0.35rem 0.8rem !important;
        font-size: 0.7rem !important;
    }
}

.counsel-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.counsel-page-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.counsel-page-actions,
.counsel-search-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .counsel-page-card {
        padding: 0.8rem !important;
    }

    .counsel-page-toolbar {
        width: 100%;
        gap: 0.4rem;
        flex-wrap: nowrap;
    }

    .counsel-page-title {
        flex: 0 0 auto;
        font-size: 1.08rem;
    }

    .counsel-page-actions {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
        gap: 0.35rem;
    }

    .counsel-search-group {
        flex: 1 1 auto;
        min-width: 0;
        gap: 0.25rem;
    }

    #counselSearchInput {
        width: auto;
        min-width: 0 !important;
        flex: 1 1 54px;
        padding: 0.5rem 0.45rem !important;
    }

    #counselSearchBtn {
        width: 40px;
        min-width: 40px;
        height: 40px;
        padding: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .counsel-search-label {
        display: none;
    }

    #counselNewBtn {
        min-height: 40px;
        padding: 0.5rem 0.58rem !important;
        display: inline-flex;
        align-items: center;
        gap: 0.28rem;
        font-size: 0.76rem;
        white-space: nowrap;
    }

    .counsel-page-card #counselList {
        margin-top: 1rem !important;
    }
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    background: var(--bg-darker);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

html.i18n-loading body,
html.mypage-bundle-loading body,
html.mypage-app-loading body {
    overflow: hidden;
    min-height: 100vh;
    background: var(--bg-card);
}

html.i18n-loading body>*:not(#initialI18nLoader),
html.mypage-bundle-loading body>*:not(#initialI18nLoader),
html.mypage-app-loading body>*:not(#initialI18nLoader) {
    visibility: hidden;
}

.i18n-init-loader {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.72rem;
    background: var(--bg-card);
}

html.i18n-loading .i18n-init-loader,
html.mypage-bundle-loading .i18n-init-loader,
html.mypage-app-loading .i18n-init-loader {
    display: flex;
}

.i18n-init-active-indicator {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(17, 24, 39, 0.18);
    border-top-color: #111111;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.i18n-init-loader-text {
    margin: 0;
    color: #111111;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 700;
    letter-spacing: 0.01em;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h4 {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
}

p {
    color: var(--text-secondary);
}

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ===== Header & Navigation ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--spacing-md) 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.header .container {
    max-width: 100%;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.nav-center {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 0.4rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-left: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.logo-greeting {
    margin-left: 0.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.header-greeting-desktop {
    display: inline;
}

.header-greeting-mobile {
    display: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-link {
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-user-hidden {
    display: none;
}

.header-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    background: var(--bg-soft);
    border: 1px solid var(--b-e2e8f0);
    color: var(--text-secondary);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.header-logout-btn:hover {
    background: var(--bg-soft);
    border-color: var(--b-c7d2fe);
    color: var(--c-4338ca);
}

.header-quick-menu {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 0.75rem;
}

.header-quick-menu button {
    background: none;
    border: none;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.header-quick-menu button:hover {
    color: var(--c-4338ca);
    text-decoration: underline;
}

.header-menu-sep {
    color: #cbd5f5;
}

.mobile-header-order-menu {
    display: none;
}

.point-wallet-header {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 22px;
}

.point-wallet-summary-btn {
    appearance: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: auto;
    min-height: 34px;
    padding: 0.34rem 0.56rem;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 11px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.96)),
        linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(59, 130, 246, 0.1));
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
    font: inherit;
    font-variant-numeric: tabular-nums;
}

.point-wallet-summary-btn:hover,
.point-wallet-summary-btn:focus-visible {
    border-color: rgba(13, 148, 136, 0.36);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12), 0 0 0 3px rgba(20, 184, 166, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
    outline: none;
}

.point-wallet-summary-btn:active {
    transform: translateY(0);
}

.point-wallet-summary-divider {
    flex: 0 0 auto;
    width: 1px;
    height: 18px;
    background: linear-gradient(180deg, transparent, rgba(15, 118, 110, 0.34), transparent);
}

.point-wallet-header-mobile {
    display: none;
}

.sidebar-point-wallet-wrap {
    margin-top: 0.35rem;
    margin-bottom: 0.4rem;
}

.sidebar-point-wallet {
    width: 100%;
    justify-content: stretch;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.sidebar-point-wallet .point-wallet-summary-btn {
    --point-wallet-glow-hue: 205;
    width: 100%;
    min-height: 38px;
    padding: 0.42rem 0.56rem;
    isolation: isolate;
    overflow: visible;
    border-color: transparent;
    background: #05000f;
    color: #ffffff;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(205, 255, 224, 0.4),
        0 0 14px rgba(84, 255, 94, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: pointWalletBalanceHue 7s linear infinite;
}

.sidebar-point-wallet .point-wallet-summary-btn::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 1;
    display: block;
    padding: 2px;
    border-radius: 12px;
    background:
        conic-gradient(
            from calc(var(--point-wallet-glow-hue) * 1deg),
            rgba(214, 255, 228, 0.5) 0deg,
            rgba(119, 255, 114, 0.34) 24deg,
            rgba(190, 255, 152, 0.7) 42deg,
            rgba(255, 255, 255, 0.96) 62deg,
            rgba(70, 255, 35, 0.92) 88deg,
            rgba(28, 255, 176, 0.72) 120deg,
            rgba(214, 255, 228, 0.26) 158deg,
            rgba(214, 255, 228, 0.48) 360deg
        );
    -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;
    filter:
        drop-shadow(0 0 4px rgba(255, 255, 255, 0.26))
        drop-shadow(0 0 8px rgba(82, 255, 47, 0.28));
    pointer-events: none;
}

.sidebar-point-wallet .point-wallet-summary-btn .point-wallet-pill,
.sidebar-point-wallet .point-wallet-summary-btn .point-wallet-summary-divider {
    position: relative;
    z-index: 2;
}

.sidebar-point-wallet .point-wallet-summary-btn .point-wallet-label {
    color: #c8f7df;
}

.sidebar-point-wallet .point-wallet-summary-btn .point-wallet-value {
    color: #ffffff;
}

.sidebar-point-wallet .point-wallet-pill i {
    color: #5eead4;
}

.sidebar-point-wallet .point-wallet-pill.score i {
    color: #93c5fd;
}

.sidebar-point-wallet .point-wallet-summary-divider {
    background: linear-gradient(180deg, transparent, rgba(190, 255, 222, 0.48), transparent);
}

.point-wallet-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    height: 22px;
    padding: 0 0.52rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(255, 255, 255, 0.86);
    color: #334155;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
    font-variant-numeric: tabular-nums;
}

.sidebar-point-wallet .point-wallet-pill {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.77rem;
}

.point-wallet-summary-btn .point-wallet-pill {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.point-wallet-summary-btn .point-wallet-label {
    color: #475569;
    font-size: 0.66rem;
    font-weight: 700;
}

.point-wallet-summary-btn .point-wallet-value {
    color: #0f172a;
    font-weight: 900;
}

.point-wallet-pill.is-updating {
    border-color: rgba(34, 197, 94, 0.65);
    background: #f0fdf4;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.point-wallet-summary-btn.is-updating {
    border-color: rgba(34, 197, 94, 0.58);
    background:
        linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(236, 253, 245, 0.96)),
        linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(20, 184, 166, 0.12));
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.16), 0 0 0 4px rgba(34, 197, 94, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.point-wallet-pill i {
    color: #0f766e;
    font-size: 0.68rem;
}

.point-wallet-pill.score i {
    color: #2563eb;
}

.point-wallet-delta {
    position: absolute;
    right: 0.2rem;
    top: -1.95rem;
    color: #ef4444;
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.95), 0 0 14px rgba(239, 68, 68, 0.32);
    pointer-events: none;
    z-index: 2;
    animation: pointWalletFloat 1100ms ease-out forwards;
}

.point-wallet-delta.negative {
    color: #2563eb;
}

@keyframes pointWalletFloat {
    0% { opacity: 0; transform: translateY(6px); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-34px); }
}

.point-wallet-section {
    display: grid;
    gap: 1.05rem;
    color: #111827;
    padding-right: 5.6rem;
    max-width: 1040px;
}

.point-wallet-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.52fr) minmax(260px, 0.58fr);
    gap: 1rem;
    align-items: stretch;
}

.point-wallet-copy,
.point-wallet-balance-card,
.point-wallet-grade-card,
.point-wallet-stat-card,
.point-wallet-panel {
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #ffffff;
    box-shadow: none;
}

.point-wallet-copy {
    position: relative;
    overflow: hidden;
    padding: 1.55rem 1.65rem;
    border-radius: 24px;
    background: #ffffff;
}

.point-wallet-copy::after {
    display: none;
}

.point-wallet-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0.55rem;
    padding: 0.24rem 0.58rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
}

.point-wallet-copy h2 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.55rem, 2.25vw, 2.18rem);
    line-height: 1.16;
    letter-spacing: 0;
    max-width: 680px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.point-wallet-copy p {
    max-width: 680px;
    margin: 0.55rem 0 0;
    color: #475569;
    font-size: 0.96rem;
    line-height: 1.65;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.point-wallet-note-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.46rem;
    margin-top: 1rem;
}

.point-wallet-note-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.78rem;
    font-weight: 800;
}

@property --point-wallet-glow-hue {
    syntax: "<number>";
    inherits: true;
    initial-value: 145;
}

@property --point-wallet-glow-x {
    syntax: "<number>";
    inherits: true;
    initial-value: 8;
}

@property --point-wallet-glow-y {
    syntax: "<number>";
    inherits: true;
    initial-value: 18;
}

@property --point-wallet-glow-size {
    syntax: "<number>";
    inherits: true;
    initial-value: 1;
}

.point-wallet-balance-card {
    --point-wallet-glow-hue: 205;
    position: relative;
    isolation: isolate;
    overflow: visible;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 150px;
    padding: 1.35rem;
    border-radius: 24px;
    border: 0;
    background: #05000f;
    color: #ffffff;
    box-shadow:
        0 15px 28px rgba(0, 0, 0, 0.24),
        0 0 0 1px rgba(205, 255, 224, 0.54),
        0 0 18px rgba(84, 255, 94, 0.26),
        0 2px 8px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateZ(0);
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
    animation: pointWalletBalanceHue 7s linear infinite;
}

.point-wallet-balance-card::before {
    content: none;
    display: none;
}

.point-wallet-balance-card::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 2;
    border-radius: 25px;
    display: block;
    padding: 4px;
    background:
        conic-gradient(
            from calc(var(--point-wallet-glow-hue) * 1deg),
            rgba(214, 255, 228, 0.62) 0deg,
            rgba(119, 255, 114, 0.42) 24deg,
            rgba(190, 255, 152, 0.78) 42deg,
            rgba(255, 255, 255, 1) 62deg,
            rgba(70, 255, 35, 1) 88deg,
            rgba(28, 255, 176, 0.82) 120deg,
            rgba(214, 255, 228, 0.34) 158deg,
            rgba(214, 255, 228, 0.58) 360deg
        );
    -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;
    filter:
        drop-shadow(0 0 6px rgba(255, 255, 255, 0.34))
        drop-shadow(0 0 12px rgba(82, 255, 47, 0.34));
    pointer-events: none;
}

.point-wallet-balance-card:hover {
    --point-wallet-glow-size: 1.35;
    transform: translateY(-2px);
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.26),
        0 0 16px rgba(255, 255, 255, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    animation:
        pointWalletBalanceHue 7s linear infinite,
        pointWalletBalanceShadowPulse 8s linear infinite;
}

.point-wallet-balance-card:hover::before {
    content: none;
}

@keyframes pointWalletBalanceHue {
    0% { --point-wallet-glow-hue: 145; }
    100% { --point-wallet-glow-hue: 505; }
}

@keyframes pointWalletBalanceShadowPulse {
    0%, 24%, 46%, 73%, 96% {
        box-shadow:
            0 18px 34px rgba(0, 0, 0, 0.26),
            0 0 12px rgba(255, 255, 255, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }
    12%, 52%, 88% {
        box-shadow:
            0 18px 34px rgba(0, 0, 0, 0.26),
            0 0 26px rgba(255, 255, 255, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.16);
    }
}

.point-wallet-balance-card span,
.point-wallet-stat-card span,
.point-wallet-grade-card span {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.point-wallet-balance-card span,
.point-wallet-balance-card strong,
.point-wallet-balance-card small {
    position: relative;
    z-index: 1;
}

.point-wallet-balance-card span {
    color: rgba(255, 255, 255, 0.72);
}

.point-wallet-balance-card strong {
    color: #ffffff;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.point-wallet-balance-card small,
.point-wallet-stat-card small {
    display: block;
    margin-top: 0.55rem;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.45;
}

.point-wallet-balance-card small {
    color: rgba(255, 255, 255, 0.76);
}

.point-wallet-balance-rule {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.58rem;
    margin-top: 1rem;
}

.point-wallet-balance-rule div {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 0.68rem 0.72rem;
    background: rgba(255, 255, 255, 0.08);
}

.point-wallet-balance-rule em,
.point-wallet-balance-rule b {
    display: block;
    font-style: normal;
    letter-spacing: 0;
}

.point-wallet-balance-rule em {
    margin-bottom: 0.24rem;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.72rem;
    font-weight: 700;
}

.point-wallet-balance-rule b {
    color: #bbf7d0;
    font-size: 0.92rem;
    font-weight: 900;
    white-space: nowrap;
}

.point-wallet-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 0.85rem;
}

.point-wallet-stat-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.82rem;
    align-items: start;
    padding: 1rem;
    border-radius: 20px;
    background: #ffffff;
}

.point-wallet-stat-card::before {
    display: none;
}

.point-wallet-stat-card--pending::before {
    background: rgba(245, 158, 11, 0.13);
}

.point-wallet-stat-card--score::before {
    background: rgba(37, 99, 235, 0.12);
}

.point-wallet-stat-card--grade::before {
    background: rgba(22, 163, 74, 0.12);
}

.point-wallet-stat-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: #fef3c7;
    color: #92400e;
    box-shadow: inset 0 0 0 1px rgba(146, 64, 14, 0.08);
}

.point-wallet-stat-card--score .point-wallet-stat-icon {
    background: #dbeafe;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.08);
}

.point-wallet-stat-card--grade .point-wallet-stat-icon {
    background: #dcfce7;
    color: #166534;
    box-shadow: inset 0 0 0 1px rgba(22, 101, 52, 0.08);
}

.point-wallet-stat-card > div:not(.point-wallet-stat-icon) {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.point-wallet-stat-card strong {
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.point-wallet-grade-card {
    display: grid;
    grid-template-columns: minmax(190px, 0.32fr) 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem 1.2rem;
    border-radius: 20px;
    background: #ffffff;
}

.point-wallet-grade-card strong {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 900;
}

.point-wallet-grade-card small {
    display: block;
    margin-top: 0.28rem;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.45;
}

.point-wallet-progress {
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(15,23,42,0.08);
}

.point-wallet-progress span {
    display: block;
    width: var(--point-wallet-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width 480ms ease-out;
}

.point-wallet-ledger {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1rem;
}

.point-wallet-panel {
    border-radius: 20px;
    overflow: hidden;
}

.point-wallet-panel-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem 0.62rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.point-wallet-panel h3 {
    margin: 0;
    padding: 0;
    color: #0f172a;
    font-size: 1rem;
}

.point-wallet-panel-title span {
    max-width: 260px;
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.45;
    text-align: right;
    word-break: keep-all;
}

.point-wallet-list {
    display: grid;
    gap: 0;
}

.point-wallet-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.82rem 1.1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
}

.point-wallet-list-row small {
    display: block;
    color: #94a3b8;
    font-size: 0.74rem;
    margin-top: 0.18rem;
}

.point-wallet-list-row strong {
    color: #0f172a;
    font-size: 0.92rem;
}

.point-wallet-list-row .delta {
    color: #ef4444;
    font-weight: 900;
    white-space: nowrap;
}

.point-wallet-list-row .delta.negative {
    color: #2563eb;
}

.point-wallet-list-row.is-empty {
    justify-content: flex-start;
}

.point-wallet-ledger-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    min-height: 48px;
    padding: 0.72rem 1.1rem 1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.point-wallet-pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

.point-wallet-page-btn {
    min-width: 30px;
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.point-wallet-page-btn:hover:not(:disabled),
.point-wallet-page-btn:focus-visible:not(:disabled),
.point-wallet-page-btn.is-active {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
}

.point-wallet-page-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.point-wallet-policy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
    padding: 1rem 1.1rem 1.1rem;
}

.point-wallet-policy-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.92rem;
    background: #f8fafc;
}

.point-wallet-policy-card span {
    display: block;
    margin-bottom: 0.3rem;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 800;
}

.point-wallet-policy-card strong {
    display: block;
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 900;
    line-height: 1.28;
    word-break: keep-all;
}

.point-wallet-policy-card p {
    margin: 0.42rem 0 0;
    color: #475569;
    font-size: 0.78rem;
    line-height: 1.48;
    word-break: keep-all;
}

body.is-points-section #studentContinueEnrollmentBanner {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .point-wallet-pill,
    .point-wallet-summary-btn,
    .point-wallet-balance-card,
    .point-wallet-balance-card::before,
    .point-wallet-balance-card::after,
    .point-wallet-delta,
    .point-wallet-progress span {
        animation: none !important;
        transition: none !important;
    }
}

.order-point-section {
    display: none;
    border: 1px solid rgba(22, 163, 74, 0.28);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
    background:
        linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(255, 255, 255, 0.98));
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.order-point-legend {
    padding: 0 0.55rem;
    color: #047857;
    font-size: 0.9rem;
    font-weight: 800;
}

.order-point-section-legacy {
    margin-top: 1rem;
}

.order-point-section.is-visible {
    display: block;
}

.order-point-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.72rem;
    cursor: pointer;
}

.order-point-copy strong {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0.18rem;
    padding: 0.18rem 0.52rem;
    border-radius: 999px;
    background: #16a34a;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0;
}

.order-point-copy small {
    display: block;
    color: #475569;
    font-size: 0.78rem;
    line-height: 1.45;
    word-break: keep-all;
}

.order-point-summary {
    margin-top: 0.65rem;
    color: #166534;
    font-size: 0.82rem;
    font-weight: 900;
}

.order-point-toggle input {
    width: 18px;
    height: 18px;
    margin-top: 0.18rem;
    accent-color: #10b981;
    cursor: pointer;
}

.order-point-copy {
    display: grid;
    gap: 0.28rem;
    color: #0f172a;
    font-size: 0.9rem;
    line-height: 1.42;
}

.order-point-copy strong {
    background: #047857;
    color: #ffffff;
    font-size: 0.98rem;
}

.order-point-summary {
    margin-top: 0.55rem;
    color: #047857;
    font-size: 0.84rem;
    font-weight: 800;
}

.order-price-point-note {
    color: #047857;
    font-weight: 800;
}

.order-referral-section {
    display: none;
    margin-bottom: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 16px;
    padding: 0.86rem 0.95rem 1rem;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.98));
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.order-referral-section-legacy {
    margin-top: 1rem;
    margin-bottom: 0;
}

.order-referral-legend {
    padding: 0 0.55rem;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 800;
}

.order-referral-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    background: transparent;
    color: #1e3a8a;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.order-referral-body {
    display: none;
    margin-top: 0.85rem;
}

.order-referral-copy {
    margin: 0 0 0.75rem;
    color: #475569;
    font-size: 0.84rem;
    line-height: 1.55;
    word-break: keep-all;
}

.order-referral-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
}

.order-referral-input {
    min-width: 0;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    background: #ffffff;
    color: #0f172a;
    padding: 0.64rem 0.75rem;
    font-size: 0.9rem;
}

.order-referral-search-btn {
    justify-self: end;
    min-width: 74px;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: #ffffff;
    padding: 0.52rem 0.88rem;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.15;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.16);
}

.order-referral-search-btn:hover {
    background: #1d4ed8;
}

.order-referral-search-btn:disabled {
    cursor: wait;
    opacity: 0.72;
}

.order-referral-result {
    display: none;
    margin-top: 0.7rem;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
    padding: 0.75rem;
}

.order-referral-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.65rem;
    margin-bottom: 0.65rem;
}

.order-referral-status {
    font-weight: 700;
}

.order-referral-clear-btn {
    display: none;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    padding: 0.42rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

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

    .order-referral-search-btn {
        width: auto;
        justify-self: end;
    }
}

.header-app-sync-notice {
    position: absolute;
    top: 10px;
    left: 50%;
    z-index: 1002;
    transform: translateX(-50%);
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    max-width: min(760px, calc(100vw - 2rem));
    padding: 0.52rem 0.95rem;
    border-radius: 999px;
    background: #facc15;
    color: #111827;
    border: 1px solid rgba(17, 24, 39, 0.18);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.16);
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.header-app-sync-notice.is-visible {
    display: inline-flex !important;
}

.header-app-sync-notice-btn {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #facc15;
    padding: 0.32rem 0.76rem;
    font-size: 0.86rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(17, 24, 39, 0.22);
}

.header-app-sync-notice-btn:hover {
    background: #0f172a;
    color: #fde68a;
}

.top-gift-banner {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: auto;
    max-width: 100%;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.top-gift-banner.swipe {
    animation: topGiftSwipeIn 0.35s ease;
}

.top-gift-banner-icon {
    display: none;
}

.top-gift-banner-text {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.top-gift-banner-title {
    font-size: 1.08rem;
    color: var(--c-4f46e5);
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-gift-banner-detail {
    font-size: 1rem;
    color: var(--c-475569);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes topGiftSwipeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-coupon-section {
    margin: 0;
    padding: 0.75rem 0;
    border-radius: 0;
    background: transparent;
}

.order-benefits-group {
    margin-bottom: 1rem;
    padding: 0.85rem 0.95rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.order-benefits-title {
    padding: 0 0.55rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.order-token-benefit {
    margin-top: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(55, 65, 81, 0.18);
    text-align: left;
}

.order-token-benefit span {
    color: #374151 !important;
}

.order-coupon-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin-bottom: 0.65rem;
}

.order-coupon-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 800;
}

.order-coupon-guide {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.order-coupon-list {
    display: grid;
    gap: 0.25rem;
}

.order-coupon-summary {
    margin-top: 0.55rem;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 700;
}

.order-coupon-summary:empty {
    display: none;
}

.order-coupon-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.72rem;
    padding: 0.62rem 0.7rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.order-coupon-item:hover {
    background: rgba(148, 163, 184, 0.12);
}

.order-coupon-item.is-selected {
    background: var(--bg-card);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.order-coupon-item.is-disabled {
    background: transparent;
    cursor: default;
    opacity: 0.82;
}

.order-coupon-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.order-coupon-check {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 1.5px solid var(--b-cbd5e1);
    background: var(--bg-card);
    color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.order-coupon-check i {
    font-size: 0.68rem;
}

.order-coupon-item.is-selected .order-coupon-check {
    border-color: #475569;
    background: #475569;
    color: #ffffff;
}

.order-coupon-content {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.order-coupon-main {
    min-width: 0;
    flex: 1 1 260px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.45rem;
    color: var(--c-1e293b);
    font-size: 0.92rem;
    line-height: 1.3;
}

.order-coupon-copy {
    min-width: 0;
    display: inline;
}

.order-coupon-name {
    min-width: 0;
}

.order-coupon-kind {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    background: var(--b-e2e8f0);
    color: var(--c-475569);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.order-coupon-benefit {
    display: inline;
    color: var(--c-0f172a);
    font-weight: 700;
}

.order-coupon-benefit-key {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.order-coupon-benefit[data-benefit-unit="percent"] .order-coupon-benefit-key {
    color: #dc2626;
}

.order-coupon-benefit-tail {
    color: var(--c-0f172a);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
}

#orderBenefitsGroup .order-point-section,
#orderBenefitsGroup .order-referral-section {
    margin: 0;
    padding: 0.8rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#orderBenefitsGroup .order-referral-section,
#orderBenefitsGroup.has-coupon-benefit .order-point-section {
    border-top: 1px solid rgba(55, 65, 81, 0.18);
}

#orderBenefitsGroup .order-point-legend,
#orderBenefitsGroup .order-referral-legend {
    padding: 0;
    color: #374151;
}

#orderBenefitsGroup .order-point-copy,
#orderBenefitsGroup .order-point-copy small,
#orderBenefitsGroup .order-referral-toggle,
#orderBenefitsGroup .order-referral-copy {
    color: #374151;
}

#orderBenefitsGroup .order-point-copy strong {
    padding: 0;
    background: transparent;
    color: #1f2937;
    font-size: 0.92rem;
}

#fixedValidityWrap,
#flexibleValidityWrap {
    background: #111827 !important;
    border-color: #111827 !important;
}

#fixedValidityWrap :is(span, strong),
#flexibleValidityWrap :is(span, strong) {
    color: #f3f4f6 !important;
}

#fixedValidityWrap input[type="checkbox"],
#flexibleValidityWrap input[type="checkbox"] {
    flex: 0 0 20px;
    width: 20px !important;
    min-width: 20px;
    height: 20px !important;
    accent-color: #10b981;
}

html[data-theme="dark"] #orderBenefitsGroup {
    border-color: var(--border);
    background: var(--bg-soft);
}

html[data-theme="dark"] #orderBenefitsGroup :is(.order-benefits-title, .order-token-benefit span, .order-point-legend, .order-referral-legend, .order-point-copy, .order-point-copy small, .order-referral-toggle, .order-referral-copy) {
    color: #f3f4f6 !important;
}

#orderBenefitsGroup {
    padding: 0.65rem 1rem 0.35rem;
}

#orderBenefitsGroup .order-coupon-section {
    padding: 0.2rem 0 0.75rem;
}

#orderBenefitsGroup .order-coupon-list {
    gap: 0;
}

#orderBenefitsGroup .order-coupon-item {
    padding: 0.65rem 0;
    border-radius: 0;
}

#orderBenefitsGroup .order-coupon-item:hover,
#orderBenefitsGroup .order-coupon-item.is-selected {
    background: transparent;
    box-shadow: none;
}

#orderBenefitsGroup .order-coupon-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

#orderBenefitsGroup .order-coupon-main {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
}

#orderBenefitsGroup .order-coupon-copy {
    display: grid;
    gap: 0.12rem;
}

#orderBenefitsGroup .order-coupon-name {
    color: #1f2937;
    font-size: 0.9rem;
    line-height: 1.35;
}

#orderBenefitsGroup .order-coupon-benefit {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}

#orderBenefitsGroup .order-coupon-benefit-key {
    font-size: 0.88rem;
}

#orderBenefitsGroup .order-coupon-benefit-tail,
#orderBenefitsGroup .order-coupon-meta,
#orderBenefitsGroup .order-coupon-guide {
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 500;
}

#orderBenefitsGroup .order-coupon-guide {
    display: block;
    margin-top: 0.25rem;
    padding-left: 3rem;
}

#orderBenefitsGroup .order-coupon-applied-amount {
    margin-top: 0.05rem;
    color: #dc2626;
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
}

#orderBenefitsGroup .order-coupon-summary {
    margin-top: 0.3rem;
    color: #b91c1c;
    font-size: 0.78rem;
}

#orderBenefitsGroup .order-point-section {
    padding: 0.8rem 0;
}

#orderBenefitsGroup .order-point-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}

#orderBenefitsGroup .order-point-toggle input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #475569;
}

#orderBenefitsGroup .order-point-copy {
    gap: 0.1rem;
}

#orderBenefitsGroup .order-point-copy strong {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.35;
}

#orderBenefitsGroup .order-point-copy small {
    font-size: 0.76rem;
    line-height: 1.4;
}

#orderBenefitsGroup .order-point-available {
    color: #374151;
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
}

#orderBenefitsGroup .order-additional-benefits-label {
    padding-top: 0.75rem;
    border-top: 0;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 700;
}

#orderBenefitsGroup.has-point-benefit .order-additional-benefits-label {
    border-top: 1px solid rgba(55, 65, 81, 0.18);
}

#orderBenefitsGroup .order-token-benefit {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    margin: 0;
    padding: 0.72rem 0;
    border: 0;
}

#orderBenefitsGroup .order-benefit-icon {
    display: inline-flex;
    width: 22px;
    align-items: center;
    justify-content: center;
    color: #4b5563 !important;
}

#orderBenefitsGroup .order-token-benefit-copy {
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 700;
}

#orderBenefitsGroup .order-benefit-status {
    color: #6b7280 !important;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

#orderBenefitsGroup .order-referral-section {
    padding: 0.8rem 0;
}

#orderBenefitsGroup .order-referral-main,
#orderBenefitsGroup .order-referral-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

#orderBenefitsGroup .order-referral-main {
    color: #1f2937;
    font-size: 0.9rem;
    gap: 0.7rem;
}

#orderBenefitsGroup .order-referral-main > i {
    display: inline-flex;
    flex: 0 0 22px;
    width: 22px;
    align-items: center;
    justify-content: center;
}

#orderBenefitsGroup .order-referral-action {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 600;
}

#orderBenefitsGroup .order-referral-action i {
    transition: transform 0.18s ease;
}

#orderBenefitsGroup #orderReferralToggle[aria-expanded="true"] .order-referral-action i {
    transform: rotate(180deg);
}

html[data-theme="dark"] #orderBenefitsGroup :is(.order-coupon-name, .order-point-available, .order-token-benefit-copy, .order-referral-main) {
    color: #f3f4f6 !important;
}

html[data-theme="dark"] #orderBenefitsGroup :is(.order-coupon-benefit-tail, .order-coupon-meta, .order-coupon-guide, .order-additional-benefits-label, .order-benefit-status, .order-referral-action) {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] body #fixedValidityWrap,
html[data-theme="dark"] body #flexibleValidityWrap {
    background: #111827 !important;
    border-color: #111827 !important;
}

html[data-theme="dark"] body #fixedValidityWrap :is(span, strong),
html[data-theme="dark"] body #flexibleValidityWrap :is(span, strong) {
    color: #f3f4f6 !important;
}

.order-coupon-meta {
    color: var(--c-64748b);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.order-coupon-item.is-disabled .order-coupon-main,
.order-coupon-item.is-disabled .order-coupon-benefit,
.order-coupon-item.is-disabled .order-coupon-meta,
.order-coupon-item.is-disabled .order-coupon-kind {
    color: var(--c-94a3b8);
}

.order-coupon-item.is-disabled .order-coupon-benefit-key,
.order-coupon-item.is-disabled .order-coupon-benefit-tail {
    color: var(--c-94a3b8);
}

.order-coupon-reason {
    color: #ef4444;
    font-size: 0.78rem;
    font-weight: 700;
    margin-left: 0.35rem;
}

.order-price-main {
    display: inline-flex;
    align-items: baseline;
    gap: 0.42rem;
    flex-wrap: wrap;
}

.order-price-final {
    display: inline-flex;
    align-items: baseline;
    color: var(--c-4f46e5);
    font-weight: 800;
    line-height: 1.12;
    white-space: nowrap;
}

.order-price-meta {
    display: inline-flex;
    align-items: baseline;
    gap: 0.34rem;
    flex-wrap: wrap;
    margin-top: 0;
    font-size: 0.84em;
    line-height: 1.2;
}

.order-price-discount-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    white-space: nowrap;
}

.order-price-original {
    color: var(--c-64748b);
    text-decoration: line-through;
    font-weight: 700;
    font-size: 0.58em;
    white-space: nowrap;
}

.order-price-discount-note {
    color: #dc2626;
    font-weight: 800;
    white-space: nowrap;
}

.order-price-reward-note {
    color: #059669;
    font-weight: 800;
    white-space: nowrap;
}

.mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--b-c7d2fe);
    background: var(--bg-soft);
    color: var(--c-4338ca);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--b-dbeafe);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: #10b981 !important;
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-dark);
    border-color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* ===== App Layout ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height, 70px);
}

/* ===== Sidebar ===== */
.sidebar {
    width: 300px;
    background: transparent;
    border-right: none;
    padding: calc(var(--spacing-xl) + 0.25rem);
    padding-bottom: 0.35rem;
    position: fixed;
    top: calc(70px + var(--spacing-xl));
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1200;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    top: var(--header-height, 70px);
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: 2400;
    display: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--spacing-md);
    right: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-sm);
    pointer-events: none;
    z-index: 0;
}

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

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 0.25rem;
    padding-bottom: var(--spacing-md);
}

.sidebar-item { 
    margin-bottom: 0.15rem !important;
    
    width: 100%;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0.55rem 0.85rem !important;
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    justify-content: flex-start;
    text-align: left;
    width: 100%;
    flex-wrap: nowrap;
}

#profileMenuItem .sidebar-link-text {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.3rem;
    flex-wrap: nowrap;
}

.sidebar-2fa-warning {
    display: inline;
    margin: 0;
    color: #ef4444;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.1;
}

.sidebar-link.active .sidebar-2fa-warning {
    color: #ffffff;
}

#levelTestLink {
    display: flex !important;
    align-items: center;
    padding-left: 0.85rem !important;
    padding-right: 0.95rem !important;
    text-align: left;
    width: 100%;
}

#levelTestLink>div {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
}

#levelTestLink i,
#levelTestLink span {
    line-height: 1.2;
}

#levelTestMenuText {
    text-align: left;
}

.leveltest-assigned-card {
    position: relative;
    color: #ffffff;
    line-height: 1.6;
    text-align: center;
    padding: 0.5rem 0;
}

.leveltest-assigned-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.leveltest-assigned-date {
    font-size: 0.95rem;
    font-weight: 600;
}

.leveltest-assigned-message {
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.leveltest-assigned-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.leveltest-assigned-status-row .leveltest-assigned-message {
    margin-top: 0;
}

.leveltest-assigned-inquiry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.24rem;
    min-height: 28px;
    padding: 0.24rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    background: #ffffff;
    color: #991b1b;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
}

.leveltest-assigned-inquiry:hover {
    background: #fef2f2;
}

.leveltest-assigned-card.is-expired .leveltest-assigned-inquiry {
    border-color: #ffc235;
    background: #ffc235;
    color: #111827;
}

.leveltest-assigned-card.is-expired .leveltest-assigned-inquiry:hover {
    background: #ffe18a;
}

.leveltest-assigned-card.is-expired {
    color: #ffc235;
}

.leveltest-assigned-close {
    position: absolute;
    top: -0.35rem;
    right: -0.15rem;
    width: 1.4rem;
    height: 1.4rem;
    border: none;
    background: transparent;
    color: #ffc235;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.leveltest-assigned-close:hover {
    color: #ffe18a;
}

.leveltest-status {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    line-height: 1.4;
}

.leveltest-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--c-1f2937);
}

.leveltest-status-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: #92400e;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 0.5rem;
    padding: 0.2rem 0.55rem;
    align-self: flex-start;
}

.leveltest-status-message {
    font-size: 0.75rem;
    color: var(--c-4b5563);
}

.leveltest-complete-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.55rem 0;
    color: var(--c-111827);
    position: relative;
    overflow: hidden;
}

.leveltest-complete-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.leveltest-complete-icon {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--c-111827);
    flex-shrink: 0;
}

.leveltest-complete-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--c-111827);
}

.leveltest-complete-desc {
    font-size: 0.78rem;
    color: var(--c-374151);
    line-height: 1.35;
}

.leveltest-complete-btn {
    margin-top: 0.5rem;
    background: #111827;
    color: #fde68a;
    padding: 0.45rem 0.95rem;
    border-radius: 12px;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    align-self: center;
    box-shadow: none;
}

.sidebar-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: #10b981 !important;
    color: white;
}

.sidebar-time {
    margin-top: 0.5rem;
    padding: 0.55rem 0.85rem !important;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.sidebar-time-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.sidebar-time-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.sidebar-time-zone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--c-4f46e5);
    font-size: 0.7rem;
    font-weight: 600;
}

.sidebar-time-change {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--c-4f46e5);
    background: transparent;
    border: 1px solid rgba(79, 70, 229, 0.35);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    transition: all var(--transition-fast);
}

.sidebar-time-change:hover {
    background: rgba(79, 70, 229, 0.08);
}

.sidebar-time-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.sidebar-time-date {
    margin-top: 0.2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sidebar-language {
    margin-top: 0.5rem;
    margin-bottom: 4px;
    padding: 0.4rem var(--spacing-md);
    background: var(--bg-white);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.sidebar-language-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.sidebar-language select {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg-card);
    color: var(--c-111827);
    cursor: pointer;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: 300px;
    padding: var(--spacing-xl);
    padding-left: var(--spacing-sm);
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

/* 오늘수업내역 박스(캘린더와 분리된 별도 카드): 헤더 하단 구분선·여백 제거 → 깔끔한 단독 박스 */
.today-class-card .card-header {
    border-bottom: none;
    margin-bottom: 0;
}

.orders-header-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.orders-analytics-trigger {
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: linear-gradient(135deg, #eff6ff, var(--b-dbeafe));
    color: var(--c-1d4ed8);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
}

.orders-analytics-trigger:hover {
    background: linear-gradient(135deg, var(--b-dbeafe), #bfdbfe);
    color: #1e40af;
}

.orders-analytics-panel {
    width: min(1080px, 96vw);
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.orders-analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.3rem 1.5rem 1.15rem;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 55%, #ecfeff 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    cursor: move;
}

.orders-analytics-heading {
    min-width: 0;
}

.orders-analytics-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--c-1d4ed8);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.orders-analytics-heading h3 {
    margin: 0.7rem 0 0.25rem;
    color: var(--c-0f172a);
    font-size: 1.35rem;
    font-weight: 800;
}

.orders-analytics-heading p {
    margin: 0;
    color: var(--c-475569);
    font-size: 0.94rem;
    line-height: 1.55;
}

.orders-analytics-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 14px;
    background: #0f172a;
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.orders-analytics-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.15rem 1.35rem 1.4rem;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 26%),
        linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.orders-analytics-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr)) auto;
    gap: 0.85rem;
    align-items: end;
}

.orders-analytics-field {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.orders-analytics-field span {
    color: var(--c-334155);
    font-size: 0.84rem;
    font-weight: 700;
}

.orders-analytics-field .form-control {
    min-height: 48px;
    background: var(--bg-card);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.orders-analytics-field-settlement {
    max-width: 170px;
}

.orders-analytics-actions {
    display: flex;
    justify-content: flex-end;
}

.orders-analytics-submit {
    min-width: 124px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.orders-analytics-summary {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.orders-analytics-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.orders-analytics-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.58rem 0.88rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: var(--c-334155);
    font-size: 0.82rem;
}

.orders-analytics-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.orders-analytics-card,
.orders-analytics-loading-card {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.orders-analytics-card-accent {
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
    border-color: rgba(30, 64, 175, 0.18);
}

.orders-analytics-card-accent .orders-analytics-card-label,
.orders-analytics-card-accent .orders-analytics-card-value,
.orders-analytics-card-accent .orders-analytics-card-meta,
.orders-analytics-card-accent .orders-analytics-card-meta-label {
    color: #ffffff;
}

.orders-analytics-card-label {
    color: var(--c-64748b);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.orders-analytics-card-value {
    color: var(--c-0f172a);
    font-size: 1.38rem;
    font-weight: 800;
    line-height: 1.25;
    word-break: break-word;
}

.orders-analytics-card-value-text {
    font-size: 1.03rem;
    line-height: 1.45;
}

.orders-analytics-card-meta {
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 700;
}

.orders-analytics-card-meta-label {
    color: var(--c-94a3b8);
    font-size: 0.74rem;
    font-weight: 700;
}

.student-refund-modal {
    position: relative;
    width: min(980px, 94vw);
    max-width: 94vw;
    height: min(760px, 90vh);
    min-width: 720px;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 22px;
    border: 1px solid var(--b-dbe4f0);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.student-refund-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--b-dbe4f0);
    cursor: move;
}

.student-refund-modal-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--c-0f172a);
    line-height: 1.25;
}

.student-refund-modal-subtitle {
    margin-top: 0.22rem;
    font-size: 0.84rem;
    color: var(--c-64748b);
}

.student-refund-modal-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.student-refund-modal-body {
    flex: 1;
    min-height: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    background: var(--bg-soft);
}

.student-refund-group {
    position: relative;
    border: 1px solid var(--b-dbe4f0);
    border-radius: 18px;
    background: transparent;
    padding: 1.1rem 1rem 1rem;
}

.student-refund-group-title {
    position: absolute;
    top: -0.58rem;
    left: 0.9rem;
    padding: 0 0.42rem;
    background: var(--bg-soft);
    color: var(--c-0f172a);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.student-refund-policy-headline {
    font-size: 1rem;
    font-weight: 800;
    color: var(--c-1d4ed8);
    line-height: 1.6;
}

.student-refund-policy-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}

.student-refund-policy-link {
    flex-shrink: 0;
    border: 1px solid #16a34a;
    background: #16a34a;
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.35rem 0.62rem;
    cursor: pointer;
}

.student-refund-policy-link:hover,
.student-refund-policy-link:focus-visible {
    border-color: #15803d;
    background: #15803d;
    color: #ffffff;
}

.student-refund-policy-desc {
    margin-top: 0.35rem;
    font-size: 0.86rem;
    color: var(--c-475569);
    line-height: 1.65;
}

.student-refund-breakdown-list {
    display: flex;
    flex-direction: column;
}

.student-refund-breakdown-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(110px, 0.55fr) minmax(0, 1.35fr);
    gap: 0.85rem;
    align-items: start;
    padding: 0.72rem 0;
    border-top: 1px solid var(--b-e5e7eb);
}

.student-refund-breakdown-row:first-child {
    border-top: none;
}

.student-refund-breakdown-label {
    font-weight: 700;
    color: var(--c-0f172a);
}

.student-refund-breakdown-amount {
    font-weight: 900;
    color: var(--c-1d4ed8);
    text-align: right;
}

.student-refund-breakdown-description {
    font-size: 0.84rem;
    color: var(--c-64748b);
    line-height: 1.6;
}

.student-refund-textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    border: 1px solid var(--b-cbd5e1);
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    font-size: 0.92rem;
    line-height: 1.65;
    box-sizing: border-box;
    background: var(--bg-card);
    color: var(--c-0f172a);
}

.student-refund-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.95rem 1rem;
    margin: 0;
    border-top: 1px solid var(--b-dbe4f0);
    background: var(--bg-card);
    flex-shrink: 0;
}

.student-refund-amount {
    font-size: 1.08rem;
    font-weight: 900;
    color: var(--c-1d4ed8);
}

.student-refund-amount-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

.student-refund-amount-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--c-475569);
}

.student-refund-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.student-refund-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 120200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.student-refund-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.student-refund-confirm-panel {
    position: relative;
    z-index: 1;
    width: min(440px, 94vw);
    border-radius: 20px;
    background: var(--bg-card);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.22);
    padding: 1.4rem 1.25rem 1.2rem;
    text-align: center;
}

.student-refund-confirm-icon {
    font-size: 2.3rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.student-refund-confirm-title {
    font-size: 1.18rem;
    font-weight: 900;
    color: var(--c-0f172a);
    margin-bottom: 0.5rem;
}

.student-refund-confirm-message {
    color: var(--c-475569);
    font-size: 0.94rem;
    line-height: 1.68;
    white-space: pre-line;
}

.student-refund-confirm-actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 1.15rem;
}

.student-refund-confirm-actions button {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 0.8rem 0.95rem;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
}

.student-refund-confirm-cancel {
    background: var(--b-e2e8f0);
    color: var(--c-0f172a);
}

.student-refund-confirm-yes,
.student-refund-confirm-process {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
}

.student-refund-confirm-advanced {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 0.24s ease, opacity 0.2s ease, transform 0.2s ease, margin-top 0.2s ease;
    margin-top: 0;
}

.student-refund-confirm-advanced.active {
    max-height: 240px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 1rem;
}

.student-refund-confirm-help {
    color: var(--c-475569);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.55;
    margin-bottom: 0.7rem;
}

.student-refund-confirm-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--b-cbd5e1);
    border-radius: 14px;
    padding: 0.82rem 0.95rem;
    font-size: 0.96rem;
    line-height: 1.4;
    text-align: center;
    color: var(--c-0f172a);
    background: var(--bg-soft);
}

.student-refund-confirm-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.student-refund-history-item {
    border: 1px solid var(--b-dbe4f0);
    border-radius: 18px;
    background: var(--bg-card);
    padding: 1rem 1.05rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.student-refund-history-entry {
    position: relative;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.15rem 0.05rem 0.2rem;
}

.student-refund-history-item .student-refund-group-title {
    background: var(--bg-card);
}

.student-refund-history-entry .student-refund-group-title {
    background: var(--bg-soft);
}

.student-refund-history-item .student-refund-group,
.student-refund-history-entry .student-refund-group {
    clear: both;
    margin-top: 1.12rem;
    padding-top: 1.05rem;
}

.student-refund-history-policy-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.58;
    padding-right: 8.1rem;
    color: var(--c-0f172a);
}

.student-refund-history-amount {
    font-size: 1.32rem;
    font-weight: 900;
    color: var(--c-1d4ed8);
}

.student-refund-history-amount-wrap {
    float: right;
    margin-top: -2.16rem;
    margin-left: 0.85rem;
    min-width: 7.4rem;
}

.student-refund-history-date {
    margin: 0;
    font-size: 0.82rem;
    color: var(--c-64748b);
    line-height: 1.45;
    font-weight: 600;
    margin-top: 0.14rem;
}

.student-refund-history-item .student-refund-history-desc,
.student-refund-history-entry .student-refund-history-desc {
    margin-top: 1.95rem;
    margin-bottom: 1.9rem;
}

.student-refund-history-meta {
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: var(--c-475569);
    line-height: 1.65;
}

@media (max-width: 768px) {
    .student-refund-modal {
        min-width: 0;
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        min-height: 0;
        border-radius: 18px;
    }

    .student-refund-breakdown-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .student-refund-breakdown-amount {
        text-align: left;
    }

    .student-refund-footer,
    .student-refund-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .student-refund-confirm-actions {
        flex-direction: column;
    }
}

.orders-analytics-loading-card {
    align-items: center;
    justify-content: center;
    flex-direction: row;
    min-height: 84px;
    color: var(--c-475569);
    font-weight: 700;
}

.orders-analytics-chart-shell {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 22px;
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.orders-analytics-chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

.orders-analytics-chart-heading {
    min-width: 0;
}

.orders-analytics-chart-title {
    color: var(--c-0f172a);
    font-size: 1rem;
    font-weight: 800;
}

.orders-analytics-chart-subtitle {
    margin-top: 0.18rem;
    color: var(--c-64748b);
    font-size: 0.82rem;
    line-height: 1.45;
}

.orders-analytics-mode-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem;
    border-radius: 999px;
    background: var(--b-e2e8f0);
}

.orders-analytics-mode-btn {
    border: none;
    background: transparent;
    color: var(--c-475569);
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.orders-analytics-mode-btn.active {
    background: var(--bg-card);
    color: var(--c-1d4ed8);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.orders-analytics-chart-panel {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border: 1px solid rgba(191, 219, 254, 0.95);
    padding: 0.9rem;
}

.orders-analytics-chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.25rem;
}

.orders-analytics-chart {
    min-height: 380px;
}

.orders-analytics-svg {
    display: block;
    min-width: 100%;
}

.orders-analytics-grid-line {
    stroke: rgba(148, 163, 184, 0.24);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.orders-analytics-axis-line {
    stroke: rgba(51, 65, 85, 0.42);
    stroke-width: 1.2;
}

.orders-analytics-axis-label,
.orders-analytics-x-label {
    fill: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.orders-analytics-bar {
    fill: url(#ordersAnalyticsBarFill);
    filter: drop-shadow(0 10px 18px rgba(37, 99, 235, 0.18));
}

.orders-analytics-line-area {
    fill: url(#ordersAnalyticsAreaFill);
}

.orders-analytics-line-path {
    fill: none;
    stroke: #2563eb;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.orders-analytics-line-point {
    fill: #ffffff;
    stroke: #2563eb;
    stroke-width: 3;
    filter: drop-shadow(0 6px 14px rgba(37, 99, 235, 0.22));
}

.orders-analytics-empty,
.orders-analytics-error {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: var(--c-64748b);
    font-weight: 700;
    text-align: center;
}

.orders-analytics-empty i {
    font-size: 1.5rem;
    color: var(--c-94a3b8);
}

.orders-analytics-tooltip {
    position: absolute;
    z-index: 3;
    min-width: 220px;
    max-width: 280px;
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.94);
    color: #ffffff;
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.34);
    pointer-events: none;
}

.orders-analytics-tooltip-title {
    font-size: 0.96rem;
    font-weight: 800;
}

.orders-analytics-tooltip-period {
    margin-top: 0.18rem;
    color: rgba(226, 232, 240, 0.92);
    font-size: 0.76rem;
    line-height: 1.45;
}

.orders-analytics-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    margin-top: 0.48rem;
    font-size: 0.82rem;
}

.orders-analytics-tooltip-row strong {
    font-size: 0.85rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-control {
    width: 100%;
    padding: 0.55rem 0.85rem !important;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder,
.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
}

.orders-table-container {
    overflow-x: auto;
}

.orders-table {
    border: 1px solid var(--b-e5e7eb);
    table-layout: fixed;
}

.orders-table th,
.orders-table td {
    border: 1px solid var(--b-e5e7eb);
    text-align: left;
    vertical-align: middle;
}

.orders-table th {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: none;
}

.orders-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

@media (min-width: 769px) {
    .orders-table th.orders-col-no,
    .orders-table td.orders-col-no {
        width: 5%;
        min-width: 54px;
        white-space: nowrap;
    }

    .orders-table th.orders-col-time,
    .orders-table td.orders-col-time {
        width: 7%;
        min-width: 86px;
        white-space: nowrap;
    }

    .orders-table th.orders-col-amount,
    .orders-table td.orders-col-amount {
        width: 11%;
        min-width: 132px;
    }

    .orders-table th.orders-col-receipt,
    .orders-table td.orders-col-receipt {
        width: 18%;
        min-width: 300px;
        white-space: normal;
    }
}

.order-action-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    white-space: normal;
    justify-content: flex-start;
    text-align: left;
}

.order-action-buttons .btn {
    white-space: nowrap;
}

.ai-apps-card {
    overflow: hidden;
}

.ai-apps-card-header {
    align-items: flex-start;
    gap: 1rem;
}

.ai-apps-title-block {
    flex: 1;
    min-width: 240px;
}

.ai-apps-title-block h3 {
    margin-bottom: 0;
    line-height: 1.25;
}

.ai-apps-header-note {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.ai-apps-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ai-apps-help-list {
    margin: 1rem 0 0;
    padding: 0 1rem 0 1.6rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    text-align: left;
}

.ai-apps-help-list li::marker {
    color: var(--primary);
    font-size: 1.15em;
    font-weight: 800;
}

.ai-apps-table-container {
    margin: 0;
    padding: 0;
}

.ai-token-point-card {
    width: min(92vw, 460px);
    margin: 0 auto;
    padding: 1.45rem;
    background: #ffffff;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border);
    border-radius: 1.1rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
    color: var(--text-primary);
}

.ai-token-point-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: -1.45rem -1.45rem 1.1rem;
    padding: 1.25rem 1.35rem;
    background: #10b981;
    border-radius: 1.1rem 1.1rem 0 0;
    color: #ffffff;
}

.ai-token-point-header h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

.ai-token-point-header p {
    margin: 0.45rem 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    line-height: 1.55;
}

.ai-token-point-close {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    aspect-ratio: 1;
    flex: 0 0 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.ai-token-point-close:hover {
    background: rgba(255, 255, 255, 0.26);
}

.ai-token-point-balance,
.ai-token-point-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--bg-soft);
}

.ai-token-point-balance span,
.ai-token-point-result span,
.ai-token-point-field span {
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 700;
}

.ai-token-point-balance strong,
.ai-token-point-result strong {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 900;
}

.ai-token-point-field {
    display: grid;
    gap: 0.45rem;
    margin: 0.9rem 0;
}

.ai-token-point-field input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.85rem 1rem;
    background: #ffffff;
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 800;
    outline: none;
}

.ai-token-point-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.ai-token-point-notice {
    margin: 0.85rem 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.ai-token-point-error {
    min-height: 1.25rem;
    margin: 0.55rem 0 0.75rem;
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 700;
}

.ai-token-point-submit {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1rem;
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.ai-token-point-card .ai-token-point-submit {
    background: #10b981 !important;
    border-color: #10b981 !important;
}

#modalOverlay .ai-token-point-card .ai-token-point-submit {
    background: #10b981 !important;
    border-color: #10b981 !important;
}

.ai-token-point-card .ai-token-point-submit:hover:not(:disabled) {
    background: #059669 !important;
    border-color: #059669 !important;
}

#modalOverlay .ai-token-point-card .ai-token-point-submit:hover:not(:disabled) {
    background: #059669 !important;
    border-color: #059669 !important;
}

.ai-token-point-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (min-width: 1200px) {

    .ai-apps-card .card-header,
    .ai-apps-card .table-container,
    .ai-apps-card>p {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

.ai-apps-table {
    border: 1px solid var(--b-e5e7eb);
    table-layout: fixed;
}

.ai-apps-table th,
.ai-apps-table td {
    border: 1px solid var(--b-e5e7eb);
    text-align: left;
    vertical-align: middle;
}

.ai-apps-table th {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: none;
}

.ai-apps-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

@media (min-width: 769px) {
    .ai-apps-table th:nth-child(3),
    .ai-apps-table td[data-label="validity_period"] {
        width: 240px;
        min-width: 240px;
        white-space: nowrap;
    }
}

.chat-layout {
    position: relative;
    flex: 1;
    display: flex;
    overflow: hidden;
}

.chat-page-card {
    height: calc(100vh - 70px - var(--spacing-xl) - 10px);
    margin-bottom: 0;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-admin-contact-btn {
    border: 1px solid var(--b-c7d2fe);
    background: var(--bg-soft);
    color: var(--c-4338ca);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all var(--transition-fast);
}

.chat-admin-contact-btn:hover {
    background: #e0e7ff;
    border-color: var(--b-a5b4fc);
}

.chat-admin-contact-btn:active {
    transform: translateY(1px);
}

.chat-admin-notice {
    position: sticky;
    top: 0.2rem;
    z-index: 2;
    margin: 0 auto 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: #fef9c3;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    display: flex;
    justify-content: center;
    max-width: calc(100% - 2rem);
    white-space: normal;
    text-align: center;
}

.chat-list-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--b-c7d2fe);
    background: var(--bg-soft);
    color: var(--c-4338ca);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-list-toggle:hover {
    background: var(--b-dbeafe);
    border-color: var(--b-a5b4fc);
}

.chat-toggle-desktop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.chat-toggle-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.chat-list-panel {
    width: 280px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    transition: transform var(--transition-normal);
}

.chat-list-overlay {
    display: none;
}

.chat-messages-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-soft);
    position: relative;
}

#chatTranslateToggle.chat-translate-popup {
    position: absolute;
    right: 0.75rem;
    bottom: 88px;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.chat-translate-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.chat-translate-label input {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

#chatInputArea {
    background: transparent !important;
    border-top: none !important;
    margin-bottom: 0;
    position: relative;
}

.chat-ai-footer {
    margin-top: auto;
    margin-bottom: 0;
}

#chatInputArea .chat-attach-button {
    background: var(--bg-soft) !important;
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
}

#chatInputArea .chat-input-field {
    background: var(--bg-soft) !important;
    height: 48px;
    border-radius: 1.5rem;
}

#chatInputArea .chat-send-button {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
}

#chatInputArea>div {
    gap: 0.3rem;
}

.class-type-grid {
    align-items: stretch;
}

.class-type-grid>label {
    display: block;
    height: 100%;
}

.class-type-card {
    height: 100%;
    min-height: 140px;
}

#orderFormModal .order-class-details {
    background: #f8fafc;
}

#orderFormModal .order-class-details select,
#orderFormModal #preferredDaysGroupModal > div > label {
    background: #f1f5f9 !important;
}

html[data-theme="dark"] #orderFormModal .order-class-details {
    background: var(--bg-soft);
}

html[data-theme="dark"] #orderFormModal .order-class-details select,
html[data-theme="dark"] #orderFormModal #preferredDaysGroupModal > div > label {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

#categoryLevelBadge {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    overflow: hidden;
    white-space: nowrap;
}

#categoryLevelText {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    background: #F9FAFB !important;
}

thead {
    background: #F9FAFB !important;
}

tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.chat-badge {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    box-sizing: border-box;
}

.chat-badge.show {
    display: flex;
}

.sidebar-link .chat-badge {
    margin-left: auto;
}

.sidebar-counsel-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}


/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay#modalOverlay {
    z-index: 3000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

#simpleLevelTestModal .simple-leveltest-panel {
    width: min(48vw, 920px) !important;
    max-width: 920px !important;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* ===== QR Frame ===== */
.qr-frame {
    border: 1px solid var(--qr-border, var(--border));
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--qr-ink, var(--text-secondary));
    box-sizing: border-box;
}

.qr-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-frame canvas {
    width: 100%;
    height: 100%;
}

.qr-placeholder {
    font-size: var(--qr-icon-size, 2.5rem);
    color: var(--qr-muted, var(--text-muted));
}

.qr-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.qr-fallback small {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.75;
}

.qr-fallback i {
    font-size: 1.35rem;
}

.uid-ellipsis {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Calendar ===== */
.calendar {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.calendar-nav-btn:hover {
    background: #10b981 !important;
    color: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.calendar-day:hover {
    background: var(--bg-darker) !important;
    color: var(--text-primary) !important;
    box-shadow: inset 0 0 0 2px #0ea5e9 !important;
    cursor: pointer;
}

.calendar-day.today {
    border: 2px solid var(--primary);
}

.calendar-day.selected {
    background: #10b981 !important;
    color: white;
}

.calendar-day.disabled {
    color: var(--text-muted);
    pointer-events: none;
}

/* ===== Loading Spinner ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
}

.main-content > .loading {
    position: fixed;
    top: 50%;
    left: calc(300px + ((100vw - 300px) / 2));
    z-index: 13000;
    width: 40px;
    height: 40px;
    padding: 0;
    transform: translate(-50%, -50%);
}

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

body.class-history-loading-active .main-content {
    position: relative;
    min-height: calc(100dvh - (var(--spacing-xl) * 2));
}

body.class-history-loading-active .main-content > * {
    visibility: hidden;
    pointer-events: none;
}

body.class-history-loading-active .main-content::after {
    content: '';
    position: fixed;
    top: 50%;
    left: calc(300px + ((100vw - 300px) / 2));
    z-index: 13020;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: classHistoryContentSpin 1s linear infinite;
}

body.class-history-loading-active .floating-chat-container {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .main-content > .loading {
        left: 50%;
    }

    body.class-history-loading-active .main-content::after {
        left: 50%;
    }
}

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

@keyframes classHistoryContentSpin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===== Alerts ===== */
.alert {
    padding: 0.55rem 0.85rem !important;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ===== Class Cards ===== */
.class-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-fast);
}

.class-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.class-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.class-card-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.class-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.class-card-info i {
    color: var(--primary);
    margin-right: 0.25rem;
}

/* ===== Profile Section Styles ===== */
.profile-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.profile-header {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.profile-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.profile-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.profile-avatar-clickable {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.profile-avatar-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.24);
}

.profile-avatar-info h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.profile-pass-btn {
    background: #0f172a;
    color: #f8fafc;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.profile-pass-btn:hover {
    background: #1e293b;
}

.profile-avatar-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.profile-avatar-btn {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-avatar-btn:hover {
    background: #10b981 !important;
    color: white;
}

.password-sticker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.password-sticker-card {
    width: min(520px, 94vw);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 22px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.24);
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 1.25rem 1.35rem 1.35rem;
}

.password-sticker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.password-sticker-title {
    font-size: 1.16rem;
    font-weight: 800;
    color: var(--text-primary);
}

.password-sticker-subtitle {
    margin-top: 0.35rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.password-sticker-close {
    width: 38px;
    height: 38px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.18s ease;
}

.password-sticker-close:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.22);
    color: var(--primary);
}

.password-sticker-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.password-form-group label {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
    font-size: 0.86rem;
}

.password-form-group input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.82rem 0.92rem;
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.password-form-group input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.48);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.password-hint {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.password-hint.success {
    color: var(--success);
}

.password-hint.warning {
    color: var(--warning);
}

.password-check-strength {
    display: flex;
    gap: 6px;
    margin-top: 0.55rem;
}

.password-check-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    transition: background 0.2s ease;
}

.password-check-bar.active {
    background: var(--danger);
}

.password-check-bar.medium {
    background: var(--warning);
}

.password-check-bar.strong {
    background: var(--success);
}

.password-validation-list {
    list-style: none;
    margin-top: 0.6rem;
    padding: 0;
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.95rem;
}

.password-validation-list li {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.password-validation-list li::before {
    content: '○';
    font-size: 0.82em;
}

.password-validation-list li.valid {
    color: var(--success);
    font-weight: 600;
}

.password-validation-list li.valid::before {
    content: '✓';
}

.password-match-line {
    display: block;
    min-height: 1.1rem;
    margin-top: 0.5rem;
    font-size: 0.84rem;
}

.password-match-line.form-success {
    color: var(--success);
    font-weight: 600;
}

.password-match-line.form-error {
    color: #dc2626;
    font-weight: 600;
}

.password-sticker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.password-sticker-cancel {
    background: var(--bg-card);
    border: 1px solid rgba(203, 213, 225, 0.95);
    color: var(--c-334155);
    padding: 0.72rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.password-sticker-cancel:hover {
    border-color: rgba(148, 163, 184, 0.85);
    background: rgba(248, 250, 252, 0.95);
}

.password-sticker-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    color: #ffffff;
    padding: 0.72rem 1.15rem;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.password-sticker-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(99, 102, 241, 0.28);
}

@media (max-width: 640px) {
    .password-sticker-card {
        width: min(100%, 96vw);
        padding: 1rem;
        border-radius: 18px;
    }

    .password-validation-list {
        flex-direction: column;
        gap: 0.4rem;
    }

    .password-sticker-actions {
        flex-direction: column-reverse;
    }

    .password-sticker-cancel,
    .password-sticker-submit {
        width: 100%;
    }
}

.profile-form-group {
    margin-bottom: var(--spacing-lg);
}

.profile-form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

.profile-form-group input,
.profile-form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.profile-form-group input:focus,
.profile-form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: var(--bg-card);
}

.profile-form-group input[readonly] {
    background: var(--bg-dark);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.profile-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border);
    margin-top: var(--spacing-xl);
}

.profile-actions .btn-cancel {
    padding: 0.75rem 1.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-actions .btn-cancel:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.profile-actions .btn-save {
    padding: 0.75rem 1.5rem;
    background: #10b981 !important;
    border: none;
    color: white;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.profile-actions .btn-save:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.profile-consent-fieldset {
    margin: 0;
    padding: 0.95rem 0.95rem 0.9rem;
    border: 1px solid #d6deef;
    border-radius: 14px;
    background: linear-gradient(180deg, #fdfefe 0%, #f8fbff 100%);
}

.profile-consent-fieldset legend {
    padding: 0 0.5rem;
    margin-left: 0.25rem;
    color: var(--c-334155);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.profile-consent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.15rem;
}

.profile-consent-item {
    display: flex;
    align-items: center;
    gap: 0.58rem;
    min-height: 46px;
    padding: 0.68rem 0.82rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--b-e3e8f5);
    border-radius: 12px;
    background: var(--bg-card);
}

.profile-consent-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.profile-security-fieldset .profile-security-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    min-height: 46px;
    padding: 0.68rem 0.82rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--b-e3e8f5);
    border-radius: 12px;
    background: var(--bg-card);
}

.profile-security-fieldset .profile-security-title {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.45;
}

.profile-security-fieldset .profile-security-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0.32rem;
}

.profile-security-fieldset .profile-security-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: var(--text-primary);
    font-weight: 600;
}

.profile-security-fieldset .profile-security-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.profile-security-fieldset .profile-security-warning {
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}


.account-link-card {
    margin-top: var(--spacing-xl);
}

.account-link-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--b-dce5f4);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.account-link-main {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
    min-width: 0;
}

.account-link-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--b-dce5f4);
    background: var(--bg-card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    flex: 0 0 44px;
}

.account-link-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.account-link-icon i {
    font-size: 1.18rem;
    color: var(--c-334155);
}

.account-link-text {
    min-width: 0;
}

.account-link-text h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-link-email {
    margin-left: 0.28rem;
    color: var(--c-64748b);
    font-size: 0.9em;
    font-weight: 500;
}

.account-link-meta {
    margin: 0.15rem 0 0;
    color: #6b7a90;
    font-size: 0.82rem;
    line-height: 1.2;
}

.account-link-delete {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #dc2626;
    font-weight: 700;
    font-size: 0.84rem;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.account-link-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.account-link-delete:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

    .profile-form-group,
    .profile-security-fieldset {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .profile-security-fieldset {
        min-inline-size: 0;
    }

    .profile-security-fieldset .profile-security-item {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        column-gap: 0.65rem;
        row-gap: 0.45rem;
    }

    .profile-security-fieldset .profile-security-title {
        flex: 1 1 0;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .profile-security-fieldset .profile-security-right {
        display: contents;
    }

    .profile-security-fieldset .profile-security-toggle {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .profile-security-fieldset .profile-security-warning {
        flex: 0 0 100%;
        width: 100%;
        text-align: left;
    }

    .account-link-body {
        flex-wrap: wrap;
    }

    .account-link-delete {
        margin-left: auto;
    }
}

.class-settings-block {
    margin-bottom: var(--spacing-xl);
}

.class-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--border);
}

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

.class-settings-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.class-toggle {
    display: flex;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.class-toggle-btn {
    border: none;
    background: transparent;
    color: var(--c-64748b);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.class-toggle-btn.active {
    background: #fbbf24;
    color: var(--c-111827);
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.35);
}

.class-bg-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.6rem;
}

.class-bg-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 86px;
    min-width: 86px;
    padding: 0.5rem 0.35rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.class-bg-option.active {
    border-color: #7c3aed;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.35);
}

.class-bg-swatch {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--c-111827);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.srs-card-theme-option {
    width: 54px;
    min-width: 54px;
    height: 54px;
    padding: 5px;
    gap: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
}

.srs-card-theme-swatch {
    position: relative;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.srs-card-theme-swatch::before {
    display: none;
}

.srs-card-theme-option.active {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.srs-card-theme-option.active .srs-card-theme-swatch {
    transform: scale(0.88);
    box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 6px #475569;
}

.srs-card-theme-option:focus-visible {
    outline: 3px solid rgba(71, 85, 105, 0.35);
    outline-offset: 2px;
}

.srs-card-theme-row {
    justify-content: center;
}

.srs-card-theme-row .class-bg-options {
    justify-content: center;
    margin-top: 0;
}

.class-bg-label {
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    color: var(--c-334155);
}

.class-settings-save {
    width: 100px;
    min-width: 100px;
    margin-top: 0;
    padding: 0.5rem 0.9rem;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.class-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.class-settings-header > div {
    flex: 1;
}

.top-notice {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #f6d55c;
    color: #111111;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10005;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-width: 0;
    flex: 0 0 auto;
    max-width: 92vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Enhanced Calendar Styles ===== */
.calendar {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
}

.calendar-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-lg);
}

.calendar-header-stack {
    position: relative;
    overflow: visible;
}

.calendar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.calendar-nav-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    justify-content: space-between;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.calendar-nav-btn:hover {
    background: #10b981 !important;
    color: white;
    border-color: var(--primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
}

    .calendar-weekday {
        padding: 0.75rem 0.5rem;
        text-align: center;
        font-weight: 600;
        font-size: 0.95rem;
        color: #ffffff;
        background: var(--calendar-weekday-bg);
        border: none;
        border-radius: var(--radius-sm);
        min-width: 0;
    }

.calendar-day {
    min-height: 90px;
    padding: 0.5rem;
    background: var(--calendar-nav-bg);
    border-radius: var(--radius-md);
    border: none;
    transition: all var(--transition-fast);
    position: relative;
    min-width: 0;
    display: block;
    aspect-ratio: auto;
    overflow: hidden;
}

.calendar-day:hover {
    background: var(--calendar-nav-bg) !important;
    box-shadow: inset 0 0 0 2px #0ea5e9 !important;
    cursor: pointer !important;
}
}

.calendar-day.today {
    border: none;
    box-shadow: inset 0 0 0 2px #488cef;
    background: var(--calendar-nav-bg);
}

.calendar-day.other-month {
    opacity: 0.4;
}

.calendar-day .day-number {
    position: absolute;
    top: 4px;
    left: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    z-index: 1;
}

.calendar-day.has-class {
    background: var(--calendar-nav-bg);
}

.calendar-day .class-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 24px;
    margin-top: 4px;
}

.calendar-day .class-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.55rem;
    padding-left: 2.6rem;
    background: var(--status-color);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: none;
    color: #ffffff;
    min-height: 2rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.calendar-day .class-status-square {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2.2rem;
    height: 100% !important;
    background: var(--status-color); /* Fallback */
    border-radius: 0;
    z-index: 2;
    display: block !important;
}

.calendar-day .class-status-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bg-card) !important;
    display: block;
    z-index: 3;
}

.class-status-row {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: #ffffff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-day .class-item.level-test {
    color: var(--c-1f2937);
    box-shadow: var(--shadow-sm);
}

.calendar-day .class-item.level-test .class-time,
.calendar-day .class-item.level-test .class-status {
    color: inherit !important;
}

.calendar-day .class-type-label {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}



.calendar-day .class-item:hover {
    background: var(--status-color) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: none;
}

.calendar-day .class-item:hover .class-time,
.calendar-day .class-item:hover .class-status {
    color: white !important;
}

.calendar-day .class-time {
    font-weight: 600;
    color: #ffffff;
}

.calendar-day .class-status {
    display: none;
}

.calendar-day .class-status-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.calendar-day .class-item:hover {
    background: var(--status-color) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: none;
}

.calendar-status-legend {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.calendar-status-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.calendar-status-legend .legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: inline-block;
}

.calendar-status-legend .legend-scheduled {
    background: #6366f1;
}

.calendar-status-legend .legend-completed {
    background: #22c55e;
}

.calendar-status-legend .legend-absent {
    background: #ef4444;
}

.calendar-status-legend .legend-today {
    background: #488cef;
}

.calendar-nav-box {
    background: var(--calendar-nav-bg);
    border: none;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
}

.calendar-nav-row {
    background: var(--calendar-nav-bg);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 16px;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.calendar-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--bg-card);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
    flex: 0 0 auto;
}

.calendar-view-toggle button {
    border: none;
    background: transparent;
    color: var(--c-64748b);
    border-radius: 999px;
    min-width: 3.1rem;
    height: 2.1rem;
    padding: 0 0.9rem;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.calendar-view-toggle button.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}

.calendar-period-title {
    display: none;
    min-width: 17rem;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 900;
    color: var(--c-1f2937);
    white-space: nowrap;
}

body.calendar-week-mode #yearSelect,
body.calendar-week-mode #monthSelect {
    display: none;
}

body.calendar-week-mode .calendar-period-title {
    display: none;
}

body.calendar-week-mode #calendarStatusLegend {
    display: none;
}

.calendar-nav-btn {
    background: var(--calendar-accent-blue);
    border: none;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    color: #ffffff;
}

.calendar-nav-btn:hover {
    background: #2563eb;
    color: #ffffff;
}

.calendar-nav-box .form-control {
    background-color: var(--bg-card);
    border: none;
    color: var(--c-111827);
    font-weight: 600;
    padding-right: 2rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%233b82f6'%3E%3Cpath d='M5.75 7.75L10 12l4.25-4.25' stroke='%233b82f6' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 0.7rem;
}

.calendar-status-legend {
    background: var(--calendar-nav-bg);
    border: none;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--c-4b5563);
}

.calendar-status-legend .legend-item {
    background: var(--bg-card);
    border: none;
    border-radius: 10px;
    padding: 0.25rem 1.1rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.calendar-status-legend .legend-today {
    border: none;
}

.calendar.week-view {
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: thin;
}

.calendar.week-view::-webkit-scrollbar {
    height: 10px;
}

.calendar.week-view::-webkit-scrollbar-track {
    background: transparent;
}

.calendar.week-view::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.22);
    border-radius: 6px;
}

.calendar.week-view::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.36);
}

.calendar.week-view .calendar-grid {
    min-width: 896px;
    grid-template-columns: repeat(7, minmax(128px, 1fr));
    align-items: stretch;
}

.calendar.week-view .calendar-weekday {
    background: var(--calendar-weekday-bg);
    color: #ffffff;
    border-radius: var(--radius-sm);
}

.calendar.week-view .calendar-weekday.is-today {
    background: #000000;
    color: #ffffff;
    border-radius: 12px;
}

.calendar.week-view .calendar-day {
    min-height: 330px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 0.25rem;
    overflow: visible;
}

.calendar.week-view .calendar-day:hover {
    background: #eeeeee !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

.calendar.week-view .calendar-day.today {
    box-shadow: none !important;
    border: none !important;
}

.calendar.week-view .calendar-day.today:hover {
    background: #eeeeee !important;
    box-shadow: none !important;
    border: none !important;
}

.calendar.week-view .calendar-weekday-with-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
}

.calendar-weekday-date {
    display: block;
    width: 100%;
    color: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    opacity: 0.88;
}

.calendar.week-view .calendar-day .day-number {
    position: static;
    display: block;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 0 0 0.25rem;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 900;
    text-align: center;
    z-index: 1;
}

.calendar.week-view .calendar-day.today .day-number {
    background: transparent;
    color: #ffffff;
}

.calendar-week-class-items {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    gap: 0.3rem !important;
}

.calendar-week-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 6rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.56);
    color: var(--c-94a3b8);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

.calendar-week-holiday {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 6rem;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    padding: 0.5rem;
}

.calendar-week-class-card {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    margin: 0 3px;
    width: calc(100% - 6px);
    box-sizing: border-box;
    min-width: 0;
    padding: 0.6rem 0.36rem;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.calendar-week-class-card:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.calendar-week-class-items .calendar-week-class-card:first-child {
    margin-top: 0.42rem;
}

.calendar-week-class-card.level-test {
    background: linear-gradient(180deg, #fffdf5, #ffffff);
}

.calendar-week-class-card.fixed-class,
.calendar-week-class-card.free-class {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.calendar-week-class-card.trial-class {
    border-color: #67e8f9;
    background: #ecfeff;
}

.calendar-week-class-main {
    display: grid;
    gap: 0.35rem;
}

.calendar-week-class-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.calendar-week-class-time {
    font-size: 1.02rem;
    font-weight: 950;
    color: var(--c-0f172a);
}

.calendar-week-class-status,
.calendar-week-class-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--c-475569);
    padding: 0.18rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 900;
    white-space: nowrap;
}

.calendar-week-class-card.status-completed .calendar-week-class-status {
    background: #22c55e;
    color: #ffffff;
}

.calendar-week-class-card.status-scheduled .calendar-week-class-status,
.calendar-week-class-card.status-makeup .calendar-week-class-status {
    background: #8a66e5;
    color: #ffffff;
}

.calendar-week-class-card.status-absent .calendar-week-class-status {
    background: #ef4444;
    color: #ffffff;
}

/* 고정/자유 tag sits immediately to the LEFT of the 출석/예정 status,
   both grouped on the right of the row. */
.calendar-week-class-top-right {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.calendar-week-class-type-short {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.16rem 0.45rem;
    font-size: 0.64rem;
    font-weight: 900;
    white-space: nowrap;
    background: #e0e7ff;
    color: var(--c-4338ca);
}
.calendar-week-class-type-short.type-free {
    background: #dcfce7;
    color: #15803d;
}
.calendar-week-class-type-short.type-trial {
    background: #cffafe;
    color: #155e75;
}

.calendar-day .class-item.trial-class {
    border-color: #22d3ee;
    background: #ecfeff;
    color: #155e75;
}
/* 아바타예습 button (replaces the old class-type badge slot). */
.calendar-week-avatar-prep {
    margin-top: 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    border: 1px solid var(--b-c7d2fe);
    border-radius: 8px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: var(--c-4338ca);
    font-size: 0.72rem;
    font-weight: 900;
    padding: 0.34rem 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.calendar-week-avatar-prep:hover {
    background: var(--b-c7d2fe);
}
.calendar-week-avatar-prep:disabled {
    opacity: 0.7;
    cursor: default;
}

.calendar-week-class-teacher {
    color: var(--c-1e293b);
    font-size: 0.9rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-week-class-meta {
    display: grid;
    gap: 0.12rem;
    color: var(--c-334155);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
}

.calendar-week-class-meta span {
    color: var(--c-94a3b8);
    font-size: 0.68rem;
    font-weight: 900;
}

.calendar-week-class-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.calendar-week-action-flow {
    width: 100%;
    min-width: 0;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.calendar-week-action-flow:hover,
.calendar-week-action-flow:focus-within {
    transform: translateY(-1px);
    box-shadow: 0 7px 16px rgba(15, 23, 42, 0.18);
}

.calendar-week-action-flow .calendar-week-action:not(:disabled):hover,
.calendar-week-action-flow .calendar-week-action:not(:disabled):focus-visible {
    transform: none;
    box-shadow: none;
}

.calendar-week-action-flow:hover .calendar-week-action:not(:disabled),
.calendar-week-action-flow:focus-within .calendar-week-action:not(:disabled) {
    filter: saturate(1.08) brightness(0.98);
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-green:not(:disabled),
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-green:not(:disabled) {
    background: #059669;
    color: #ffffff;
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-gray:not(:disabled),
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-gray:not(:disabled) {
    background: var(--b-cbd5e1);
    color: var(--c-475569);
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-purple:not(:disabled),
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-purple:not(:disabled) {
    background: #574872;
    color: #ffffff;
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-yellow:not(:disabled),
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-yellow:not(:disabled) {
    background: #eab308;
    color: var(--c-111827);
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-neutral:not(:disabled),
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-neutral:not(:disabled) {
    background: #334155;
    color: #ffffff;
}

.calendar-week-action-flow:hover .calendar-week-flow-triangle,
.calendar-week-action-flow:focus-within .calendar-week-flow-triangle {
    filter: saturate(1.08) brightness(0.98);
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-green:not(:disabled) + .calendar-week-flow-triangle,
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-green:not(:disabled) + .calendar-week-flow-triangle {
    background: #059669;
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-gray:not(:disabled) + .calendar-week-flow-triangle,
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-gray:not(:disabled) + .calendar-week-flow-triangle {
    background: var(--b-cbd5e1);
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-purple:not(:disabled) + .calendar-week-flow-triangle,
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-purple:not(:disabled) + .calendar-week-flow-triangle {
    background: #574872;
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-yellow:not(:disabled) + .calendar-week-flow-triangle,
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-yellow:not(:disabled) + .calendar-week-flow-triangle {
    background: #eab308;
}

.calendar-week-action-flow:hover .calendar-week-action.cwf-neutral:not(:disabled) + .calendar-week-flow-triangle,
.calendar-week-action-flow:focus-within .calendar-week-action.cwf-neutral:not(:disabled) + .calendar-week-flow-triangle {
    background: #334155;
}

.calendar-week-action,
.calendar-week-class-actions .today-class-avatar-lecture {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: 2.1rem;
    padding: 0 0.45rem;
    border: none;
    border-radius: 0 !important;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    margin-bottom: 2px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.calendar-week-action-flow .calendar-week-action {
    margin-bottom: 0;
}

.calendar-week-action:not(:disabled):hover,
.calendar-week-action:not(:disabled):focus-visible {
    transform: translateY(-1px);
    filter: saturate(1.08) brightness(0.98);
    box-shadow: 0 7px 16px rgba(15, 23, 42, 0.18);
    outline: none;
}

.calendar-week-action.cwf-green:not(:disabled):hover,
.calendar-week-action.cwf-green:not(:disabled):focus-visible,
.calendar-week-prep:not(:disabled):hover,
.calendar-week-prep:not(:disabled):focus-visible,
.calendar-week-makeup:not(:disabled):hover,
.calendar-week-makeup:not(:disabled):focus-visible {
    background: #059669;
    color: #ffffff;
}

.calendar-week-action.cwf-purple:not(:disabled):hover,
.calendar-week-action.cwf-purple:not(:disabled):focus-visible,
.calendar-week-review:not(:disabled):hover,
.calendar-week-review:not(:disabled):focus-visible {
    background: #574872;
    color: #ffffff;
}

.calendar-week-action.cwf-yellow:not(:disabled):hover,
.calendar-week-action.cwf-yellow:not(:disabled):focus-visible,
.calendar-week-postpone:not(:disabled):hover,
.calendar-week-postpone:not(:disabled):focus-visible {
    background: #eab308;
    color: var(--c-111827);
}

.calendar-week-action.cwf-gray:not(:disabled):hover,
.calendar-week-action.cwf-gray:not(:disabled):focus-visible {
    background: var(--b-cbd5e1);
    color: var(--c-475569);
}

.calendar-week-action.cwf-neutral:not(:disabled):hover,
.calendar-week-action.cwf-neutral:not(:disabled):focus-visible {
    background: #334155;
    color: #ffffff;
}

.calendar-week-action.calendar-week-action-spacer {
    visibility: hidden;
    background: transparent !important;
    cursor: default;
    pointer-events: none;
}

/* legacy color classes kept for compatibility */
.calendar-week-prep { background: #10b981; color: #ffffff; }
.calendar-week-postpone { background: #facc15; color: var(--c-1f2937); }
.calendar-week-makeup { background: #22c55e; color: #ffffff; }
.calendar-week-review { background: #685982; color: #ffffff; }

/* new flow color classes */
.cwf-green { background: #10b981; color: #ffffff; }
.cwf-gray  { background: var(--b-e2e8f0); color: var(--c-64748b); }
.cwf-yellow { background: #facc15; color: var(--c-1f2937); }
.cwf-purple { background: #685982; color: #ffffff; }
.cwf-neutral { background: #475569; color: #ffffff; }

.cwf-status { cursor: default !important; pointer-events: none; }
.cwf-status-green { background: #22c55e !important; color: #ffffff !important; }
.cwf-status-gray  { background: var(--b-e2e8f0) !important; color: var(--c-64748b) !important; }
.cwf-status-blue  { background: #8a66e5 !important; color: #ffffff !important; }

.calendar-week-action:disabled,
.calendar-week-action.cwf-gray:disabled {
    background: var(--b-e2e8f0);
    color: var(--c-94a3b8);
    cursor: not-allowed;
}

.calendar-week-action.is-loading,
.calendar-week-action.is-loading:disabled {
    background: #059669 !important;
    color: #ffffff !important;
    opacity: 1;
    cursor: progress;
    filter: none;
    box-shadow: none;
    transform: none;
}

.calendar-week-action.cwf-purple.is-loading,
.calendar-week-action.cwf-purple.is-loading:disabled,
.calendar-week-review.is-loading,
.calendar-week-review.is-loading:disabled {
    background: #574872 !important;
}

.calendar-week-action.cwf-yellow.is-loading,
.calendar-week-action.cwf-yellow.is-loading:disabled,
.calendar-week-postpone.is-loading,
.calendar-week-postpone.is-loading:disabled {
    background: #eab308 !important;
    color: var(--c-111827) !important;
}

.calendar-week-action.is-loading .fa-spinner {
    color: currentColor;
    font-size: 0.92rem;
}

.calendar-week-action-flow.is-loading {
    cursor: progress;
    transform: none;
    filter: none;
}

.calendar-week-action-flow.is-loading .calendar-week-flow-triangle {
    background: #059669 !important;
    filter: none;
}

.calendar-week-action-flow.is-loading .calendar-week-action.cwf-purple + .calendar-week-flow-triangle,
.calendar-week-action-flow.is-loading .calendar-week-review + .calendar-week-flow-triangle {
    background: #574872 !important;
}

.calendar-week-action-flow.is-loading .calendar-week-action.cwf-yellow + .calendar-week-flow-triangle,
.calendar-week-action-flow.is-loading .calendar-week-postpone + .calendar-week-flow-triangle {
    background: #eab308 !important;
}

/* flat downward-pointing triangle — flush against the button above it */
.calendar-week-flow-triangle {
    width: 100%;
    height: 10px;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    margin-top: -2px;
    margin-bottom: 0;
    /* 버튼과 동일한 트랜지션 — 호버/클릭 시 삼각형 색이 버튼과 '동시에' 바뀌어 하나의 화살표처럼 보임.
       (이전엔 삼각형만 트랜지션이 없어 즉시 바뀌고 버튼은 0.16s 페이드 → 색이 어긋나 분리돼 보였음) */
    transition: background-color 0.16s ease, filter 0.16s ease;
}
.cwf-tri-green  { background: #10b981; }
.cwf-tri-gray   { background: var(--b-e2e8f0); }
.cwf-tri-yellow { background: #facc15; }
.cwf-tri-purple { background: #685982; }

.today-class-section {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
}

/* Mobile: keep the banner on a single row, drop the "다음 시작 · ..." sub-line,
   and shrink the right edge so it doesn't overlap the floating chat launcher. */
@media (max-width: 768px) {
    #studentContinueEnrollmentBanner {
        /* Reserve ~96px on the right for the guest-chat launcher (60px + 24px right + margin) */
        left: 12px !important;
        right: 96px !important;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 1700 !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
    }
    #studentContinueEnrollmentBanner .continue-enrollment-banner-inner {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        padding: 0.55rem 0.7rem !important;
    }
    #studentContinueEnrollmentBanner .continue-enrollment-banner-text {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
    #studentContinueEnrollmentBanner .continue-enrollment-banner-next {
        display: none !important;
    }
    #studentContinueEnrollmentBanner .continue-enrollment-banner-message {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.88rem !important;
    }
    #studentContinueEnrollmentBanner .continue-enrollment-banner-btn {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.76rem !important;
        flex: 0 0 auto;
    }
}

.today-class-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.today-class-header.no-title {
    justify-content: flex-end;
}

.today-class-header.no-title .today-class-title {
    display: none;
}

.today-class-header.no-title .today-class-actions-bar {
    margin-left: auto;
    justify-content: flex-end;
}

.today-class-title {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--c-1e293b);
    display: grid;
    grid-template-columns: max-content max-content;
    align-items: center;
    column-gap: 0.55rem;
    row-gap: 0.12rem;
    overflow: visible;
}

.today-class-heading-main {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    white-space: nowrap;
}

.today-class-wallet-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    grid-column: 2;
    grid-row: 1;
    flex: 0 0 auto;
    min-width: 0;
}

.today-class-wallet-divider {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.85), transparent);
}

.today-class-point-wallet {
    flex: 0 0 auto;
    min-height: 24px;
}

.today-class-point-wallet .point-wallet-pill {
    height: 24px;
    padding: 0 0.5rem;
    background: rgba(255, 255, 255, 0.94);
    font-size: 0.72rem;
}

.today-class-title .today-class-date {
    grid-column: 1 / 3;
    grid-row: 2;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-64748b);
    margin-left: 1.85rem;
}

.today-class-title i {
    color: #ef4444;
}

.today-class-date {
    font-size: 0.85rem;
    color: var(--c-64748b);
    font-weight: 600;
}

.today-class-actions-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.today-class-join-quick {
    border: none;
    background: #10b981;
    color: #ffffff;
    padding: 0.65rem 1.5rem;
    min-width: 176px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.today-class-join-quick:hover {
    background: #0f9f73;
}

.today-class-join-quick:disabled {
    background: var(--b-cbd5e1);
    color: var(--c-64748b);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.calendar-action-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.8rem 0.6rem 0.45rem;
    border-radius: 12px;
    border: 1px solid #d7dde6;
    background: var(--bg-card);
    position: relative;
}

#calendarJoinGroup {
    margin-right: auto;
}

.calendar-action-group-title {
    position: absolute;
    top: -0.55rem;
    left: 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--c-64748b);
    background: var(--bg-card);
    padding: 0 0.35rem;
    white-space: nowrap;
}

.today-class-actions-bar button {
    border: none;
    background: #4ea2ee;
    color: #ffffff;
    padding: 0.6rem 1.4rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

#calendarTimeChangeBtn {
    border: none;
    background: #4ea2ee;
    color: #ffffff;
}

#calendarPostponeGuideBtn {
    border: none;
    background: #4ea2ee;
    color: #ffffff;
}

#calendarMakeupGuideBtn {
    border: none;
    background: #4ea2ee;
    color: #ffffff;
}

@media (min-width: 769px) {
    .today-class-actions-bar.calendar-desktop-compact-fixed #calendarPostponeGuideBtn,
    .today-class-actions-bar.calendar-desktop-compact-fixed #calendarMakeupGuideBtn {
        display: none;
    }
}

.today-class-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-soft);
    border: none;
    border-radius: 16px;
    padding: 1rem 1.25rem;
}

.today-class-list.today-class-list-empty {
    min-height: 190px;
    align-items: center;
    justify-content: center;
}

.today-class-empty {
    padding: 0.75rem 0;
    text-align: center;
    color: var(--c-94a3b8);
    font-weight: 600;
}

.today-class-list.today-class-list-empty .today-class-empty {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    color: var(--c-64748b);
}

.today-class-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--b-e2e8f0);
    align-items: flex-start;
}

.today-class-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.today-class-avatar {
    width: 110px;
    height: 150px;
    border-radius: 16px;
    background: var(--b-e2e8f0);
    overflow: hidden;
    flex-shrink: 0;
}

.today-class-avatar-button {
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.today-class-avatar-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.today-class-avatar-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.today-class-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.today-class-body {
    flex: 1 1 360px;
    min-width: min(100%, 260px);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    --today-label-width: 120px;
    --today-label-gap: 40px;
}

.today-class-body::before {
    content: none;
    display: none;
}

.today-class-line {
    display: grid;
    grid-template-columns: var(--today-label-width) 1fr;
    align-items: center;
    column-gap: var(--today-label-gap);
    font-size: 0.92rem;
    color: var(--c-334155);
    padding: 0.15rem 0;
    border-bottom: 1px dotted var(--b-e2e8f0);
}

.today-class-body .today-class-line:last-of-type {
    border-bottom: none;
}

.today-class-label {
    font-weight: 700;
    color: var(--c-7d8694);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.today-class-label::before {
    content: '•';
    color: var(--c-7d8694);
    font-size: 0.9rem;
}

.today-class-value-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: none;
    padding-left: 0;
}

.today-class-value {
    color: var(--c-7d8694);
    font-weight: 600;
    font-size: 0.9rem;
}

.today-class-progress-detail {
    border: none;
    background: transparent;
    color: var(--c-7d8694);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    text-align: left;
}

.today-class-progress-detail:hover .today-class-progress-title,
.today-class-progress-detail:hover .today-class-progress-more {
    color: #10b981;
}

.today-class-progress-title {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-class-progress-more {
    color: #38bdf8;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.today-class-change {
    border: none;
    background: #cfd6e6;
    color: var(--c-374151);
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    transition: background 0.2s;
    line-height: 1;
}

.today-class-change:hover {
    background: #c2cada;
}

.textbook-change-modal {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 900px;
    max-width: 95vw;
}

.textbook-change-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.textbook-change-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-1f2937);
}

.textbook-change-close {
    border: none;
    background: var(--b-e5e7eb);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--c-374151);
}

.textbook-change-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.textbook-change-selects {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.textbook-change-field {
    flex: 1;
    min-width: 200px;
}

.textbook-change-field label {
    display: block;
    margin-bottom: 0.4rem;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 600;
}

.textbook-change-chapter {
    display: flex;
    gap: 0.5rem;
}

.textbook-change-preview {
    padding: 0.6rem 0.9rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.textbook-change-info {
    margin-top: 0.5rem;
    padding: 1rem;
    background: var(--bg-soft);
    border-radius: 12px;
    border: 1px solid var(--b-e2e8f0);
}

.textbook-change-info-inner {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

#previewItemList[data-collapsed="true"] .sidebar-title,
#classDetailItemList[data-collapsed="true"] .sidebar-title {
    opacity: 0 !important;
}

#previewItemList[data-collapsed="true"] .item-content,
#previewItemList[data-collapsed="true"] .item-divider,
#classDetailItemList[data-collapsed="true"] .item-content,
#classDetailItemList[data-collapsed="true"] .item-divider {
    display: none !important;
}

.lesson-drawer-layout {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.lesson-drawer-panel {
    position: absolute !important;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 7;
    width: 300px !important;
    min-width: 300px !important;
    max-width: min(82vw, 300px);
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    box-shadow: 16px 0 34px rgba(15, 23, 42, 0.18);
    transform: translateX(calc(-100% + 56px));
    transition: transform 0.26s ease;
    overflow: hidden;
}

.lesson-drawer-panel[data-collapsed="true"] .sidebar-header {
    justify-content: flex-end !important;
    align-items: center !important;
    padding: 0.75rem 8px !important;
    gap: 0 !important;
    background: transparent !important;
    border-bottom-color: transparent !important;
}

.lesson-drawer-panel[data-collapsed="true"] .sidebar-title {
    display: none !important;
}

.lesson-drawer-panel[data-collapsed="true"] .sidebar-toggle-btn {
    width: 40px !important;
    height: 40px !important;
    margin-top: 0 !important;
    margin-left: auto !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.13) !important;
}

#classDetailItemList[data-collapsed="true"] #itemListContainer,
#previewItemList[data-collapsed="true"] #previewItemListContainer {
    display: block !important;
    padding: 0.45rem 8px 0.7rem !important;
    overflow-y: auto !important;
    scrollbar-width: none;
}

#classDetailItemList[data-collapsed="true"] #itemListContainer::-webkit-scrollbar,
#previewItemList[data-collapsed="true"] #previewItemListContainer::-webkit-scrollbar {
    display: none;
}

#classDetailItemList[data-collapsed="true"] .category-item-btn,
#previewItemList[data-collapsed="true"] .preview-item-btn {
    justify-content: flex-end !important;
    align-items: center !important;
    min-height: 44px !important;
    margin-bottom: 0.42rem !important;
    border-radius: 14px !important;
    overflow: visible !important;
}

.lesson-drawer-panel[data-collapsed="true"] .item-number {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    margin-left: auto !important;
    padding: 0 !important;
    border-radius: 14px !important;
    font-size: 0.82rem !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12) !important;
}

.lesson-drawer-panel.is-open {
    transform: translateX(0);
}

.lesson-drawer-backdrop {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: none;
    border: 0;
    background: rgba(15, 23, 42, 0.06);
    cursor: default;
}

.lesson-drawer-layout.is-drawer-open .lesson-drawer-backdrop {
    display: block;
}

.lesson-drawer-content {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    padding-left: calc(1.5rem + 56px) !important;
}

.learning-material-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.learning-material-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
}

.learning-material-title h4 {
    flex: 0 0 auto;
    white-space: nowrap;
}

.learning-material-title #currentItemTitle,
.learning-material-title > span:not([style*="background"]) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.learning-material-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.learning-material-actions button {
    margin-left: 0 !important;
}

.textbook-change-image {
    width: 140px;
    height: 196px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--b-e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.textbook-change-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-card);
}

.textbook-change-image-placeholder {
    color: var(--c-94a3b8);
    font-size: 2rem;
}

.textbook-change-level {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.textbook-change-info-content p {
    color: var(--c-475569);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.textbook-change-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.textbook-change-save {
    border: none;
    background: #4f46e5;
    color: #ffffff;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.today-class-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    --today-class-action-width: 176px;
    --today-class-step-width: min(620px, 52vw);
    flex: 1 1 var(--today-class-step-width);
    min-width: min(100%, var(--today-class-step-width));
}

.today-class-actions.leveltest-actions {
    align-items: center;
    align-self: center;
}

.today-class-action {
    border-radius: 12px;
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    width: var(--today-class-action-width);
    text-align: center;
}

.today-class-join {
    background: #de605e;
    color: #ffffff;
    box-shadow: none;
}

.today-class-postpone {
    background: #fcce40;
    color: var(--c-1f2937);
    border: none;
}

.today-class-makeup {
    background: #22c55e;
    color: #ffffff;
    border: none;
}

.today-class-detail {
    background: #685982;
    color: #ffffff;
    border: none;
}

.today-class-avatar-lecture {
    display: none;
    align-items: center;
    justify-content: center;
    background: #10b981;
    color: #ffffff;
    border: none;
}

.calendar-week-class-actions .today-class-avatar-lecture.cwf-gray {
    background: var(--b-e2e8f0) !important;
    color: var(--c-64748b) !important;
}
.calendar-week-class-actions .today-class-avatar-lecture.cwf-gray:hover {
    background: var(--b-cbd5e1) !important;
}

.today-class-avatar-lecture:hover {
    background: #059669;
}

.today-class-step-wrap {
    align-self: stretch;
    justify-content: center;
}

.today-class-step-flow {
    --today-class-step-slant: 24px;
    --today-class-review-arrow: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.24fr);
    gap: 0;
    width: var(--today-class-step-width);
    max-width: 100%;
    min-height: 118px;
}

.today-class-step-flow,
.today-class-step-caption {
    margin-left: auto;
    margin-right: auto;
}

.today-class-step-caption {
    width: var(--today-class-step-width);
    max-width: 100%;
    margin-top: 0.18rem;
    color: var(--c-64748b);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.01em;
}

.today-class-step {
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.55rem;
    background: #eeeeee;
    color: #ffffff;
    overflow: hidden;
}

.today-class-step + .today-class-step {
    margin-left: -14px;
}

.today-class-step.is-active,
.today-class-step.is-complete {
    background: #10b981;
}

.today-class-step:not(.is-active):not(.is-complete) {
    background: #eeeeee;
}

.today-class-step:not(.is-active):not(.is-complete) .today-class-step-control {
    opacity: 0.56;
}

.today-class-step:not(.is-active):not(.is-complete) .today-class-step-title {
    color: var(--c-64748b);
}

.today-class-step:not(.is-active):not(.is-complete) .today-class-step-number {
    color: var(--c-64748b);
}

.today-class-step-prep,
.today-class-step-class {
    clip-path: polygon(var(--today-class-step-slant) 0, 100% 0, calc(100% - var(--today-class-step-slant)) 100%, 0 100%);
}

.today-class-step-review {
    clip-path: polygon(var(--today-class-step-slant) 0, calc(100% - var(--today-class-review-arrow)) 0, 100% 50%, calc(100% - var(--today-class-review-arrow)) 100%, 0 100%);
}

.today-class-step-review .today-class-step-heading,
.today-class-step-review .today-class-step-control {
    transform: translateX(-20px);
}

.today-class-step-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    max-width: 100%;
    text-align: center;
}

.today-class-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.05em;
}

.today-class-step-signal {
    display: none;
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    background: #facc15;
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.55);
    opacity: 0;
    transform: scale(0.82);
    flex: 0 0 auto;
}

.today-class-step.is-current .today-class-step-signal {
    display: inline-block;
    opacity: 1;
    animation: todayClassStepSignalPulse 1s ease-in-out infinite;
}

@keyframes todayClassStepSignalPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.6), 0 0 10px rgba(250, 204, 21, 0.95);
    }
    50% {
        opacity: 0.32;
        box-shadow: 0 0 0 7px rgba(250, 204, 21, 0), 0 0 3px rgba(250, 204, 21, 0.55);
    }
}

.today-class-step-title {
    max-width: 100%;
    white-space: normal;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.today-class-step-control {
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.today-class-step .today-class-action,
.today-class-step-status {
    width: auto;
    min-width: 88px;
    min-height: 2.12rem;
    border: 0;
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--c-7a7a7a);
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.58rem;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.today-class-step.is-active .today-class-action,
.today-class-step.is-complete .today-class-action,
.today-class-step.is-active .today-class-step-status,
.today-class-step.is-complete .today-class-step-status {
    color: #79b22e;
}

.today-class-join-toggle {
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-card);
    min-height: 2.12rem;
    max-width: 100%;
    box-shadow: none;
}

.today-class-join-toggle .today-class-action {
    min-width: 66px;
    min-height: 2.12rem;
    border-radius: 0;
    background: transparent;
    padding: 0.38rem 0.42rem;
    font-size: 0.66rem;
}

.today-class-join-toggle .today-class-action + .today-class-action {
    border-left: 1px solid var(--b-d9d9d9);
}

.today-class-step .today-class-avatar-lecture {
    background: var(--bg-card);
    border: none;
    color: #79b22e;
}

.today-class-step .today-class-review-secondary {
    background: #de605e;
    border: none;
    color: #ffffff;
}

.today-class-step.has-secondary-action:not(.is-active):not(.is-complete) .today-class-step-control {
    opacity: 1;
}

.today-class-step-status.absent {
    color: var(--c-7a7a7a);
}

.today-class-step-status.completed {
    color: #79b22e;
}

.today-class-review-pending {
    min-width: 0;
    color: #ffffff;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
}

.today-class-status {
    padding: 0.4rem 0.9rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--bg-soft);
    color: var(--c-64748b);
    border: none;
    width: var(--today-class-action-width);
    text-align: center;
}

.today-class-status.absent {
    background: #f0f0f5;
    color: var(--c-111827);
    border: none;
}

.today-class-status.completed {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.today-class-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== Enhanced Chat Section Styles ===== */
.chat-container {
    display: flex;
    height: calc(100vh - 150px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.chat-list {
    width: 300px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    background: var(--bg-card);
}

.chat-list-header {
    padding: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0.55rem 0.85rem !important;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-card);
}

.chat-list-item:hover {
    background: var(--bg-dark);
}

.chat-list-item.active {
    background: linear-gradient(135deg, var(--primary), #8b5cf6) !important;
    color: white !important;
}

.chat-list-item.active * {
    color: white !important;
}

.chat-list-item.active [data-chat-icon="true"] i {
    color: var(--c-111827) !important;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
}

.chat-messages {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
    background: var(--bg-card);
}

.chat-messages-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.chat-messages-empty i {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.chat-input-area {
    display: flex;
    gap: var(--spacing-md);
    padding: 0.55rem 0.85rem !important;
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
}

.chat-input {
    flex: 1;
    padding: 0.55rem 0.85rem !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Chat Bubbles */
.chat-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 1rem;
}

.chat-bubble.sent {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble.received {
    margin-right: auto;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 0.25rem;
}

/* ===== Order Cards ===== */
.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.order-card-body {
    padding: var(--spacing-lg);
}

/* ===== AI App Cards ===== */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

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

.app-card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.app-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.app-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Profile Section ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.profile-info h2 {
    margin-bottom: var(--spacing-sm);
}

.profile-info p {
    color: var(--text-secondary);
}

/* ===== Utility Classes ===== */
.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-primary {
    color: var(--primary);
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.d-flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: var(--spacing-sm);
}

.gap-2 {
    gap: var(--spacing-md);
}

.gap-3 {
    gap: var(--spacing-lg);
}

.justify-between {
    justify-content: space-between;
}

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

.align-center {
    align-items: center;
}

.hidden {
    display: none !important;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        background: var(--bg-card);
        box-shadow: 12px 0 24px rgba(15, 23, 42, 0.12);
        z-index: 2500;
        top: 0;
        bottom: 0;
        padding-top: calc(var(--header-height, 70px) + 10px);
    }

    .sidebar::before {
        box-shadow: none;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .point-wallet-hero,
    .point-wallet-status-grid,
    .point-wallet-ledger {
        grid-template-columns: 1fr;
    }

    .point-wallet-section {
        padding-right: 0;
    }

    .point-wallet-grade-card {
        grid-template-columns: 1fr;
    }

    .point-wallet-policy-grid {
        grid-template-columns: 1fr;
    }

    .point-wallet-panel-title,
    .point-wallet-ledger-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .point-wallet-panel-title span {
        max-width: none;
        text-align: left;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    .calendar-day .class-item {
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .calendar-day .class-status-row {
        display: flex;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60px;
    }
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: auto !important;
        overscroll-behavior: auto;
        height: auto;
    }

    .sidebar {
        padding-top: calc(var(--header-height, 70px) - 14px);
        overflow: hidden;
    }

    .sidebar-menu {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        margin-top: -12px;
        padding-bottom: 0.2rem;
    }

    .sidebar-app-sync {
        margin-top: auto !important;
    }

    .sidebar-point-wallet-wrap {
        display: block;
    }

    .sidebar-app-sync,
    .sidebar-point-wallet-wrap,
    .sidebar-time,
    .sidebar-language {
        flex-shrink: 0;
    }

    #headerLogoutBtn {
        display: none !important;
    }

    .header {
        transition: none;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        will-change: transform;
    }

    .header.has-app-sync-notice {
        padding-bottom: calc(var(--spacing-md) + 3.25rem);
    }

    .header.has-app-sync-notice .header-app-sync-notice {
        top: auto;
        bottom: 0.65rem;
    }

    .header-app-sync-notice {
        top: 16px;
        width: min(90vw, 390px);
        max-width: min(90vw, 390px);
        padding: 0.42rem 0.72rem;
        gap: 0.45rem;
        border-radius: 999px;
        font-size: clamp(0.78rem, 3vw, 0.92rem);
        line-height: 1.25;
        white-space: nowrap;
        text-align: left;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .header-app-sync-notice > span {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        word-break: keep-all;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-app-sync-notice-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.25rem 0.5rem;
        font-size: clamp(0.7rem, 2.55vw, 0.82rem);
    }

    .logo-text {
        display: none;
    }

    .header .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .nav {
        gap: 0.45rem;
    }

    .logo {
        flex: 1 1 auto;
        min-width: 0;
        gap: 0.4rem;
    }

    .nav-right {
        flex: 0 0 auto;
        gap: 0.4rem;
    }

    .nav-links {
        gap: 0.4rem;
    }

    .nav-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.9rem;
    }

    .mobile-menu-btn {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }

    .mobile-header-order-menu {
        display: inline-flex;
        flex: 0 0 auto;
        min-width: 62px;
        height: 48px;
        padding: 0.15rem 0.25rem;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.18rem;
        border: 0;
        background: transparent;
        color: var(--text-primary);
        cursor: pointer;
        font-family: var(--font-family);
        line-height: 1;
        white-space: nowrap;
    }

    .mobile-header-order-text {
        font-size: 1rem;
        font-weight: 600;
    }

    .mobile-header-order-discount {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.16rem 0.36rem;
        border-radius: 6px;
        background: #dc2626;
        color: #ffffff;
        font-size: 0.58rem;
        font-weight: 400;
        line-height: 1;
        letter-spacing: 0;
    }

    .mobile-header-order-discount[hidden] {
        display: none;
    }

    .header-menu-ai,
    .header-menu-order,
    .header-menu-uid,
    .header-menu-sep-order,
    .header-menu-sep-ai {
        display: none;
    }

    .nav-center {
        display: none !important;
    }

    .point-wallet-header-mobile {
        display: none !important;
    }

    .point-wallet-header-mobile:not(:empty) {
        display: inline-flex;
        justify-content: center;
        gap: 0;
        max-width: min(52vw, 216px);
        min-height: 25px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .point-wallet-header-mobile .point-wallet-summary-btn {
        min-height: 30px;
        width: 100%;
        max-width: 100%;
        gap: 0.34rem;
        padding: 0.26rem 0.42rem;
        border-radius: 10px;
    }

    .point-wallet-header-mobile .point-wallet-pill {
        height: auto;
        padding: 0;
        gap: 0.18rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        font-size: clamp(0.62rem, 2.35vw, 0.72rem);
    }

    .point-wallet-header-mobile .point-wallet-label {
        display: none;
    }

    .point-wallet-header-mobile .point-wallet-summary-divider {
        height: 16px;
    }

    .point-wallet-header-mobile .point-wallet-pill i {
        font-size: clamp(0.58rem, 2.2vw, 0.68rem);
    }

    .point-wallet-header-mobile .point-wallet-delta {
        top: -1.5rem;
        font-size: 1.02rem;
    }

    .logo-greeting {
        font-size: 0.82rem;
        min-width: 0;
        max-width: clamp(72px, 23vw, 110px);
        overflow: hidden;
        line-height: 1.18;
        text-overflow: clip;
    }

    .header-greeting-desktop {
        display: none;
    }

    .header-greeting-mobile {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.08rem;
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .header-greeting-mobile-name,
    .header-greeting-mobile-salutation {
        display: block;
    }

    .top-gift-banner {
        display: none !important;
    }

    .top-gift-banner-icon {
        display: none;
    }

    .top-gift-banner-title {
        font-size: 0.9rem;
    }

    .top-gift-banner-detail {
        font-size: 0.86rem;
    }

    .order-coupon-item {
        padding: 0.62rem 0.72rem;
    }

    .order-coupon-main {
        font-size: 0.84rem;
    }

    .order-coupon-benefit-key {
        font-size: 0.96rem;
    }

    .order-coupon-benefit-tail {
        font-size: 0.86rem;
    }

    .order-coupon-meta {
        font-size: 0.76rem;
    }

    .order-price-meta {
        font-size: 0.86em;
    }

    .container {
        padding: 0;
    }

    .main-content {
        padding: 0;
    }

    .card {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .chat-container {
        flex-direction: column;
        height: auto;
    }

    .chat-list {
        width: 100%;
        max-height: 200px;
    }

    .app-grid {
        grid-template-columns: 1fr;
    }

    .class-card-info {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .calendar-card {
        padding: 0;
        margin-top: 10px;
        margin-bottom: 0;
        border-radius: 0;
        width: 100%;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .calendar-card .card-header {
        padding: 0.75rem 0.75rem 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
    }

    .calendar-day .class-item {
        flex-wrap: wrap;
    }

    .calendar-day .class-status {
        display: none;
    }

    .calendar-day .class-type-label,
    .calendar-day .class-comment {
        display: none;
    }

    /* mobile: level-test label is rendered inline in JS, so force-hide it */
    .calendar-day .class-item.level-test .class-type-label {
        display: none !important;
    }

    .today-class-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* 모바일: 오늘 수업 영역 좌우 기준을 부모 폭에 맞춰 카드 여백을 균일하게 */
    .today-class-section {
        margin-left: 0;
        margin-right: 0;
    }

    /* 모바일: 고정수업 버튼 영역을 타이틀 위로 */
    .today-class-title {
        order: 2;
        width: 100%;
        flex: 0 1 auto;
        grid-template-columns: max-content max-content;
        gap: 0.16rem 0.4rem;
        font-size: 1.18rem;
    }

    .today-class-heading-main {
        gap: 0.34rem;
    }

    .today-class-wallet-cluster {
        gap: 0.38rem;
    }

    .today-class-wallet-divider {
        height: 22px;
    }

    .today-class-point-wallet {
        gap: 0.18rem;
        min-height: 21px;
    }

    .today-class-point-wallet .point-wallet-pill {
        height: 21px;
        padding: 0 0.38rem;
        gap: 0.18rem;
        font-size: 0.64rem;
    }

    .today-class-point-wallet .point-wallet-pill i {
        font-size: 0.6rem;
    }

    .today-class-title .today-class-date {
        margin-left: 1.65rem;
    }

    .today-class-actions-bar {
        order: 1;
        width: 100%;
        justify-content: flex-end;
        align-items: flex-start;
        flex-wrap: wrap;
        margin-bottom: 25px;
    }

    #calendarJoinGroup,
    #todayClassJoinBtn,
    #calendarLeveltestGroup {
        display: none !important;
    }

    .calendar-header-stack {
        align-items: stretch !important;
    }

    #calendarJoinGroup {
        flex: 1 1 auto;
        min-width: 0;
        margin-right: 0;
    }

    .today-class-join-quick {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 0.5rem 0.55rem;
        white-space: nowrap;
        margin-right: 0;
    }

    .today-class-item {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.55rem;
        width: 100%;
        box-sizing: border-box;
    }

    .today-class-list {
        padding: 0.75rem;
        box-sizing: border-box;
    }

    .today-class-avatar {
        width: 72px;
        height: 104px;
        border-radius: 12px;
    }

    .today-class-body {
        min-width: 0;
        flex: 1;
    }

    .today-class-line {
        grid-template-columns: 92px minmax(0, 1fr);
        column-gap: 0.45rem;
        border-bottom: 1px dotted var(--b-e2e8f0);
        align-items: center;
    }

    .today-class-body::before {
        display: none;
    }

    .today-class-value-group {
        border-left: none;
        padding-left: 0;
        min-width: 0;
    }

    .today-class-value {
        display: block;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 모바일: 카드 하단(사진+정보 아래) 버튼/상태 가운데 정렬 */
    .today-class-actions {
        --today-class-step-width: 100%;
        width: 100%;
        flex-basis: 100%;
        min-width: 0;
        justify-content: center;
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.32rem;
        margin-top: 0.2rem;
    }

    .today-class-step-flow {
        width: 100%;
        min-height: 106px;
    }

    .today-class-step-prep {
        clip-path: polygon(0 0, 100% 0, calc(100% - var(--today-class-step-slant)) 100%, 0 100%);
    }

    .today-class-step {
        gap: 0.55rem;
        padding: 0.78rem 0.44rem;
    }

    .today-class-step-title {
        font-size: 0.88rem;
    }

    .today-class-step .today-class-action,
    .today-class-step-status {
        flex: 0 1 auto;
        min-width: 0;
        min-height: 1.92rem;
        padding: 0.34rem 0.36rem;
        font-size: 0.6rem;
    }

    .today-class-join-toggle {
        width: 100%;
        max-width: 154px;
    }

    .today-class-join-toggle .today-class-action {
        flex: 1 1 50%;
        min-width: 0;
        padding: 0.32rem 0.04rem;
    }

    .today-class-step .today-class-avatar-lecture {
        padding-left: 0.54rem;
        padding-right: 0.54rem;
    }

    .today-class-review-pending {
        font-size: 0.62rem;
        white-space: normal;
    }

    .today-class-action,
    .today-class-status {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
        text-align: center;
    }

    .today-class-action {
        padding: 0.46rem 0.28rem;
        font-size: 0.75rem;
    }

    /* 모바일: 타이틀 아래 고정수업 버튼 우측 정렬 + 버튼 순서 정리 */
    #calendarFixedGroup {
        flex: 0 0 auto;
        margin-left: auto;
        justify-content: flex-end;
    }

    #calendarPostponeGuideBtn {
        display: none !important;
    }

    #calendarMakeupGuideBtn {
        display: none !important;
    }

    #calendarTimeChangeBtn {
        order: 1;
    }

    #calendarTextbookChangeBtn {
        order: 2;
    }

    .today-class-actions-bar #calendarTimeChangeBtn,
    .today-class-actions-bar #calendarTextbookChangeBtn {
        padding: 0.5rem 0.95rem;
        font-size: 0.78rem;
        border-radius: 10px;
    }

    .today-class-actions-bar .today-class-join-quick,
    .today-class-actions-bar #calendarTimeChangeBtn,
    .today-class-actions-bar #calendarTextbookChangeBtn {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        line-height: 1.2;
        min-height: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .calendar-nav-row {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
    }

    .calendar-view-toggle {
        width: auto;
        justify-content: flex-start;
    }

    .calendar-view-toggle button {
        flex: 0 0 auto;
        min-width: 2.55rem;
        padding: 0 0.65rem;
    }

    .calendar-nav-box {
        width: auto;
        flex: 0 0 auto;
        justify-content: flex-start;
    }

    .calendar-status-legend {
        width: auto;
        margin-left: auto;
        justify-content: flex-end;
    }

    .calendar-period-title {
        min-width: 0;
        flex: 1 1 auto;
        font-size: 0.82rem;
    }

    .calendar-status-legend {
        display: flex;
    }

    .calendar {
        padding: 0;
        border-radius: 0;
        width: 100%;
    }

    .calendar-grid {
        gap: 2px;
    }

    .calendar.week-view .calendar-grid {
        min-width: 896px;
        grid-template-columns: repeat(7, minmax(128px, 1fr));
    }

    .calendar.week-view .calendar-day {
        min-height: 320px;
        padding: 0 0 0.25rem;
    }

    .calendar-week-class-card {
        padding: 0.6rem 0.36rem;
        border-radius: 13px;
    }

    .calendar-week-class-actions {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .calendar-week-action,
    .calendar-week-class-actions .today-class-avatar-lecture {
        height: 1.95rem;
        font-size: 0.62rem;
        padding-left: 0.12rem;
        padding-right: 0.12rem;
        white-space: normal;
        overflow-wrap: anywhere;
        margin-bottom: 2px;
    }

    .calendar-week-action-flow .calendar-week-action {
        margin-bottom: 0;
    }

    .calendar-week-flow-triangle {
        height: 8px;
    }

    .calendar-weekday {
        padding: 0.4rem 0;
        font-size: 0.8rem;
        border-radius: 6px;
        border: none;
        background: var(--calendar-weekday-bg);
        color: #ffffff;
    }

    .textbook-change-selects {
        flex-direction: column;
        gap: 0.7rem;
    }

    .textbook-change-field {
        min-width: 0;
    }

    .textbook-change-chapter {
        flex-direction: row;
        align-items: center;
        gap: 0.38rem;
    }

    .textbook-change-chapter select {
        flex: 1 1 auto;
        min-width: 0;
    }

    .textbook-change-preview {
        width: auto;
        flex: 0 0 auto;
        justify-content: center;
        padding: 0.48rem 0.64rem;
        font-size: 0.76rem;
        gap: 0.22rem;
    }

    .textbook-change-info-inner {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.62rem;
    }

    .textbook-change-image {
        width: 94px;
        height: 132px;
        margin: 0;
    }

    .textbook-change-info-content {
        min-width: 0;
        flex: 1;
    }

    .textbook-change-level {
        font-size: 0.72rem;
        padding: 0.28rem 0.55rem;
        margin-bottom: 0.35rem;
    }

    .textbook-change-info-content p {
        font-size: 0.8rem;
        line-height: 1.38;
    }

    #chapterPreviewModal {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
    }

    #chapterPreviewModal .chapter-preview-window {
        position: fixed !important;
        inset: 0 !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        transform: none !important;
    }

    #chapterPreviewModal .chapter-preview-header {
        cursor: default !important;
        padding: 0.78rem 0.95rem !important;
    }

    #chapterPreviewModal [data-preview-action="toggle-size"],
    #chapterPreviewModal .chapter-preview-resize {
        display: none !important;
    }

    #chapterPreviewModal #previewContent {
        padding: 0.95rem !important;
    }

    .lesson-drawer-panel {
        width: min(86vw, 300px) !important;
        min-width: min(86vw, 300px) !important;
        transform: translateX(calc(-100% + 52px));
    }

    .lesson-drawer-content {
        padding-left: calc(0.95rem + 52px) !important;
    }

    .learning-material-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.62rem;
    }

    .learning-material-title {
        width: 100%;
        align-items: flex-start;
        flex-wrap: wrap;
        line-height: 1.35;
    }

    .learning-material-title h4 {
        white-space: normal;
        line-height: 1.35;
    }

    .learning-material-title #currentItemTitle,
    .learning-material-title > span:not([style*="background"]) {
        flex-basis: 100%;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: keep-all;
        line-height: 1.45;
    }

    .learning-material-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .learning-material-actions button {
        max-width: 100%;
        min-height: 34px;
        height: auto !important;
        white-space: normal !important;
        line-height: 1.25;
        justify-content: center;
    }

    .calendar-day {
        min-height: 100px;
        padding: 0.45rem;
        border-radius: 8px;
        border: none;
        background: var(--calendar-nav-bg);
        overflow: hidden;
    }

    .calendar-day.today {
        border: none;
        box-shadow: inset 0 0 0 2px #488cef;
    }

    .calendar-day .day-number {
        top: 6px;
        left: 6px;
        font-size: 0.72rem;
    }

    .calendar-day .class-items {
        padding-top: 34px;
        margin-top: 8px;
    }

    .calendar-day .class-item {
        padding: 0.2rem 0.28rem;
        border-radius: 8px;
        font-size: 0.6rem;
        box-shadow: none;
        gap: 0.3rem;
    }

    .calendar-day .class-time {
        font-size: 0.6rem;
        white-space: nowrap;
    }

    .orders-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.55rem;
        flex-wrap: nowrap;
        border-bottom: none;
        padding-bottom: 0;
    }

    .orders-header h3 {
        min-width: 0;
        margin: 0;
        font-size: 1.3rem;
        line-height: 1.2;
        white-space: nowrap;
    }

    .orders-header-actions {
        width: auto;
        margin-left: auto;
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
    }

    .ai-apps-card .card-header {
        border-bottom: none;
        padding-bottom: 0;
    }

    .ai-apps-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .ai-apps-title-block {
        width: 100%;
        min-width: 0;
    }

    .ai-apps-title-block h3 {
        font-size: 1.15rem;
        line-height: 1.25;
    }

    .ai-apps-header-note {
        font-size: 0.95rem;
        line-height: 1.55;
        max-width: 100%;
    }

    .ai-apps-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .ai-apps-header-actions .btn {
        flex: 1 1 140px;
        justify-content: center;
    }

    .ai-apps-help-list {
        padding-left: 1.45rem;
        font-size: 0.95rem;
    }

    .ai-token-point-card {
        width: min(92vw, 420px);
        padding: 1.15rem;
    }

    .orders-header .btn {
        width: auto;
        min-height: 40px;
        padding: 0.55rem 0.75rem;
        justify-content: center;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .orders-analytics-panel {
        width: min(96vw, 1080px);
    }

    .orders-analytics-header {
        padding: 1rem 1rem 0.9rem;
    }

    .orders-analytics-body {
        padding: 0.95rem;
    }

    .orders-analytics-filters {
        grid-template-columns: 1fr;
    }

    .orders-analytics-field-settlement {
        max-width: none;
    }

    .orders-analytics-actions,
    .orders-analytics-submit {
        width: 100%;
    }

    .orders-analytics-summary-grid {
        grid-template-columns: 1fr;
    }

    .orders-analytics-chart-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .orders-analytics-mode-group {
        width: 100%;
        justify-content: stretch;
    }

    .orders-analytics-mode-btn {
        flex: 1;
    }

    .orders-analytics-chart-panel {
        padding: 0.7rem;
    }

    .orders-analytics-tooltip {
        max-width: calc(100vw - 70px);
    }

    .orders-table {
        display: block;
        width: 100%;
        border: 0;
    }

    .orders-table thead {
        display: none;
    }

    .orders-table tbody {
        display: block;
        width: 100%;
    }

    .orders-table tr {
        display: block;
        background: transparent;
        border: 0;
        border-radius: 0;
        padding: 0;
        margin-bottom: 1.4rem;
        box-shadow: none;
    }

    .orders-table td[data-label="영수증"] {
        display: none;
    }

    .orders-table td {
        --label-col: 50%;
        position: relative;
        display: flex;
        align-items: center;
        padding: 0.7rem 0.75rem 0.7rem calc(var(--label-col) + 0.75rem);
        border-bottom: 1px solid var(--b-e5e7eb);
        text-align: left;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .orders-table td::before {
        content: attr(data-label-short);
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--label-col);
        display: flex;
        align-items: center;
        padding-left: 0.75rem;
        padding-right: 0.6rem;
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--c-64748b);
        background: #f8f6f6;
        white-space: nowrap;
        text-transform: none;
    }

    .orders-table td::after {
        content: '';
        position: absolute;
        left: var(--label-col);
        top: 0;
        bottom: 0;
        width: 1px;
        background: var(--b-e5e7eb);
    }

    .orders-table td[data-label="receipt"] {
        padding: 0.85rem 0.75rem;
        justify-content: center;
        text-align: center;
    }

    .orders-table td[data-label="receipt"]::before,
    .orders-table td[data-label="receipt"]::after {
        content: none;
    }

    .ai-apps-table {
        display: block;
        width: 100%;
        border: 0;
    }

    .ai-apps-table thead {
        display: none;
    }

    .ai-apps-table tbody {
        display: block;
        width: 100%;
    }

    .ai-apps-table tr {
        display: block;
        background: transparent;
        border: 0;
        border-radius: 0;
        padding: 0;
        margin-bottom: 1.4rem;
        box-shadow: none;
    }

    .ai-apps-table td {
        --label-col: 40%;
        position: relative;
        display: flex;
        align-items: center;
        padding: 0.7rem 0.75rem 0.7rem calc(var(--label-col) + 0.75rem);
        border-bottom: 1px solid var(--b-e5e7eb);
        text-align: left;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .ai-apps-table td::before {
        content: attr(data-label-short);
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--label-col);
        display: flex;
        align-items: center;
        padding-left: 0.75rem;
        padding-right: 0.6rem;
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--c-64748b);
        background: #f8f6f6;
        white-space: nowrap;
        text-transform: none;
    }

    .ai-apps-table td::after {
        content: '';
        position: absolute;
        left: var(--label-col);
        top: 0;
        bottom: 0;
        width: 1px;
        background: var(--b-e5e7eb);
    }

    .ai-apps-table td[data-label="QR"] {
        padding: 0.85rem 0.75rem;
        justify-content: center;
        text-align: center;
    }

    .ai-apps-table td[data-label="QR"]::before,
    .ai-apps-table td[data-label="QR"]::after {
        content: none;
    }

    .ai-apps-table td[data-label="validity_period"] {
        white-space: normal;
        word-break: break-word;
        line-height: 1.4;
    }

    .orders-table .badge {
        font-size: 0.72rem;
        padding: 0.2rem 0.55rem;
    }

    .orders-table .btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    .order-action-buttons {
        justify-content: flex-start;
        width: 100%;
    }

    .chat-list-panel {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        max-width: 80vw;
        transform: translateX(-105%);
        z-index: 20;
        box-shadow: 12px 0 30px rgba(15, 23, 42, 0.18);
    }

    .chat-list-panel.active {
        transform: translateX(0);
    }

    .chat-list-overlay {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-fast);
        z-index: 15;
    }

    .chat-list-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .chat-toggle-desktop {
        display: none;
    }

    .chat-toggle-mobile {
        display: inline-block;
    }

    .chat-page-card {
        height: calc(100vh - 80px);
        margin-bottom: 0;
    }

    .ai-apps-table-container {
        margin: 0;
    }

    .calendar-day .class-status,
    .calendar-day .class-type-label,
    .calendar-day .class-comment {
        display: none;
    }

    /* mobile: class detail modal should always be fullscreen */
    #classDetailModal.class-detail-window {
        position: fixed !important;
        inset: 0 !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        transform: none !important;
        border-radius: 0 !important;
    }

    #classDetailModal .class-detail-header {
        border-radius: 0 !important;
        cursor: default !important;
        padding: 0.75rem 0.75rem 0.65rem !important;
    }

    #classDetailModal .class-detail-header > div {
        display: block !important;
    }

    #classDetailModal .class-detail-header > div > div:first-child {
        width: 100% !important;
        max-width: 100% !important;
    }

    #classDetailModal .class-detail-header h3 {
        padding-right: 3.8rem !important;
    }

    #classDetailModal .class-detail-header > div > div:last-child {
        display: block !important;
    }

    #classDetailModal .class-detail-header > div > div:last-child > div:first-child {
        position: absolute !important;
        top: 0.75rem !important;
        right: 0.75rem !important;
        z-index: 6 !important;
    }

    #classDetailModal [data-class-detail-action="toggle-size"],
    #classDetailModal .class-detail-resize {
        display: none !important;
    }

    /* mobile: order/enrollment modal fullscreen */
    #orderStickerModal {
        z-index: 12050 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
    }

    #orderStickerModal .modal {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #orderStickerModalContent {
        padding: 0.9rem 0.9rem 1.2rem !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #orderFormModal {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    #orderFormModal fieldset {
        min-inline-size: 0;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    #orderFormModal .class-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
    }

    #orderFormModal .class-type-grid > label,
    #orderFormModal .class-type-card {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    #orderFormModal .class-type-card {
        min-height: 96px;
        padding: 0.65rem !important;
    }

    #textbookSelectionFieldset,
    #textbookSelectionFieldsetFlexible {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 1rem !important;
        box-sizing: border-box;
    }

    #textbookSelectionFieldset .order-textbook-selection-row,
    #textbookSelectionFieldsetFlexible .order-textbook-selection-row {
        width: 100%;
        min-width: 0;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #textbookSelectionFieldset .order-textbook-select-column,
    #textbookSelectionFieldsetFlexible .order-textbook-select-column {
        width: 100%;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    #textbookSelectionFieldset .order-textbook-chapter-row,
    #textbookSelectionFieldsetFlexible .order-textbook-chapter-row {
        width: 100%;
        min-width: 0;
    }

    #textbookSelectionFieldset .order-textbook-chapter-row select,
    #textbookSelectionFieldsetFlexible .order-textbook-chapter-row select {
        width: auto;
        min-width: 0;
    }

    #textbookSelectionFieldset .order-textbook-category-info-row,
    #textbookSelectionFieldsetFlexible .order-textbook-category-info-row {
        min-width: 0;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    #appRegistrationSection,
    #appRegistrationSection fieldset {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    #appRegistrationSection fieldset {
        padding: 1rem !important;
    }

    #appRegistrationSection .order-app-layout {
        width: 100%;
        min-width: 0;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    #appRegistrationSection .order-app-guide,
    #appRegistrationSection .order-app-video-panel {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex: 1 1 auto !important;
    }

    #appRegistrationSection .order-app-step-content {
        min-width: 0;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        text-align: left;
    }

    #appRegistrationSection .order-app-step-content > div:last-child {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        align-items: stretch;
    }

    #appRegistrationSection .order-app-video-panel {
        aspect-ratio: 16 / 9;
        align-self: auto !important;
    }

    #appRegistrationSection .order-app-video-panel video {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }

    #fixedClassPrimaryOptions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem !important;
        align-items: end !important;
    }

    #fixedClassPrimaryOptions > div {
        width: auto;
        min-width: 0 !important;
        flex-basis: auto !important;
    }

    #fixedClassPrimaryOptions > div:first-child {
        grid-column: 1 / -1;
        width: 100%;
    }

    #orderFormModal #preferredDaysGroupModal > div {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0.22rem !important;
        width: 100%;
        min-width: 0;
    }

    #orderFormModal #preferredDaysGroupModal > div > label {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        min-height: 38px;
        padding: 0.35rem 0 !important;
        justify-content: center;
        gap: 0.1rem !important;
        box-sizing: border-box;
        overflow: hidden;
        font-size: 0.9rem !important;
        line-height: 1;
        letter-spacing: 0;
        white-space: nowrap;
    }

    #orderFormModal #preferredDaysGroupModal input[name="preferred_days_modal"] {
        flex: 0 0 auto;
        width: auto;
        height: auto;
        margin: 0;
        accent-color: var(--primary);
    }

    #dateTimeSelectionArea > div > div {
        width: 100%;
        min-width: 0 !important;
        flex-basis: 100% !important;
    }

    #orderModalFooter {
        position: relative !important;
        bottom: auto !important;
        z-index: 3 !important;
        padding: 0.75rem 0.9rem !important;
        gap: 0.65rem !important;
        flex-wrap: nowrap !important;
    }

    #orderModalFooterPrice {
        min-width: 0;
        flex: 1 1 auto;
    }

    #priceDisplayModal {
        font-size: 1.35rem !important;
        min-width: 0;
        line-height: 1.1;
    }

    #priceDisplayModal.has-point-discount .order-price-meta {
        display: flex;
        width: 100%;
        margin-top: 0.18rem;
        gap: 0.25rem;
        font-size: 0.72rem;
        line-height: 1.25;
    }

    #priceDisplayModal.has-point-discount .order-price-point-note {
        font-weight: 600;
        white-space: nowrap;
    }

    #orderSubmitBtnModal {
        flex: 0 0 auto;
        min-width: 0 !important;
        padding: 0.72rem 1rem !important;
        white-space: nowrap;
    }

    #classTimeSearchBtn {
        pointer-events: auto !important;
        touch-action: manipulation;
    }
}

/* touch 모바일에서만 스크롤바 숨김 (PC 브라우저 축소창 제외) */
@media (max-width: 768px) and (pointer: coarse) {
    html,
    body,
    * {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    *::-webkit-scrollbar {
        width: 0 !important;
        height: 0 !important;
        display: none !important;
        background: transparent !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0;
    }

    .main-content {
        padding: 0;
    }

    .card {
        padding: var(--spacing-md) 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .calendar-card .card-header {
        padding: 0.6rem 0.6rem 0.4rem 0.6rem;
    }

    .today-class-section {
        margin-left: 0;
        margin-right: 0;
    }

    .ai-apps-table-container {
        margin: 0;
    }
}

/* ===== Class History Card Redesign ===== */
.class-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.class-history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem 1.25rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.class-history-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.class-history-card.active {
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.class-history-card.active::before {
    content: attr(data-index);
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 100%;
    background: #10b981 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    font-style: italic;
    color: white;
    border-radius: 20px 0 0 20px;
}

.class-history-card.active > * {
    margin-left: 60px;
}

.class-history-card.with-index::before {
    content: attr(data-index);
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 100%;
    background: #10b981 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    font-style: italic;
    color: white;
    border-radius: 20px 0 0 20px;
}

.class-history-card.with-index > * {
    margin-left: 60px;
}

.class-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.class-history-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.class-type-badge {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.class-lang-badge {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.class-duration-badge {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-darker);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-weight: 500;
}

.class-status-badge {
    padding: 0.4rem 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.class-history-info {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex-wrap: wrap;
    row-gap: 0.7rem;
}

.class-info-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
}

.class-info-item::before {
    content: '•';
    color: var(--c-64748b);
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
}

.class-history-stats {
    display: grid;
    gap: 0.5rem;
}

.class-history-stats.compact-fixed-stats {
    grid-template-columns: repeat(5, minmax(88px, 108px)) !important;
    justify-content: flex-start;
}

.stat-item {
    background: var(--bg-darker);
    border-radius: 10px;
    padding: 0.5rem 0.4rem;
    text-align: center;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.stat-item:hover {
    background: var(--bg-soft);
    border-color: var(--border);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

/* Action Button for Active Classes */
.class-action-btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.class-action-group {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.6);
    padding: 0.2rem;
    border-radius: 10px;
}

.leveltest-action-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: var(--c-111827);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.class-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.class-action-btn:active {
    transform: translateY(0);
}

/* Pagination Redesign */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    cursor: pointer;
    font-size: 1rem;
}

.pagination-btn:hover:not(:disabled) {
    background: #10b981 !important;
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-dark);
    color: var(--text-muted);
}

.pagination-info {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 1rem;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .main-content {
        overflow-x: hidden;
        padding-bottom: calc(380px + env(safe-area-inset-bottom, 0px)) !important;
        scroll-padding-bottom: calc(380px + env(safe-area-inset-bottom, 0px));
    }

    .class-history-card {
        padding: 0.9rem 0.85rem;
    }

    .class-history-card.active::before,
    .class-history-card.with-index::before {
        width: 42px;
        border-radius: 16px 0 0 16px;
    }

    .class-history-card.active > *,
    .class-history-card.with-index > * {
        margin-left: 42px;
        min-width: 0;
    }

    .class-history-stats.compact-fixed-stats {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 0.35rem;
    }

    .class-history-stats.compact-fixed-stats .stat-item {
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .class-history-info {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.7rem;
        row-gap: 0.6rem;
    }

    .class-history-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .class-history-stats.compact-fixed-stats {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        justify-content: flex-start;
        gap: 0.35rem;
    }

    .class-history-stats.compact-fixed-stats .stat-item {
        padding: 0.4rem 0.2rem;
    }

    .class-history-stats.compact-fixed-stats .stat-label {
        font-size: 0.62rem;
        letter-spacing: 0;
    }

    .class-history-stats.compact-fixed-stats .stat-value {
        font-size: 0.9rem;
    }

    .class-history-header {
        align-items: flex-start;
    }

    .class-status-badge {
        margin-left: auto;
    }
}

/* ===== Floating Chat Button & Popup ===== */

/* Floating Button Container */
.floating-chat-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 13010;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 30px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.006)),
        rgba(255, 255, 255, 0.012);
    background-clip: padding-box;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.62), inset 0 -18px 28px rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(2px) saturate(118%) brightness(1.01);
    -webkit-backdrop-filter: blur(2px) saturate(118%) brightness(1.01);
    isolation: isolate;
    transition: padding 0.34s ease, background 0.34s ease, box-shadow 0.34s ease, border-color 0.34s ease;
}

.floating-chat-container::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    border-radius: inherit;
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.018) 34%, rgba(255, 255, 255, 0) 64%),
        radial-gradient(circle at 32% 8%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 38%);
    pointer-events: none;
}

.floating-chat-container::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -34px;
    height: 34px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
    filter: blur(7px);
    opacity: 0.74;
    pointer-events: none;
    transform: perspective(90px) rotateX(58deg) scaleX(0.86);
    transform-origin: top center;
}

.floating-popup-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-height: 520px;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: max-height 0.34s ease, opacity 0.22s ease, transform 0.34s cubic-bezier(0.2, 0.7, 0.2, 1);
    overflow: visible;
}

.floating-popup-toggle {
    position: relative;
    z-index: 1;
    width: 38px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #0f172a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 9px 22px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.78);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.floating-popup-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.96);
}

.floating-chat-container.is-collapsed {
    padding: 8px;
    background: rgba(255, 255, 255, 0.008);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.floating-chat-container.is-collapsed .floating-popup-stack {
    max-height: 0;
    opacity: 0;
    transform: translateY(34px) scale(0.94);
    pointer-events: none;
    overflow: hidden;
}

.floating-chat-container.is-collapsed::after {
    opacity: 0.38;
}

html[data-theme="dark"] .floating-chat-container {
    border-color: rgba(226, 232, 240, 0.2);
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.055), rgba(15, 23, 42, 0.012)),
        rgba(15, 23, 42, 0.02);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -22px 34px rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .floating-chat-container::before {
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.012) 34%, rgba(255, 255, 255, 0) 64%),
        radial-gradient(circle at 32% 8%, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 38%);
}

html[data-theme="dark"] .floating-chat-container::after {
    background: linear-gradient(to bottom, rgba(148, 163, 184, 0.28), rgba(15, 23, 42, 0));
}

html[data-theme="dark"] .floating-popup-toggle {
    border-color: rgba(148, 163, 184, 0.34);
    background: rgba(15, 23, 42, 0.78);
    color: #f8fafc;
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .floating-popup-toggle:hover {
    background: rgba(30, 41, 59, 0.92);
}

html[data-theme="dark"] .floating-chat-container.is-collapsed {
    background: rgba(15, 23, 42, 0.012);
    border-color: rgba(226, 232, 240, 0.18);
}

/* Floating Button */
.floating-chat-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-chat-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ef4444;
    white-space: nowrap;
    text-shadow: none !important;
}

/* Floating FAB stack (채팅&문의 / 교재읽기 / 단어암기): more breathing room between
   the three groups, and make the 단어암기 (SRS) icon + label the same size as 교재읽기. */
.floating-chat-container .mybookflip-fab-wrap,
.floating-chat-container .ttt-srs-fab-wrap,
.floating-chat-container .ttt-exam-fab-wrap {
    margin-top: 16px;
}
.floating-chat-container .ttt-srs-fab-wrap { gap: 6px; }
.floating-chat-container .ttt-srs-fab,
.floating-chat-container .ttt-exam-fab {
    width: 60px;
    height: 60px;
    font-size: 1.45rem;
}
.floating-chat-container .ttt-srs-fab-label,
.floating-chat-container .ttt-exam-fab-label {
    font-size: 0.85rem;
}
.floating-chat-container .ttt-srs-fab-label {
    color: #334155;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.72);
}
html[data-theme="dark"] .floating-chat-container .ttt-srs-fab-label {
    color: #f8fafc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
/* the chat button is the last child, directly below the FAB wraps — give it the same
   gap above so 채팅&문의 ↔ 교재읽기 is spaced equally to 교재읽기 ↔ 단어암기 */
.floating-chat-container .mybookflip-fab-wrap + .floating-chat-btn,
.floating-chat-container .ttt-srs-fab-wrap + .floating-chat-btn,
.floating-chat-container .ttt-exam-fab-wrap + .floating-chat-btn {
    margin-top: 16px;
}

.floating-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: none !important;
}

.floating-chat-btn:active {
    transform: scale(0.95);
}

.floating-chat-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: none !important;
}

.floating-chat-btn.active i::before {
    content: "\f00d"; /* fa-xmark */
}

.floating-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.floating-chat-badge.show {
    opacity: 1;
    transform: scale(1);
}

/* Chat Popup */
.chat-popup {
    position: fixed;
    bottom: 90px;
    right: 16px;
    width: 700px;
    height: 700px;
    min-width: 400px;
    min-height: 500px;
    background: var(--bg-card);
    border-radius: 1rem;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.25);
    z-index: 140000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
    transform-origin: bottom right;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-popup.video-priority-lower {
    z-index: 10001 !important;
}

.chat-popup.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.chat-popup.dragging {
    transition: none;
    user-select: none;
}

/* Resize Handles */
.chat-popup-resize {
    position: absolute;
    z-index: 10;
}

.chat-popup-resize-n {
    top: 0;
    left: 10px;
    right: 10px;
    height: 6px;
    cursor: n-resize;
}

.chat-popup-resize-s {
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 6px;
    cursor: s-resize;
}

.chat-popup-resize-e {
    right: 0;
    top: 10px;
    bottom: 10px;
    width: 6px;
    cursor: e-resize;
}

.chat-popup-resize-w {
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 6px;
    cursor: w-resize;
}

.chat-popup-resize-ne {
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    cursor: ne-resize;
}

.chat-popup-resize-se {
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    cursor: se-resize;
}

.chat-popup-resize-sw {
    bottom: 0;
    left: 0;
    width: 12px;
    height: 12px;
    cursor: sw-resize;
}

.chat-popup-resize-nw {
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    cursor: nw-resize;
}

/* Popup Header - Draggable */
.chat-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    flex-shrink: 0;
    cursor: move;
    user-select: none;
}

.chat-popup-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.chat-popup-drag-icon {
    opacity: 0.7;
    font-size: 0.9rem;
}

.chat-popup-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-popup-admin-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-popup-admin-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-popup-admin-btn.active {
    background: var(--bg-card);
    color: #10b981;
}

.chat-popup-support-call-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.24);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.chat-popup-support-call-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.36);
    transform: translateY(-1px);
}

.chat-popup-support-call-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.48);
    outline-offset: 2px;
}

.chat-popup-support-call-btn:disabled {
    opacity: 0.72;
    cursor: wait;
}

.chat-popup-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chat Layout - Sidebar + Main */
.chat-popup-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Sidebar */
.chat-popup-sidebar {
    width: 200px;
    min-width: 160px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-popup-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.chat-popup-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    background: var(--bg-card);
    border: 1px solid transparent;
}

.chat-popup-list-item:hover {
    background: var(--bg-soft);
    border-color: var(--border);
}

.chat-popup-list-item.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: transparent;
}

.chat-popup-list-item.active .list-item-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.chat-popup-list-item.active .list-item-icon i {
    color: white;
}

.chat-popup-list-item.active .list-item-name,
.chat-popup-list-item.active .list-item-type {
    color: white;
}

.list-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.list-item-icon.teacher {
    background: linear-gradient(135deg, #10b981, #059669);
}

.list-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.list-item-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-type {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.list-item-badge {
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* System Notification Style */
/* 수업알림 (system) item: match the other list items when not selected
   (no yellow background/border). Active state stays red below. */
.chat-popup-list-item.system-notification {
    background: var(--bg-card);
    border: 1px solid transparent;
}

.chat-popup-list-item.system-notification:hover {
    background: var(--bg-soft);
    border-color: var(--border);
}

/* System Notification Active State - same as teacher selection */
.chat-popup-list-item.system-notification.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
}

.chat-popup-list-item.system-notification.active .list-item-name,
.chat-popup-list-item.system-notification.active .list-item-type {
    color: white;
}

.chat-popup-list-item.system-notification.active .list-item-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.chat-popup-list-item.system-notification.active .list-item-icon i {
    color: white;
}

/* AI Footer Button */
.chat-popup-ai-footer {
    padding: 0.5rem;
    background: var(--bg-card);
    flex-shrink: 0;
}

.chat-popup-ai-helper-text {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--c-64748b);
    margin-bottom: 0.45rem;
    text-align: center;
}

.chat-popup-ai-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-popup-ai-btn:hover {
    background: var(--bg-soft);
    border-color: var(--border);
    color: var(--text-primary);
}

.chat-popup-ai-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Main Content */
.chat-popup-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

/* Timezone Info */
.chat-popup-timezone {
    padding: 0.4rem 0.75rem;
    background: #f0f9ff;
    border-bottom: 1px solid #e0f2fe;
    font-size: 0.7rem;
    color: #ef4444;
    text-align: center;
    display: none;
    flex-shrink: 0;
}

.chat-popup-timezone.show {
    display: block;
}

/* Messages Area */
.chat-popup-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--bg-soft);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overscroll-behavior: contain;
}

.chat-popup-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.chat-popup-placeholder i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 0.75rem;
}

.chat-popup-placeholder p {
    font-size: 0.85rem;
    margin: 0;
}

.chat-popup-ai-starter {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    margin: 18px 0 18px;
}

.chat-popup-ai-starter.compact {
    margin: 20px 0 20px;
}

.chat-popup-ai-starter-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--c-0f172a);
    text-align: center;
    margin-top: 50px;
}

.chat-popup-ai-starter-subtitle {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--c-64748b);
    text-align: center;
}

.chat-popup-ai-starter-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.chat-popup-ai-starter-chip {
    border: 1px solid var(--b-cbd5e1);
    background: var(--bg-card);
    color: var(--c-0f172a);
    border-radius: 999px;
    padding: 0.45rem 0.78rem;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.chat-popup-ai-starter-chip:hover {
    background: #eef6ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

/* Input Area */
.chat-popup-input-area {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-popup-attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 0.4rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-popup-attach-btn:hover {
    background: var(--bg-dark);
    color: var(--primary);
}

.chat-popup-input {
    flex: 1;
    height: 36px;
    border-radius: 1rem;
    border: 1px solid var(--border);
    padding: 0 0.85rem;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-popup-input:focus {
    border-color: var(--primary);
}

.chat-popup-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 0.4rem;
    border: none;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-popup-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Send Button Wrapper (for translate popup positioning) */
.chat-popup-send-wrapper {
    position: relative;
    display: flex;
    flex-shrink: 0;
}

/* Translate Toggle Popup (floating above send button) */
.chat-popup-translate-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 10;
    animation: translatePopupFadeIn 0.2s ease;
}

.chat-popup-translate-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
}

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

.chat-popup-translate-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chat-popup-translate-label:hover {
    background: rgba(99, 102, 241, 0.15);
}

.chat-popup-translate-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #ef4444;
}

.chat-popup-translate-label i {
    font-size: 1rem;
}

/* File Preview */
.chat-popup-file-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.chat-popup-file-preview span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-popup-file-preview button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.chat-popup-file-preview button:hover {
    color: #ef4444;
}

/* Mobile Menu Button (hidden on desktop) */
.chat-popup-mobile-menu-btn {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.chat-popup-mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Sidebar Overlay */
.chat-popup-sidebar-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chat-popup-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.chat-popup-sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-popup {
        width: calc(100vw - 16px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 8px;
        left: 8px;
        min-width: auto;
    }

    .chat-popup-sidebar {
        width: 200px;
        min-width: 180px;
    }

    .chat-popup-admin-btn span,
    .chat-popup-ai-btn span {
        display: inline;
    }
}

@media (max-width: 600px) {
    /* Full screen chat popup on mobile */
    .chat-popup {
        position: fixed;
        top: var(--chat-popup-visual-top, 0px) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100vw !important;
        height: var(--chat-popup-visual-height, 100dvh) !important;
        max-height: var(--chat-popup-visual-height, 100dvh) !important;
        border-radius: 0;
        min-width: auto;
        min-height: auto;
        max-width: none;
    }

    .chat-popup.mobile-chat-viewport-active,
    .chat-popup.mobile-chat-viewport-active.open {
        transform: none;
        transition: opacity 0.16s ease, visibility 0.16s ease;
        box-shadow: 0 0 0 100vmax var(--bg-card);
    }

    /* Show mobile menu button */
    .chat-popup-mobile-menu-btn {
        display: flex;
    }

    /* Hide drag icon on mobile */
    .chat-popup-drag-icon {
        display: none;
    }

    /* Sidebar overlay visible on mobile */
    .chat-popup-sidebar-overlay {
        display: block;
        pointer-events: none;
    }

    /* Sidebar hidden by default, slide in from left */
    .chat-popup-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 80vw;
        z-index: 10;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        border-right: none;
    }

    /* Sidebar open state */
    .chat-popup-sidebar.open {
        transform: translateX(0);
    }

    /* Messages area takes full width */
    .chat-popup-main {
        flex: 1;
        min-height: 0;
        width: 100%;
        pointer-events: auto;
    }

    /* Adjust header for mobile */
    .chat-popup-header {
        padding: 0.65rem 0.75rem;
        pointer-events: auto;
    }

    .chat-popup-title {
        font-size: 0.95rem;
    }

    /* Smaller admin button on mobile */
    .chat-popup-admin-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        pointer-events: auto;
    }

    .chat-popup-support-call-btn {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        pointer-events: auto;
        touch-action: manipulation;
    }

    /* Better input area on mobile */
    .chat-popup-input-area {
        padding: 0.5rem;
        gap: 0.35rem;
        pointer-events: auto;
    }

    .chat-popup-input {
        height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
        pointer-events: auto;
        -webkit-appearance: none;
        appearance: none;
    }

    .chat-popup-attach-btn,
    .chat-popup-send-btn {
        width: 44px;
        height: 44px;
        pointer-events: auto;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
    }

    /* AI button shows text on mobile sidebar */
    .chat-popup-ai-btn span {
        display: inline;
    }

    /* Ensure all clickable elements work on mobile */
    .chat-popup-close,
    .chat-popup-mobile-menu-btn,
    .chat-popup-list-item,
    .chat-popup-ai-btn {
        pointer-events: auto;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
    }

    /* Chat popup layout */
    .chat-popup-layout {
        flex: 1;
        min-height: 0;
        position: relative;
        pointer-events: auto;
    }

    /* Messages area scrollable on mobile */
    .chat-popup-messages {
        -webkit-overflow-scrolling: touch;
        min-height: 0;
        overscroll-behavior: contain;
        touch-action: pan-y;
        pointer-events: auto;
    }
}

@media (max-width: 480px) {
    .floating-chat-btn {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .floating-chat-container {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .floating-chat-container {
        z-index: 1800 !important;
    }

    body.is-points-section .point-wallet-section {
        box-sizing: border-box;
        overflow-x: clip;
        padding-left: 14px;
        padding-right: 14px;
    }

    body.is-points-section .point-wallet-copy,
    body.is-points-section .point-wallet-balance-card,
    body.is-points-section .point-wallet-stat-card,
    body.is-points-section .point-wallet-grade-card,
    body.is-points-section .point-wallet-panel {
        width: 100%;
        max-width: 100%;
    }

    body.is-points-section .point-wallet-balance-card {
        overflow: visible;
        border-radius: 22px;
        min-height: 188px;
        padding: 1.15rem;
    }

    body.is-points-section .point-wallet-balance-card::before {
        inset: -12px;
        border-radius: 30px;
        filter: blur(15px) saturate(1.28);
    }

    body.is-points-section .floating-chat-container {
        display: none;
        right: max(14px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
        width: 52px;
        height: 44px;
        padding: 8px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.82);
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.72);
    }

    body.is-points-section .floating-chat-container .floating-popup-stack {
        display: none;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        transform: translateY(22px) scale(0.94);
    }

    body.is-points-section .floating-chat-container::after {
        opacity: 0.3;
    }

    html[data-theme="dark"] body.is-points-section .floating-chat-container {
        background: rgba(15, 23, 42, 0.86);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    }
}

/* Leveltest Result Modal */
.leveltest-result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 3000;
    display: none;
    align-items: flex-start;
    justify-content: flex-start;
}
.leveltest-result-modal {
    width: 1100px;
    max-width: 96vw;
    max-height: 92vh;
    background: var(--bg-card);
    border-radius: 18px;
    box-shadow: none !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.leveltest-result-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    cursor: move;
}
.leveltest-result-header-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1;
}
.leveltest-result-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.leveltest-result-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 1.4rem;
    cursor: pointer;
}
.leveltest-result-body {
    padding: 1.2rem 1.5rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}
.leveltest-result-avatar-toolbar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}
.leveltest-result-avatar-btn {
    border: none;
    border-radius: 999px;
    padding: 0.46rem 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.95);
    color: #075985;
    font-size: 0.84rem;
    line-height: 1;
    white-space: nowrap;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}
.leveltest-result-avatar-btn:hover:not(:disabled) {
    background: var(--bg-card);
    transform: translateY(-1px);
}
.leveltest-result-avatar-btn:disabled {
    cursor: progress;
    opacity: 0.72;
}
.leveltest-result-avatar-status {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.2);
}
.leveltest-result-avatar-status.is-error {
    color: #fee2e2;
}
.leveltest-result-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
    gap: 1.15rem;
    align-items: start;
}
.leveltest-result-left-panel,
.leveltest-result-right-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.leveltest-result-panel-title {
    padding: 0.8rem 1rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--b-e2e8f0);
    color: var(--c-0f172a);
    font-weight: 900;
}
.leveltest-resize-handle {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 16px;
    height: 16px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, #94a3b8 50%);
    opacity: 0.6;
}
.leveltest-result-loading,
.leveltest-result-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--c-475569);
    font-weight: 600;
    justify-content: center;
    padding: 2rem 0;
}
.leveltest-result-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    align-items: stretch;
}
.leveltest-summary-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--b-e2e8f0);
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}
.leveltest-summary-top {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--c-334155);
    margin-bottom: 50px;
}
.leveltest-summary-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}
.leveltest-summary-block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.leveltest-summary-time-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--c-64748b);
}
.leveltest-summary-time {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--c-0f172a);
    letter-spacing: -0.5px;
}
.leveltest-summary-sub {
    font-size: 0.85rem;
    color: var(--c-94a3b8);
}
.leveltest-summary-level {
    display: flex;
    align-items: center;
    justify-content: center;
}
.leveltest-level-ring {
    --level: 1;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.1rem;
    background:
        conic-gradient(
            rgba(249, 115, 22, 0.95) 0deg calc(var(--level) * 30deg),
            rgba(249, 115, 22, 0.18) 0deg
        );
    position: relative;
    font-weight: 800;
    color: var(--c-0f172a);
}
.leveltest-level-ring::before {
    content: '';
    position: absolute;
    inset: 18px;
    background: var(--bg-card);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px var(--b-e2e8f0);
}
.leveltest-level-label {
    position: relative;
    font-size: 1.25rem;
    font-weight: 800;
}
.leveltest-level-subject {
    position: relative;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--c-475569);
}
.leveltest-radar {
    background: var(--bg-soft);
    border-radius: 16px;
    border: 1px solid var(--b-e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.leveltest-score-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.leveltest-score-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--b-e2e8f0);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    align-items: center;
}
.leveltest-score-mini-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--c-0f172a);
    margin-bottom: 0.35rem;
}
.leveltest-score-mini-bar {
    width: 100%;
    height: 6px;
    background: var(--b-e2e8f0);
    border-radius: 999px;
    overflow: hidden;
}
.leveltest-score-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
}
.leveltest-score-mini-percent {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--c-1d4ed8);
}
.leveltest-score-text {
    font-size: 0.95rem;
    color: var(--c-475569);
    line-height: 1.5;
}
.leveltest-evaluation-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--b-dbeafe);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}
.leveltest-evaluation-title {
    font-size: 1.04rem;
    font-weight: 950;
    color: var(--c-0f172a);
    letter-spacing: -0.02em;
}
.leveltest-evaluation-body {
    color: var(--c-334155);
    font-size: 0.96rem;
    line-height: 1.72;
    word-break: keep-all;
}
.leveltest-evaluation-graph {
    margin-top: 0.1rem;
    padding: 0.72rem 0.82rem;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.94), rgba(239, 246, 255, 0.96));
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.leveltest-evaluation-graph-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.45rem;
    color: var(--c-0f172a);
    font-size: 0.86rem;
    font-weight: 900;
}
.leveltest-evaluation-graph-head strong {
    color: #047857;
    font-size: 0.95rem;
}
.leveltest-evaluation-graph-track {
    height: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    overflow: hidden;
}
.leveltest-evaluation-graph-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #22c55e, #38bdf8);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}
.leveltest-evaluation-line-graph {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: min(70%, 560px);
    margin: 0.35rem 0 0;
}
.leveltest-evaluation-line-track {
    flex: 1;
    height: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    overflow: hidden;
}
.leveltest-evaluation-line-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #22c55e);
}
.leveltest-evaluation-line-percent {
    min-width: 3rem;
    color: var(--c-0f172a);
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
}
.vtuber-learning-modal.lecture-mode .vtuber-lecture-inline-supplement {
    display: flow-root;
}
.vtuber-learning-modal.lecture-mode .vtuber-lecture-inline-supplement[data-lecture-supplement-key="grammar"],
.vtuber-learning-modal.lecture-mode .vtuber-lecture-inline-supplement[data-lecture-supplement-key="vocabulary"],
.vtuber-learning-modal.lecture-mode .vtuber-lecture-inline-supplement[data-lecture-supplement-key="expressiveness"],
.vtuber-learning-modal.lecture-mode .vtuber-lecture-inline-supplement[data-lecture-supplement-key="fluency"] {
    margin: 0.78rem 0 50px;
}
.vtuber-learning-modal.lecture-mode .vtuber-lecture-inline-supplement[data-lecture-supplement-key="recommended_textbook"] {
    margin: 0.78rem 0 70px;
}
.leveltest-avatar-review {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.leveltest-avatar-review-title {
    font-size: 1.16rem;
    font-weight: 950;
    color: var(--c-0f172a);
}
.leveltest-avatar-review-sections {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.leveltest-avatar-final {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}
.leveltest-avatar-recommend .leveltest-recommend-card {
    background: rgba(255, 255, 255, 0.96);
}
.leveltest-avatar-recommend-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.45rem 0 0;
}
.leveltest-avatar-recommend-image {
    width: 76px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    flex: 0 0 auto;
}
.leveltest-avatar-recommend-copy {
    flex: 1;
    min-width: 0;
}
.leveltest-avatar-recommend-name {
    color: var(--c-0f172a);
    font-size: 1rem;
    font-weight: 950;
    line-height: 1.35;
}
.leveltest-avatar-recommend-chapter {
    margin-top: 0.2rem;
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 900;
}
.leveltest-avatar-recommend-desc {
    margin-top: 0.38rem;
    color: var(--c-334155);
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.55;
}
.leveltest-avatar-recommend-view {
    flex: 0 0 auto;
    margin-right: 50px;
    border: 0;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    padding: 0.48rem 0.92rem;
    font-size: 0.84rem;
    font-weight: 900;
    cursor: pointer;
}
.leveltest-avatar-final-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: stretch;
}
.leveltest-avatar-time-card,
.leveltest-avatar-distribution,
.leveltest-avatar-overall {
    border: 1px solid var(--b-e2e8f0);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    padding: 1rem;
}
.leveltest-avatar-time-label,
.leveltest-avatar-distribution-title {
    color: var(--c-64748b);
    font-size: 0.86rem;
    font-weight: 900;
}
.leveltest-avatar-time-main {
    margin-top: 0.45rem;
    color: var(--c-0f172a);
    font-size: 1.04rem;
    font-weight: 950;
}
.leveltest-avatar-time-sub {
    margin-top: 0.4rem;
    color: var(--c-475569);
    font-size: 0.88rem;
    font-weight: 800;
}
.leveltest-avatar-distribution .leveltest-radar {
    margin-top: 0.55rem;
    padding: 0.45rem;
}
.leveltest-avatar-overall {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.leveltest-avatar-overall-inline {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.leveltest-avatar-overall-inline .leveltest-overall-title {
    color: var(--c-0f172a);
    font-size: 1.32rem;
    font-weight: 950;
    letter-spacing: -0.02em;
}
.leveltest-avatar-overall-inline .leveltest-overall-body {
    color: var(--c-0f172a);
    font-family: inherit;
    font-size: 1.18rem;
    font-weight: 400;
    line-height: 1.85;
}
.leveltest-avatar-overall-inline .leveltest-overall-body p {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}
.leveltest-avatar-time-summary,
.leveltest-avatar-distribution-inline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    height: 100%;
    box-sizing: border-box;
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--b-e2e8f0);
    border-radius: 16px;
    background: var(--bg-card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.leveltest-avatar-time-summary .leveltest-summary-content {
    margin-top: 0.65rem;
    gap: 50px;
}
.leveltest-avatar-distribution-inline .leveltest-radar {
    margin-top: 0.35rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.leveltest-avatar-distribution-inline .leveltest-radar svg polygon[fill="none"],
.leveltest-avatar-distribution-inline .leveltest-radar svg line {
    stroke: transparent;
}
.leveltest-ai-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.leveltest-ai-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.leveltest-ai-section-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: #7c2d12;
}
.leveltest-ai-section-body {
    font-size: 0.95rem;
    color: #7c2d12;
    line-height: 1.6;
}
.leveltest-score-list {
    margin: 0;
    padding-left: 1.1rem;
    color: #7c2d12;
    font-size: 0.95rem;
    line-height: 1.6;
}
.leveltest-correction-card {
    border: 1px solid var(--b-e5e7eb);
    border-radius: 14px;
    background: var(--bg-card);
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0;
}
.leveltest-correction-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--c-334155);
    background: var(--bg-soft);
    border-bottom: 1px solid var(--b-e5e7eb);
    padding: 0.55rem 0;
}
.leveltest-correction-head > div {
    padding: 0 1rem;
}
.leveltest-correction-head > div:first-child {
    border-right: 1px solid var(--b-e5e7eb);
}
.leveltest-correction-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.leveltest-correction-col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
}
.leveltest-correction-col:first-child {
    border-right: 1px solid var(--b-e5e7eb);
}
.leveltest-correction-text-large {
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-0f172a);
    line-height: 1.5;
}
.leveltest-diff {
    color: #dc2626;
    font-weight: 800;
    background: rgba(220, 38, 38, 0.08);
    padding: 0 2px;
    border-radius: 3px;
}
.leveltest-delete-diff {
    color: #2563eb;
    font-weight: 800;
    background: rgba(37, 99, 235, 0.08);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    padding: 0 2px;
    border-radius: 3px;
}
.leveltest-correction-meta {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--c-0f172a);
    border-top: 1px solid var(--b-e5e7eb);
    background: var(--bg-soft);
    padding: 0.7rem 1rem;
}
.leveltest-overall {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 16px;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.leveltest-overall-icon {
    font-size: 1.8rem;
    color: #fbbf24;
    line-height: 1;
    margin-top: 0.1rem;
}
.leveltest-overall-content {
    flex: 1;
}
.leveltest-overall-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}
.leveltest-overall-body {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--b-e2e8f0);
}
.leveltest-recommend-group {
    position: relative;
    margin: 1.2rem 0;
    padding: 1.4rem 1.5rem 1.2rem;
    border-radius: 16px;
    border: 1px solid var(--b-e2e8f0);
    background: var(--bg-soft);
}
.leveltest-recommend-group-title {
    position: absolute;
    top: -0.7rem;
    left: 1.2rem;
    padding: 0 0.6rem;
    background: var(--bg-soft);
    font-weight: 800;
    color: var(--c-0f172a);
    font-size: 0.95rem;
}
.leveltest-recommend-card {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 0.2rem 0;
}
.leveltest-recommend-media img,
.leveltest-recommend-placeholder {
    width: 120px;
    height: 170px;
    border-radius: 12px;
}
.leveltest-recommend-media img {
    object-fit: cover;
}
.leveltest-recommend-placeholder {
    background: var(--b-e2e8f0);
    border: 1px solid var(--b-e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-94a3b8);
    font-size: 2rem;
}
.leveltest-recommend-media {
    display: flex;
    align-items: center;
    justify-content: center;
}
.leveltest-recommend-info {
    flex: 1;
    min-width: 0;
}
.leveltest-recommend-name {
    font-weight: 800;
    color: var(--c-0f172a);
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}
.leveltest-recommend-chapter {
    font-size: 0.9rem;
    color: var(--c-334155);
    margin-bottom: 0.4rem;
    font-weight: 600;
}
.leveltest-recommend-level {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: #e0f2fe;
    color: var(--c-0f172a);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.leveltest-recommend-desc {
    font-size: 0.85rem;
    color: var(--c-475569);
    line-height: 1.7;
    word-break: keep-all;
    white-space: normal;
}
.leveltest-recommend-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}
.leveltest-recommend-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.1rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}
.leveltest-corrections {
    background: transparent;
    border-radius: 0;
    border: none;
    padding: 0;
}
.leveltest-corrections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}
.leveltest-view-toggle {
    display: inline-flex;
    background: var(--b-e2e8f0);
    border-radius: 999px;
    padding: 0.25rem;
    gap: 0.25rem;
}
.leveltest-view-toggle button {
    border: none;
    background: transparent;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--c-475569);
    font-weight: 600;
}
.leveltest-view-toggle button.active {
    background: var(--bg-card);
    color: var(--c-0f172a);
    box-shadow: 0 2px 6px rgba(15,23,42,0.12);
}
.leveltest-correction-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.leveltest-recording-panel {
    margin-top: 1rem;
    border: 1px solid var(--b-dbeafe);
    border-radius: 14px;
    background: #f8fbff;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.leveltest-recording-panel.is-inline {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 760px;
    margin-top: 0;
    padding: 0.5rem 0.6rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}
.leveltest-recording-panel.is-inline .leveltest-recording-title {
    flex: 0 0 auto;
    font-size: 0.78rem;
    white-space: nowrap;
}
.leveltest-recording-panel.is-inline .leveltest-recording-list {
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: row;
    justify-content: flex-end;
    gap: 0.45rem;
}
.leveltest-recording-panel.is-inline .leveltest-recording-row {
    min-width: 0;
    flex: 1 1 260px;
    grid-template-columns: auto minmax(145px, 1fr) 30px;
    gap: 0.4rem;
    padding: 0.35rem 0.4rem;
}
.leveltest-recording-panel.is-inline .leveltest-recording-row.no-label {
    grid-template-columns: minmax(145px, 1fr) 30px;
}
.leveltest-recording-panel.is-inline .leveltest-recording-label {
    font-size: 0.72rem;
}
.leveltest-recording-panel.is-inline .leveltest-recording-audio {
    min-width: 145px;
    height: 30px;
}
.leveltest-recording-panel.is-inline .leveltest-recording-download {
    width: 30px;
    height: 30px;
}
.leveltest-recording-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--c-0f172a);
}
.leveltest-recording-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.leveltest-recording-row {
    display: grid;
    grid-template-columns: minmax(90px, auto) minmax(220px, 1fr) 36px;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--b-e2e8f0);
}
.leveltest-recording-row.no-label {
    grid-template-columns: minmax(220px, 1fr) 36px;
}
.leveltest-recording-label {
    color: var(--c-334155);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}
.leveltest-recording-audio {
    width: 100%;
    height: 34px;
}
.leveltest-recording-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
}
.leveltest-correction-item {
    background: var(--bg-card);
    border: 1px solid var(--b-e2e8f0);
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}
.leveltest-correction-question {
    font-weight: 700;
    color: var(--c-0f172a);
    font-size: 0.85rem;
}
.leveltest-question-sep {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--c-0f172a);
}
.leveltest-question-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--b-e2e8f0);
}
.leveltest-conversation {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.leveltest-bubble {
    max-width: 80%;
    padding: 0.7rem 0.9rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}
.leveltest-bubble.teacher {
    align-self: flex-start;
    background: var(--bg-soft);
    color: var(--c-0f172a);
    border-bottom-left-radius: 4px;
}
.leveltest-bubble.student {
    align-self: flex-end;
    background: #e0f2fe;
    color: var(--c-0f172a);
    border-bottom-right-radius: 4px;
}
.leveltest-bubble-meta {
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--c-64748b);
}
.leveltest-bubble-body {
    white-space: pre-wrap;
}
.leveltest-correction-block {
    margin-top: 0.6rem;
    background: var(--bg-soft);
    border: none;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    color: var(--c-0f172a);
    font-size: 0.95rem;
    line-height: 1.6;
}
.leveltest-correction-text {
    font-size: 0.95rem;
    color: var(--c-0f172a);
    line-height: 1.6;
    background: var(--bg-soft);
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
}
.leveltest-correction-block .leveltest-ai-section-title,
.leveltest-correction-block .leveltest-ai-section-body,
.leveltest-correction-block .leveltest-score-list,
.leveltest-correction-block .leveltest-correction-text-large,
.leveltest-correction-block .leveltest-correction-meta,
.leveltest-correction-block .leveltest-correction-head {
    color: var(--c-0f172a);
}
.leveltest-correction-block .leveltest-correction-card {
    border: 1px solid var(--b-e5e7eb);
    background: var(--bg-card);
    padding: 0;
}
.leveltest-correction-block .leveltest-correction-card + .leveltest-correction-card {
    margin-top: 0.9rem;
}
.leveltest-md-heading {
    font-weight: 800;
    margin-bottom: 0.35rem;
}
.leveltest-md-item,
.leveltest-md-line {
    margin-bottom: 0.3rem;
}
.leveltest-md-item:last-child,
.leveltest-md-line:last-child {
    margin-bottom: 0;
}
.leveltest-muted {
    color: var(--c-94a3b8);
}
.leveltest-empty {
    font-size: 0.75rem;
    color: var(--c-94a3b8);
    padding: 0.5rem 0;
}

@media (max-width: 900px) {
    .leveltest-result-overlay {
        align-items: center;
        justify-content: center;
    }
    .leveltest-result-modal {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        left: 50%;
        top: 50%;
    }
    .leveltest-result-grid {
        grid-template-columns: 1fr;
    }
    .leveltest-result-top {
        grid-template-columns: 1fr;
    }
    .leveltest-summary-top {
        margin-bottom: 1.4rem;
    }
    .leveltest-summary-content {
        gap: 1.4rem;
    }
    .leveltest-recommend-card {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }
    .leveltest-recommend-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .leveltest-summary-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .leveltest-summary-card,
    .leveltest-avatar-time-summary {
        padding: 1.05rem 1rem;
    }
    .leveltest-summary-card .leveltest-summary-top,
    .leveltest-avatar-time-summary .leveltest-summary-top {
        margin-bottom: 0;
        text-align: center;
        line-height: 1.45;
        word-break: keep-all;
    }
    .leveltest-summary-card .leveltest-summary-content,
    .leveltest-avatar-time-summary .leveltest-summary-content {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.85rem;
        width: 100%;
        margin-top: 0;
    }
    .leveltest-summary-card .leveltest-summary-block,
    .leveltest-avatar-time-summary .leveltest-summary-block {
        align-items: center;
        min-width: 0;
        text-align: center;
    }
    .leveltest-summary-card .leveltest-summary-level,
    .leveltest-avatar-time-summary .leveltest-summary-level {
        justify-content: flex-end;
    }
    .leveltest-summary-card .leveltest-level-ring,
    .leveltest-avatar-time-summary .leveltest-level-ring {
        width: clamp(104px, 30vw, 126px);
        height: clamp(104px, 30vw, 126px);
    }
    .leveltest-summary-card .leveltest-level-ring::before,
    .leveltest-avatar-time-summary .leveltest-level-ring::before {
        inset: 16px;
    }
    .leveltest-avatar-final-row {
        grid-template-columns: 1fr;
    }
    .leveltest-correction-row {
        grid-template-columns: 1fr;
    }
    .leveltest-score-row {
        grid-template-columns: 1fr;
    }
    .leveltest-corrections-header {
        align-items: stretch;
        flex-direction: column;
        gap: 0.55rem;
    }
    .leveltest-recording-panel.is-inline {
        width: 100%;
        max-width: none;
        align-items: stretch;
        flex-direction: column;
    }
    .leveltest-recording-panel.is-inline .leveltest-recording-list {
        flex-direction: column;
    }
    .leveltest-recording-panel.is-inline .leveltest-recording-row {
        flex: 0 0 auto;
        grid-template-columns: minmax(0, 1fr) 34px;
        gap: 0.35rem 0.55rem;
        padding: 0.55rem;
    }
    .leveltest-recording-panel.is-inline .leveltest-recording-row.no-label {
        grid-template-columns: minmax(0, 1fr) 34px;
    }
    .leveltest-recording-panel.is-inline .leveltest-recording-row.no-label .leveltest-recording-audio {
        grid-column: 1;
        grid-row: 1;
    }
    .leveltest-recording-panel.is-inline .leveltest-recording-row.no-label .leveltest-recording-download {
        grid-column: 2;
        grid-row: 1;
    }
    .leveltest-recording-panel.is-inline .leveltest-recording-label {
        grid-column: 1;
        grid-row: 1;
    }
    .leveltest-recording-panel.is-inline .leveltest-recording-audio {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        min-width: 0;
    }
    .leveltest-recording-panel.is-inline .leveltest-recording-download {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }
    .leveltest-recording-row {
        grid-template-columns: 1fr;
    }
    .leveltest-recording-download {
        justify-self: flex-end;
    }
}

/* =========================================================================
   THEME SWITCH  (Dark | Light | System) — sidebar box. Base styling works in
   both light and dark; mirrors the .sidebar-language box form.
   ========================================================================= */
.sidebar-theme {
    margin-top: 0.5rem;
    margin-bottom: 6px;
    padding: 0.4rem var(--spacing-md);
    background: var(--bg-white);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.sidebar-theme-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.theme-switch {
    position: relative;
    display: flex;
    align-items: stretch;
    padding: 3px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.32);
}

.theme-switch-thumb {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc((100% - 6px) / 3);
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 0;
}

.theme-switch[data-active="dark"] .theme-switch-thumb { transform: translateX(0); }
.theme-switch[data-active="light"] .theme-switch-thumb { transform: translateX(100%); }
.theme-switch[data-active="system"] .theme-switch-thumb { transform: translateX(200%); }

.theme-switch-opt {
    position: relative;
    z-index: 1;
    width: 30px;
    border: none;
    background: transparent;
    padding: 0.28rem 0;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.theme-switch-opt:hover { color: var(--text-secondary); }
.theme-switch-opt.is-active { color: #ffffff; }
.theme-switch-opt:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 999px; }

/* =========================================================================
   DARK MODE  —  mypage.html only.  Solid navy palette, minimal gradient/purple.
   Surface #0B1326 · Primary (emerald) #10B981 · Accent (blue) #3B82F6
   Most of the UI is variable-driven, so re-defining the variables themes the
   page, header, cards, modals and inputs in one place.
   ========================================================================= */
html[data-theme="dark"] {
    --primary: #10B981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --calendar-accent-blue: #3B82F6;
    --calendar-weekday-bg: #1d4ed8;
    --calendar-nav-bg: #16243f;

    --bg-darker: #0B1326;   /* page surface */
    --bg-card:   #141f36;   /* cards, modals, header, boxes */
    --bg-soft:   #1c2942;   /* subtle / nested panels */
    --bg-dark:   #1c2942;   /* hover / active surface */
    --bg-secondary: #243358;
    --bg-glass:  rgba(255, 255, 255, 0.06);
    --bg-white:  #141f36;

    --text-primary: #e6ebf4;
    --text-secondary: #aebad0;
    --text-muted: #8593ac;

    --border: rgba(255, 255, 255, 0.10);

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 10px -2px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 14px 28px -8px rgba(0, 0, 0, 0.65);

    /* Dark values for the mapped text colors (originally dark slate/gray text) */
    --c-0f172a: #e9eef6; --c-111827: #e9eef6; --c-1e293b: #dde5f1; --c-1f2937: #d8e0ed;
    --c-334155: #c3cee0; --c-374151: #c3cee0; --c-475569: #b6c2d7; --c-4b5563: #c3cee0;
    --c-64748b: #a2b2cb; --c-94a3b8: #aebcd2; --c-7a7a7a: #aab2bf; --c-7d8694: #adb9ca;
    --c-1d4ed8: #6ea8fe; --c-4338ca: #9db4ff; --c-4f46e5: #9db4ff;
    /* Dark values for the mapped border colors (faint light-on-dark hairlines) */
    --b-e2e8f0: rgba(148,163,184,0.20); --b-e5e7eb: rgba(148,163,184,0.20);
    --b-dbe4f0: rgba(148,163,184,0.20); --b-cbd5e1: rgba(148,163,184,0.24);
    --b-c7d2fe: rgba(129,140,248,0.30); --b-a5b4fc: rgba(129,140,248,0.35);
    --b-dbeafe: rgba(96,165,250,0.22); --b-e3e8f5: rgba(148,163,184,0.20);
    --b-dce5f4: rgba(148,163,184,0.20); --b-dbe5f4: rgba(148,163,184,0.20);
    --b-d9d9d9: rgba(148,163,184,0.22);

    color-scheme: dark;
}

/* Page + loading backdrop (the loader forces white otherwise → flash) */
html[data-theme="dark"] body { background: var(--bg-darker); color: var(--text-primary); }
html[data-theme="dark"].mypage-app-loading body,
html[data-theme="dark"].mypage-bundle-loading body,
html[data-theme="dark"].i18n-loading body { background: var(--bg-darker); }
html[data-theme="dark"] .header { color: var(--text-primary); }

/* Sidebar links (sit over the now-dark page surface) */
html[data-theme="dark"] .sidebar-link { color: var(--text-secondary); }
html[data-theme="dark"] .sidebar-link:hover { color: var(--text-primary); }

/* Inputs / selects / textareas (many hardcode white bg + dark text) */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: var(--bg-dark) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--text-muted) !important; }
html[data-theme="dark"] select option { background-color: var(--bg-card); color: var(--text-primary); }

/* Modal chrome that hardcodes light borders */
html[data-theme="dark"] .modal-header { border-bottom-color: var(--border) !important; }
html[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.66); }

/* Neutralize the indigo/purple gradient buttons → solid (no purple, no gradient) */
html[data-theme="dark"] #appSyncBtn { background: #243358 !important; }
html[data-theme="dark"] #customerCounselBtn { background: #2563eb !important; }

/* Catch INLINE white / near-white backgrounds in HTML + JS-rendered markup.
   Dark-scoped only (light mode untouched). We match only the background
   declaration, never color:, so white text is preserved. */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#FFF"],
html[data-theme="dark"] [style*="background: #FFF"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color:#FFF"],
html[data-theme="dark"] [style*="background-color: #FFF"],
html[data-theme="dark"] [style*="background-color:white"],
html[data-theme="dark"] [style*="background-color: white"] {
    background-color: var(--bg-card) !important;
}
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f9fafb"],
html[data-theme="dark"] [style*="background: #f9fafb"],
html[data-theme="dark"] [style*="background:#f1f5f9"],
html[data-theme="dark"] [style*="background: #f1f5f9"],
html[data-theme="dark"] [style*="background:#f3f4f6"],
html[data-theme="dark"] [style*="background: #f3f4f6"],
html[data-theme="dark"] [style*="background:#f5f5f5"],
html[data-theme="dark"] [style*="background: #f5f5f5"],
html[data-theme="dark"] [style*="background:#eef2ff"],
html[data-theme="dark"] [style*="background: #eef2ff"],
html[data-theme="dark"] [style*="background-color:#f8fafc"],
html[data-theme="dark"] [style*="background-color: #f8fafc"] {
    background-color: var(--bg-soft) !important;
}

/* Inline dark text → readable on dark surfaces (common hardcoded values) */
html[data-theme="dark"] [style*="color:#333"],
html[data-theme="dark"] [style*="color: #333"],
html[data-theme="dark"] [style*="color:#111"],
html[data-theme="dark"] [style*="color: #111"],
html[data-theme="dark"] [style*="color:#222"],
html[data-theme="dark"] [style*="color: #222"],
html[data-theme="dark"] [style*="color:#000"],
html[data-theme="dark"] [style*="color: #000"],
html[data-theme="dark"] [style*="color: var(--c-1f2937)"],
html[data-theme="dark"] [style*="color: var(--c-1f2937)"],
html[data-theme="dark"] [style*="color: var(--c-374151)"],
html[data-theme="dark"] [style*="color: var(--c-374151)"] {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .order-point-section {
    background: transparent !important;
    border-color: rgba(34, 197, 94, 0.38) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .order-point-legend {
    color: #5eead4 !important;
}

html[data-theme="dark"] .order-point-copy {
    color: #e6ebf4 !important;
}

html[data-theme="dark"] .order-point-copy strong {
    background: transparent !important;
    color: #5eead4 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

html[data-theme="dark"] .order-point-copy small {
    color: #c8d2e2 !important;
}

html[data-theme="dark"] .order-point-summary,
html[data-theme="dark"] .order-price-point-note {
    color: #86efac !important;
}

html[data-theme="dark"] .order-referral-section {
    background: rgba(15, 23, 42, 0.22) !important;
    border-color: rgba(96, 165, 250, 0.32) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .order-referral-legend {
    color: #93c5fd !important;
}

html[data-theme="dark"] .order-referral-toggle {
    color: #dbeafe !important;
}

html[data-theme="dark"] .order-referral-copy {
    color: #c8d2e2 !important;
}

html[data-theme="dark"] .order-referral-input {
    background: #121d34 !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] .order-referral-search-btn {
    background: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.18) !important;
}

html[data-theme="dark"] .order-referral-search-btn:hover {
    background: #2563eb !important;
}

html[data-theme="dark"] .order-referral-result {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(74, 222, 128, 0.32) !important;
    color: #d1fae5 !important;
}

html[data-theme="dark"] .order-referral-clear-btn {
    background: #17223a !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
    color: #e6ebf4 !important;
}

/* Scrollbars */
html[data-theme="dark"] { scrollbar-color: #2b3a5c var(--bg-darker); }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--bg-darker); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2b3a5c; border-radius: 999px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3a4d77; }

/* -------------------------------------------------------------------------
   DARK MODE — targeted fixes for hardcoded LIGHT GRADIENTS (these never
   resolve through the variables) and a few element-specific surfaces.
   Light mode is untouched (all rules are dark-scoped).
   ------------------------------------------------------------------------- */
/* (3) Student-time box */
html[data-theme="dark"] .sidebar-time { background: var(--bg-card); }
html[data-theme="dark"] .sidebar-time-value { color: var(--text-primary); }
html[data-theme="dark"] .sidebar-time-date { color: var(--text-secondary); }

/* (2) Weekly schedule class cards */
html[data-theme="dark"] .calendar-week-class-card,
html[data-theme="dark"] .calendar-week-class-card.level-test,
html[data-theme="dark"] .calendar-week-class-card.fixed-class,
html[data-theme="dark"] .calendar-week-class-card.free-class,
html[data-theme="dark"] .calendar-week-class-card.trial-class { background: var(--bg-card) !important; border-color: rgba(148,163,184,0.22); }
html[data-theme="dark"] .calendar-week-class-card.trial-class,
html[data-theme="dark"] .calendar-day .class-item.trial-class { border-color: rgba(34, 211, 238, 0.62) !important; }
html[data-theme="dark"] .calendar-week-class-card:hover { border-color: rgba(96,165,250,0.5); }
html[data-theme="dark"] .calendar-week-avatar-prep { background: var(--bg-soft) !important; }

/* (6) Order history table  +  (8) AI app list table — header rows */
html[data-theme="dark"] .orders-table th,
html[data-theme="dark"] .ai-apps-table th { background: var(--bg-soft) !important; color: var(--text-secondary) !important; }
html[data-theme="dark"] .orders-table td,
html[data-theme="dark"] .ai-apps-table td { color: var(--text-primary); }
html[data-theme="dark"] .orders-table tr:hover td { background: rgba(255,255,255,0.03); }

/* (6/7) Orders analytics + (11) profile/security/account cards (light gradients) */
html[data-theme="dark"] .orders-analytics-trigger,
html[data-theme="dark"] .orders-analytics-header,
html[data-theme="dark"] .orders-analytics-body,
html[data-theme="dark"] .orders-analytics-chart-panel,
html[data-theme="dark"] .profile-avatar-section,
html[data-theme="dark"] .password-sticker-card,
html[data-theme="dark"] .account-link-body { background: var(--bg-card) !important; }

/* (5) Level-test result modal */
html[data-theme="dark"] .leveltest-result-modal { background: var(--bg-card); color: var(--text-primary); }
html[data-theme="dark"] .leveltest-result-title { color: var(--text-primary); }

/* (13) Selected sidebar menu item stays emerald with white text */
html[data-theme="dark"] .sidebar-link.active { background: var(--primary) !important; color: #ffffff !important; }

/* Point and grade wallet, including the compact summary beside Today's Classes. */
html[data-theme="dark"] .point-wallet-section {
    color: var(--text-primary);
}

html[data-theme="dark"] .point-wallet-header .point-wallet-pill {
    background: rgba(20, 31, 54, 0.92);
    border-color: rgba(148, 163, 184, 0.28);
    color: var(--text-primary);
}

html[data-theme="dark"] .point-wallet-summary-btn {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(19, 78, 74, 0.9)),
        linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(96, 165, 250, 0.16));
    border-color: rgba(94, 234, 212, 0.24);
    color: var(--text-primary);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .point-wallet-summary-btn:hover,
html[data-theme="dark"] .point-wallet-summary-btn:focus-visible {
    border-color: rgba(94, 234, 212, 0.52);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42), 0 0 0 3px rgba(45, 212, 191, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

html[data-theme="dark"] .sidebar-point-wallet .point-wallet-pill,
html[data-theme="dark"] .point-wallet-header-mobile .point-wallet-pill,
html[data-theme="dark"] .point-wallet-summary-btn .point-wallet-pill {
    background: transparent;
    border-color: transparent;
    color: var(--text-primary);
}

html[data-theme="dark"] .point-wallet-summary-btn .point-wallet-label {
    color: #bae6fd;
}

html[data-theme="dark"] .point-wallet-summary-btn .point-wallet-value {
    color: #ffffff;
}

html[data-theme="dark"] .point-wallet-summary-divider {
    background: linear-gradient(180deg, transparent, rgba(125, 211, 252, 0.42), transparent);
}

html[data-theme="dark"] .point-wallet-header .point-wallet-pill.points i {
    color: #5eead4;
}

html[data-theme="dark"] .point-wallet-header .point-wallet-pill.score i {
    color: #93c5fd;
}

html[data-theme="dark"] .point-wallet-header .point-wallet-pill.is-updating {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

html[data-theme="dark"] .point-wallet-summary-btn.is-updating {
    background:
        linear-gradient(135deg, rgba(6, 78, 59, 0.98), rgba(15, 118, 110, 0.88)),
        linear-gradient(135deg, rgba(52, 211, 153, 0.18), rgba(45, 212, 191, 0.14));
    border-color: rgba(52, 211, 153, 0.58);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.44), 0 0 0 4px rgba(16, 185, 129, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .point-wallet-delta {
    color: #fee2e2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.82), 0 0 18px rgba(248, 113, 113, 0.72), 0 0 2px rgba(255, 255, 255, 0.82);
}

html[data-theme="dark"] .point-wallet-delta.negative {
    color: #dbeafe;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.82), 0 0 18px rgba(96, 165, 250, 0.72), 0 0 2px rgba(255, 255, 255, 0.82);
}

html[data-theme="dark"] .today-class-wallet-divider {
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.46), transparent);
}

html[data-theme="dark"] .point-wallet-copy,
html[data-theme="dark"] .point-wallet-grade-card,
html[data-theme="dark"] .point-wallet-stat-card,
html[data-theme="dark"] .point-wallet-panel {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
}

html[data-theme="dark"] .point-wallet-copy {
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.12), transparent 56%),
        var(--bg-card);
}

html[data-theme="dark"] .point-wallet-kicker,
html[data-theme="dark"] .point-wallet-note-row span {
    background: rgba(16, 185, 129, 0.14);
    color: #86efac;
}

html[data-theme="dark"] .point-wallet-copy h2,
html[data-theme="dark"] .point-wallet-panel h3,
html[data-theme="dark"] .point-wallet-list-row strong,
html[data-theme="dark"] .point-wallet-policy-card strong,
html[data-theme="dark"] .point-wallet-grade-card strong,
html[data-theme="dark"] .point-wallet-stat-card strong {
    color: var(--text-primary);
}

html[data-theme="dark"] .point-wallet-copy p,
html[data-theme="dark"] .point-wallet-panel-title span,
html[data-theme="dark"] .point-wallet-grade-card small,
html[data-theme="dark"] .point-wallet-stat-card small,
html[data-theme="dark"] .point-wallet-policy-card p,
html[data-theme="dark"] .point-wallet-list-row small,
html[data-theme="dark"] .point-wallet-ledger-footer,
html[data-theme="dark"] .point-wallet-balance-card span,
html[data-theme="dark"] .point-wallet-stat-card span,
html[data-theme="dark"] .point-wallet-grade-card span,
html[data-theme="dark"] .point-wallet-policy-card span {
    color: var(--text-secondary);
}

html[data-theme="dark"] .point-wallet-balance-card {
    --point-wallet-glow-hue: 215;
    background: #05000f;
}

html[data-theme="dark"] .point-wallet-balance-rule div {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .point-wallet-balance-rule em,
html[data-theme="dark"] .point-wallet-balance-rule b {
    color: var(--text-primary);
}

html[data-theme="dark"] .point-wallet-stat-icon {
    background: rgba(251, 191, 36, 0.16);
    color: #fde68a;
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.18);
}

html[data-theme="dark"] .point-wallet-stat-card--score .point-wallet-stat-icon {
    background: rgba(96, 165, 250, 0.16);
    color: #93c5fd;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.18);
}

html[data-theme="dark"] .point-wallet-stat-card--grade .point-wallet-stat-icon {
    background: rgba(52, 211, 153, 0.16);
    color: #86efac;
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.18);
}

html[data-theme="dark"] .point-wallet-progress {
    background: rgba(148, 163, 184, 0.24);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .point-wallet-panel-title,
html[data-theme="dark"] .point-wallet-list-row,
html[data-theme="dark"] .point-wallet-ledger-footer {
    border-color: var(--border);
}

html[data-theme="dark"] .point-wallet-policy-card {
    background: var(--bg-soft);
    border-color: var(--border);
}

html[data-theme="dark"] .point-wallet-page-btn {
    background: var(--bg-soft);
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .point-wallet-page-btn:hover:not(:disabled),
html[data-theme="dark"] .point-wallet-page-btn:focus-visible:not(:disabled),
html[data-theme="dark"] .point-wallet-page-btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #042015;
}

/* (16) Class-detail modal: dim borders, theme the (right) translation side */
html[data-theme="dark"] #classDetailModal .class-detail-header { border-bottom-color: var(--border); }
html[data-theme="dark"] #classDetailModal [class*="translation"],
html[data-theme="dark"] #classDetailModal [class*="-right"],
html[data-theme="dark"] #classDetailModal [class*="conversation"] { background-color: transparent; color: var(--text-primary); }

/* (4) Reschedule / postpone / makeup / textbook-change modals: ensure body text
   is readable (headers are already green from a prior change). */
html[data-theme="dark"] .modal .modal-body,
html[data-theme="dark"] .modal-body { color: var(--text-primary); }

/* (9) App-UID modal body text */
html[data-theme="dark"] #appUidModalContent { color: var(--text-primary); }

html[data-theme="dark"] .ai-apps-help-list,
html[data-theme="dark"] .ai-apps-header-note {
    color: var(--text-secondary);
}

html[data-theme="dark"] .ai-token-point-card {
    background: #111827;
    background: var(--bg-primary, #111827);
    border-color: var(--border);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .ai-token-point-balance,
html[data-theme="dark"] .ai-token-point-result {
    background: var(--bg-soft);
    border-color: var(--border);
}

html[data-theme="dark"] .ai-token-point-close {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

html[data-theme="dark"] .ai-token-point-close:hover {
    background: rgba(255, 255, 255, 0.26);
}

html[data-theme="dark"] .ai-token-point-field input {
    background: #111827;
    background: var(--bg-primary, #111827);
    border-color: var(--border);
    color: var(--text-primary);
}

/* Broaden inline text-color catch-all to the slate/gray family that JS-rendered
   modals use inline (counsel, app-uid, chat, class-detail …). Dark-scoped only.
   Strong/near-black greys → bright; mid greys → secondary. */
html[data-theme="dark"] [style*="color:#0f172a"], html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color:#111827"], html[data-theme="dark"] [style*="color: #111827"],
html[data-theme="dark"] [style*="color:#1e293b"], html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color:#334155"], html[data-theme="dark"] [style*="color: #334155"],
html[data-theme="dark"] [style*="color:#1a202c"], html[data-theme="dark"] [style*="color: #1a202c"] {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] [style*="color:#475569"], html[data-theme="dark"] [style*="color: #475569"],
html[data-theme="dark"] [style*="color:#4b5563"], html[data-theme="dark"] [style*="color: #4b5563"],
html[data-theme="dark"] [style*="color:#64748b"], html[data-theme="dark"] [style*="color: #64748b"],
html[data-theme="dark"] [style*="color:#6b7280"], html[data-theme="dark"] [style*="color: #6b7280"],
html[data-theme="dark"] [style*="color:#94a3b8"], html[data-theme="dark"] [style*="color: #94a3b8"],
html[data-theme="dark"] [style*="color:#9ca3af"], html[data-theme="dark"] [style*="color: #9ca3af"],
html[data-theme="dark"] [style*="color:#7a7a7a"], html[data-theme="dark"] [style*="color: #7a7a7a"],
html[data-theme="dark"] [style*="color:#7d8694"], html[data-theme="dark"] [style*="color: #7d8694"] {
    color: var(--text-secondary) !important;
}

/* Inline light borders in JS markup → faint hairline */
html[data-theme="dark"] [style*="1px solid #e2e8f0"], html[data-theme="dark"] [style*="1px solid #e5e7eb"],
html[data-theme="dark"] [style*="1px solid #cbd5f5"], html[data-theme="dark"] [style*="1px solid #cbd5e1"],
html[data-theme="dark"] [style*="1px dashed #cbd5f5"], html[data-theme="dark"] [style*="1px solid #eee"] {
    border-color: rgba(148,163,184,0.22) !important;
}

/* (17) mybookflip — dark backdrop + dark "paper". These rules are mypage-scoped
   (html[data-theme="dark"] is only set on mypage), so the book stays light on
   the public index page. mybookflip injects its own <style>; our selectors have
   higher specificity so they win regardless of injection order. */
html[data-theme="dark"] .mybookflip-overlay { background: #0a1120; }
html[data-theme="dark"] .mybookflip-page { background: #17223c !important; color: #e6ebf4; }
html[data-theme="dark"] .mybookflip-page .learning-grammar-markdown,
html[data-theme="dark"] .mybookflip-page .mybookflip-culture-content {
    --learning-markdown-text: #e6ebf4;
    --learning-markdown-heading: #f8fafc;
    --learning-markdown-pattern-text: #fbbf24;
    --learning-markdown-title-grammar: #5eead4;
    --learning-markdown-title-dialog: #93c5fd;
    --learning-markdown-title-vocab: #fbbf24;
    --learning-markdown-title-accent-1: #5eead4;
    --learning-markdown-title-accent-2: #c4b5fd;
    --learning-markdown-title-accent-3: #fda4af;
    --learning-markdown-title-accent-4: #93c5fd;
    --learning-markdown-quote-text: #e6ebf4;
    --learning-markdown-quote-bg: rgba(255,255,255,0.06);
    --learning-markdown-quote-border: #10b981;
}
html[data-theme="dark"] .mybookflip-page h1, html[data-theme="dark"] .mybookflip-page h2,
html[data-theme="dark"] .mybookflip-page h3, html[data-theme="dark"] .mybookflip-page h4,
html[data-theme="dark"] .mybookflip-page h5, html[data-theme="dark"] .mybookflip-page p,
html[data-theme="dark"] .mybookflip-page li, html[data-theme="dark"] .mybookflip-page td,
html[data-theme="dark"] .mybookflip-page .mybookflip-cover-info-value,
html[data-theme="dark"] .mybookflip-page .mybookflip-culture-content,
html[data-theme="dark"] .mybookflip-page .mybookflip-culture-content *,
html[data-theme="dark"] .mybookflip-page blockquote { color: #e6ebf4; }
html[data-theme="dark"] .mybookflip-page .mybookflip-cover-info-label { color: #a9b6cd; }
html[data-theme="dark"] .mybookflip-page-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); }
/* inner light surfaces inside a book page → dark panel */
html[data-theme="dark"] .mybookflip-page [style*="background:#fff"],
html[data-theme="dark"] .mybookflip-page [style*="background: #fff"],
html[data-theme="dark"] .mybookflip-page [style*="background:#ffffff"],
html[data-theme="dark"] .mybookflip-page [style*="background: #ffffff"],
html[data-theme="dark"] .mybookflip-page .subtitle-word-card,
html[data-theme="dark"] .mybookflip-page .lesson-wordgame-card,
html[data-theme="dark"] .mybookflip-page .learning-word-card,
html[data-theme="dark"] .mybookflip-page .mybookflip-culture-content,
html[data-theme="dark"] .mybookflip-page .learning-grammar-markdown { background-color: transparent !important; border-color: transparent !important; }

/* (18) AI avatar lecture (vtuber) — dark blurred backdrop (mypage only). The
   avatar UI text is already light, so only the white blur needs to go dark. */
html[data-theme="dark"] .vtuber-learning-overlay { background: rgba(8,15,30,0.50); }
html[data-theme="dark"] .vtuber-learning-modal { --vtuber-avatar-bg: rgba(8,15,30,0.66); }
html[data-theme="dark"] .vtuber-learning-window [style*="background:#fff"],
html[data-theme="dark"] .vtuber-learning-window [style*="background: #fff"],
html[data-theme="dark"] .vtuber-learning-window [style*="background:#ffffff"],
html[data-theme="dark"] .vtuber-learning-window [style*="background: #ffffff"] { background-color: rgba(20,31,54,0.88) !important; }

/* breathing room above 내 프로필 for the theme box */
.profile-theme-box { margin: 0 0 1.1rem; }

/* (loading) initial "로딩 중..." text was hardcoded #111111 → invisible on dark */
html[data-theme="dark"] .i18n-init-loader-text,
html[data-theme="dark"] #initialI18nLoaderText { color: var(--text-primary); }

/* ===== dark-mode follow-up batch ===== */
/* 고정/자유 short tag — light indigo/green chips were unreadable */
html[data-theme="dark"] .calendar-week-class-type-short { background: rgba(129,140,248,0.22) !important; color: #c7cdff; }
html[data-theme="dark"] .calendar-week-class-type-short.type-free { background: rgba(34,197,94,0.20) !important; color: #86efac; }

/* 레벨테스트 완료 banner sits on a FIXED yellow gradient → text must stay dark */
html[data-theme="dark"] .leveltest-complete-card,
html[data-theme="dark"] .leveltest-complete-title,
html[data-theme="dark"] .leveltest-complete-desc,
html[data-theme="dark"] .leveltest-complete-icon { color: #1f2937 !important; }

/* 오늘 수업: not-yet-done steps (수업하기/복습하기) — #eeeeee → deeper than card */
html[data-theme="dark"] .today-class-step:not(.is-active):not(.is-complete) { background: #0e1830 !important; }

/* 주간 수업카드 hover — gray → slightly deeper navy than the card */
html[data-theme="dark"] .calendar-week-class-card:hover { background: #0f1b33 !important; }

/* 수업교재 변경 모달 — labels / muted (#6b7280) text → readable */
html[data-theme="dark"] .textbook-change-modal { color: var(--text-primary); }
html[data-theme="dark"] .textbook-change-field label { color: var(--text-secondary); }
html[data-theme="dark"] [style*="color:#6b7280"], html[data-theme="dark"] [style*="color: #6b7280"] { color: var(--text-secondary) !important; }

/* ============ dark-mode batch 2 (item-by-item) ============ */
/* [1] Leveltest result — student bubble (#e0f2fe) + AI총평(overall, rgba white) */
html[data-theme="dark"] .leveltest-bubble.student { background: rgba(56,189,248,0.16) !important; color: var(--c-0f172a); }
html[data-theme="dark"] .leveltest-bubble.teacher { background: var(--bg-soft) !important; }
html[data-theme="dark"] .leveltest-avatar-overall { background: #16223c !important; color: var(--text-primary); }

/* [2][3] time-change & postpone modals + shared 희망날짜 date calendar */
html[data-theme="dark"] .calendar-period-title,
html[data-theme="dark"] .calendar-title,
html[data-theme="dark"] .calendar-weekday,
html[data-theme="dark"] .calendar-day .day-number { color: var(--text-primary) !important; }
html[data-theme="dark"] .calendar-day.other-month .day-number,
html[data-theme="dark"] .calendar-day.disabled .day-number { color: var(--text-muted) !important; }
/* guarantee selectable day cells have a dark fill (state colors preserved) */
html[data-theme="dark"] .calendar-day:not(.today):not(.selected):not(.has-class):not(.disabled):not(.other-month) { background: #16243f !important; }
html[data-theme="dark"] .calendar-day:hover:not(.selected) { background: rgba(96,165,250,0.22) !important; }
/* action-modal body text + the light notice boxes (#fef2f2 red, yellow gradient) */
html[data-theme="dark"] .class-time-change-modal,
html[data-theme="dark"] .class-postpone-modal,
html[data-theme="dark"] .class-action-modal { color: var(--text-primary); }
html[data-theme="dark"] [style*="background:#fef2f2"],
html[data-theme="dark"] [style*="background: #fef2f2"] { background-color: rgba(248,113,113,0.13) !important; color: var(--text-primary) !important; }
html[data-theme="dark"] [style*="linear-gradient(135deg, #fef3c7"],
html[data-theme="dark"] [style*="linear-gradient(135deg,#fef3c7"] { background: rgba(251,191,36,0.15) !important; color: #fde68a !important; }

/* [4] AI avatar lecture — built for a light backdrop (black captions/buttons,
   white AI bubble). Now the backdrop is dark, so flip them. mypage-scoped. */
html[data-theme="dark"] .vtuber-caption-primary,
html[data-theme="dark"] .vtuber-caption-secondary { color: #f1f5f9 !important; text-shadow: 0 2px 10px rgba(0,0,0,0.65); }
html[data-theme="dark"] .vtuber-close-fab { color: #e6ebf4; }
html[data-theme="dark"] .vtuber-close-fab:hover { color: #ffffff; }
html[data-theme="dark"] .vtuber-replay-fab { background: rgba(20,31,54,0.92) !important; color: #e6ebf4 !important; }
/* 게임 / 프리토킹 toggle buttons */
html[data-theme="dark"] .vtuber-learning-actions button { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); color: #e6ebf4; }
html[data-theme="dark"] .vtuber-learning-actions button.active { background: #10b981; border-color: #10b981; color: #04130d; }
/* 게임 창 */
html[data-theme="dark"] .vtuber-game { background: rgba(11,19,38,0.92) !important; border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; }
html[data-theme="dark"] .vtuber-game-header span,
html[data-theme="dark"] .vtuber-game-body { color: #e6ebf4; }
html[data-theme="dark"] .vtuber-game-body [style*="background:#fff"],
html[data-theme="dark"] .vtuber-game-body [style*="background: #fff"] { background-color: rgba(20,31,54,0.9) !important; }
/* 프리토킹 말풍선 (AI 말풍선을 다크로, user는 파랑 유지) */
html[data-theme="dark"] .vtuber-chat-bubble.ai { background: rgba(20,31,54,0.96) !important; color: #e9eef6 !important; }
html[data-theme="dark"] .vtuber-chat-bubble.ai::after { background: rgba(20,31,54,0.96) !important; }
html[data-theme="dark"] .vtuber-chat-bubble.user { background: rgba(37,99,235,0.96) !important; color: #ffffff !important; }
html[data-theme="dark"] .vtuber-chat-bubble.user::after { background: rgba(37,99,235,0.96) !important; }

/* [5] 오늘 수업 수업교재 옆 "변경" 버튼 — #cfd6e6 light bg + now-light text */
html[data-theme="dark"] .today-class-change { background: rgba(255,255,255,0.12) !important; color: var(--text-primary) !important; }
html[data-theme="dark"] .today-class-change:hover { background: rgba(255,255,255,0.18) !important; }

/* [7] 테마설정 카드 (수업설정/내 프로필 above) — theme switch + language */
.profile-appearance-card {
    margin: 0 0 1.1rem;
    padding: 0.85rem 1rem;
    background: var(--bg-white);
    border: 1px solid rgba(148,163,184,0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.profile-appearance-title { font-size: 0.85rem; font-weight: 800; color: var(--text-secondary); display: flex; align-items: center; gap: 0.4rem; }
.profile-appearance-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.profile-lang-select { appearance: none; border: 1px solid rgba(148,163,184,0.4); border-radius: 999px; padding: 0.32rem 0.85rem; font-size: 0.8rem; font-weight: 600; background: #ffffff; color: #111827; cursor: pointer; }
/* [7] remove the boxed background behind 수신동의/보안설정 in dark */
html[data-theme="dark"] .profile-consent-fieldset,
html[data-theme="dark"] .profile-security-fieldset { background: transparent !important; border-color: rgba(255,255,255,0.10) !important; }

/* [8] + general: colored LIGHT tint cards/text (Tailwind 50–100) used inline by
   JS-rendered modals (order, chat, class-detail …). Dark-scoped, by family. */
/* blue / cyan surfaces */
html[data-theme="dark"] [style*="#eff6ff"], html[data-theme="dark"] [style*="#dbeafe"],
html[data-theme="dark"] [style*="#ecfeff"], html[data-theme="dark"] [style*="#cffafe"],
html[data-theme="dark"] [style*="#e0f2fe"], html[data-theme="dark"] [style*="#f0f9ff"],
html[data-theme="dark"] [style*="#a5f3fc"], html[data-theme="dark"] [style*="#bae6fd"] { background-color: rgba(56,189,248,0.12) !important; background-image: none !important; border-color: rgba(56,189,248,0.32) !important; }
/* green surfaces */
html[data-theme="dark"] [style*="#ecfdf5"], html[data-theme="dark"] [style*="#d1fae5"],
html[data-theme="dark"] [style*="#dcfce7"], html[data-theme="dark"] [style*="#f0fdf4"],
html[data-theme="dark"] [style*="#bbf7d0"], html[data-theme="dark"] [style*="#86efac"] { background-color: rgba(34,197,94,0.13) !important; background-image: none !important; border-color: rgba(34,197,94,0.32) !important; }
/* amber surfaces */
html[data-theme="dark"] [style*="#fffbeb"], html[data-theme="dark"] [style*="#fef9c3"],
html[data-theme="dark"] [style*="#fff7ed"], html[data-theme="dark"] [style*="#ffedd5"],
html[data-theme="dark"] [style*="#fed7aa"] { background-color: rgba(251,191,36,0.13) !important; background-image: none !important; border-color: rgba(251,191,36,0.30) !important; }
/* red / pink surfaces */
html[data-theme="dark"] [style*="#fee2e2"], html[data-theme="dark"] [style*="#fecaca"],
html[data-theme="dark"] [style*="#ffe4e6"], html[data-theme="dark"] [style*="#fff1f2"] { background-color: rgba(248,113,113,0.13) !important; background-image: none !important; border-color: rgba(248,113,113,0.30) !important; }
/* indigo / violet surfaces */
html[data-theme="dark"] [style*="#f5f3ff"], html[data-theme="dark"] [style*="#ede9fe"],
html[data-theme="dark"] [style*="#e0e7ff"] { background-color: rgba(129,140,248,0.14) !important; background-image: none !important; border-color: rgba(129,140,248,0.32) !important; }
/* colored notice TEXT (deep teal/blue/green/amber/red) → lighter on dark */
html[data-theme="dark"] [style*="color: #0e7490"], html[data-theme="dark"] [style*="color:#0e7490"],
html[data-theme="dark"] [style*="color: #0369a1"], html[data-theme="dark"] [style*="color: #0c4a6e"],
html[data-theme="dark"] [style*="color: #075985"] { color: #7dd3fc !important; }
html[data-theme="dark"] [style*="color: #166534"], html[data-theme="dark"] [style*="color: #15803d"],
html[data-theme="dark"] [style*="color:#15803d"], html[data-theme="dark"] [style*="color: #166e3f"] { color: #86efac !important; }
html[data-theme="dark"] [style*="color: #92400e"], html[data-theme="dark"] [style*="color: #b45309"],
html[data-theme="dark"] [style*="color: #854d0e"] { color: #fcd34d !important; }
html[data-theme="dark"] [style*="color: #b91c1c"], html[data-theme="dark"] [style*="color: #9f1239"],
html[data-theme="dark"] [style*="color: #dc2626"] { color: #fca5a5 !important; }
/* order modal base text */
html[data-theme="dark"] #orderStickerModalContent { color: var(--text-primary); }

/* [9] App-UID QR instruction (inline color:#4f46e5 indigo) + any indigo inline text → light */
html[data-theme="dark"] [style*="color: #4f46e5"], html[data-theme="dark"] [style*="color:#4f46e5"],
html[data-theme="dark"] [style*="color: #6366f1"], html[data-theme="dark"] [style*="color:#6366f1"],
html[data-theme="dark"] [style*="color: #4338ca"], html[data-theme="dark"] [style*="color:#4338ca"] { color: #a5b4ff !important; }

/* ============ dark-mode batch 3 (item-by-item) ============ */
/* [1] App UID delete confirm — force above the appUid modal (z:2000) + center */
#stickerConfirmOverlay { display: flex !important; align-items: center !important; justify-content: center !important; }
/* dark: light-gray button surfaces (#e5e7eb / #e2e8f0) → dark so the dark→light text shows */
html[data-theme="dark"] [style*="background: #e5e7eb"], html[data-theme="dark"] [style*="background:#e5e7eb"],
html[data-theme="dark"] [style*="background: #e2e8f0"], html[data-theme="dark"] [style*="background:#e2e8f0"],
html[data-theme="dark"] [style*="background: #cbd5f5"], html[data-theme="dark"] [style*="background:#cbd5f5"] { background-color: rgba(255,255,255,0.10) !important; }

/* [2] Weekly view weekday headers: today was #000000 (too dark), others blue.
   Make others a subtle slate and today emerald so today stands out (not darker). */
html[data-theme="dark"] .calendar.week-view .calendar-weekday { background: #1e2c4a !important; color: #cdd8ec; }
html[data-theme="dark"] .calendar.week-view .calendar-weekday.is-today { background: var(--primary) !important; color: #04130d; }
/* weekly day-column hover was #eeeeee (light gray) → subtle dark */
html[data-theme="dark"] .calendar.week-view .calendar-day:hover,
html[data-theme="dark"] .calendar.week-view .calendar-day.today:hover { background: rgba(255,255,255,0.05) !important; }

/* [3] Month-mode calendar class chip: white chips (background:#ffffff) → dark so
   the time/status text is visible. Yellow free-class chips (#f8c539) untouched. */
html[data-theme="dark"] .class-item[style*="background: #ffffff"] { background: #1a2742 !important; border-color: rgba(255,255,255,0.20) !important; }
html[data-theme="dark"] .class-item[style*="background: #ffffff"] .class-time,
html[data-theme="dark"] .class-item[style*="background: #ffffff"] .class-status,
html[data-theme="dark"] .class-item[style*="background: #ffffff"] .class-comment { color: #e6ebf4 !important; }

/* [4] Teacher profile modal — 원문/번역 tabs + content panels (inline-styled) */
html[data-theme="dark"] [data-intro-tab-trigger] { color: var(--text-secondary) !important; }
html[data-theme="dark"] [data-intro-tab-trigger][aria-selected="true"] { color: var(--primary) !important; border-bottom: 2px solid var(--primary) !important; }
html[data-theme="dark"] [data-intro-tab-panel] { background: var(--bg-soft) !important; color: var(--text-primary) !important; border-color: rgba(255,255,255,0.12) !important; }
html[data-theme="dark"] [data-intro-text] { color: var(--text-primary) !important; }

/* ===== mybookflip dark — items 5-10 (mypage-scoped; public index stays light) ===== */
/* [5] paper-like shadow: page floats (outer drop) + center-gutter (inner) */
html[data-theme="dark"] .mybookflip-page { box-shadow: 0 20px 55px -14px rgba(0,0,0,0.72); }
html[data-theme="dark"] .mybookflip-page.--left { box-shadow: inset -11px 0 28px -10px rgba(0,0,0,0.6), 0 20px 55px -14px rgba(0,0,0,0.72); }
html[data-theme="dark"] .mybookflip-page.--right { box-shadow: inset 11px 0 28px -10px rgba(0,0,0,0.6), 0 20px 55px -14px rgba(0,0,0,0.72); }
/* [6] word cards: all text light on the dark card */
html[data-theme="dark"] .mybookflip-page .subtitle-word-card,
html[data-theme="dark"] .mybookflip-page .subtitle-word-card *,
html[data-theme="dark"] .mybookflip-page .lesson-wordgame-card,
html[data-theme="dark"] .mybookflip-page .lesson-wordgame-card *,
html[data-theme="dark"] .mybookflip-page .learning-word-card,
html[data-theme="dark"] .mybookflip-page .learning-word-card * { color: #e9eef6 !important; }
/* [7] grammar text + blockquote (인용: left line + bg) */
html[data-theme="dark"] .mybookflip-page .learning-grammar-markdown,
html[data-theme="dark"] .mybookflip-page .learning-grammar-markdown * { color: #e6ebf4; }
html[data-theme="dark"] .mybookflip-page .mybookflip-culture-content,
html[data-theme="dark"] .mybookflip-page .mybookflip-culture-content * { color: #e6ebf4; }
html[data-theme="dark"] .mybookflip-page .learning-grammar-markdown .learning-markdown-heading *,
html[data-theme="dark"] .mybookflip-page .learning-grammar-markdown .learning-markdown-title-item * { color: inherit !important; }
html[data-theme="dark"] .mybookflip-page blockquote,
html[data-theme="dark"] .mybookflip-page .learning-grammar-markdown blockquote,
html[data-theme="dark"] .mybookflip-page .mybookflip-culture-content blockquote { background: rgba(255,255,255,0.05) !important; border-left-color: var(--primary) !important; color: #e6ebf4 !important; }
/* [8] AI아바타예습 button: dark navy gradient → emerald + white */
html[data-theme="dark"] .learning-grammar-game-btn.mybookflip-avatar-review-btn,
html[data-theme="dark"] .mybookflip-avatar-review-inline-btn { background: linear-gradient(135deg, #10b981, #059669) !important; color: #ffffff !important; }
/* [9] page-top section labels (GRAMMAR / VOCABULARY / CONVERSATION) */
html[data-theme="dark"] .mybookflip-page-title { color: #a5b4ff !important; }
/* [10] TOC (목차) */
html[data-theme="dark"] .mybookflip-toc { background: #131f38 !important; border-color: rgba(255,255,255,0.12) !important; }
html[data-theme="dark"] .mybookflip-toc-header { background: linear-gradient(135deg, #1d4ed8, #1e3a8a) !important; }
html[data-theme="dark"] .mybookflip-toc-item { color: #cdd8ec !important; }
html[data-theme="dark"] .mybookflip-toc-item:hover { background: rgba(129,140,248,0.16) !important; color: #c7cdff !important; border-left-color: #818cf8 !important; }
html[data-theme="dark"] .mybookflip-toc-item.is-current { background: rgba(99,102,241,0.20) !important; color: #c7cdff !important; border-left-color: #818cf8 !important; }
html[data-theme="dark"] .mybookflip-toc-item--locked:hover { background: transparent !important; color: #cdd8ec !important; }
html[data-theme="dark"] .mybookflip-toc-item-number { background: rgba(255,255,255,0.10) !important; color: #c7cdff !important; }
html[data-theme="dark"] .mybookflip-toc-item.is-current .mybookflip-toc-item-number { background: var(--primary) !important; color: #04130d !important; }
html[data-theme="dark"] .mybookflip-toc-item-trans { color: #93a0b8 !important; }

/* ===== dark-mode batch 4: order modal + remaining neutrals/text (global) ===== */
/* remaining light neutral backgrounds (the order modal panels are #f9fafb) */
html[data-theme="dark"] [style*="background: #f9fafb"], html[data-theme="dark"] [style*="background:#f9fafb"],
html[data-theme="dark"] [style*="background: #f8f6f0"], html[data-theme="dark"] [style*="background:#f8f6f0"],
html[data-theme="dark"] [style*="background: #fefefe"], html[data-theme="dark"] [style*="background:#fefefe"],
html[data-theme="dark"] [style*="background: #fcfcfc"], html[data-theme="dark"] [style*="background:#fcfcfc"],
html[data-theme="dark"] [style*="background: #c7d3e3"] { background-color: var(--bg-soft) !important; background-image: none !important; }
/* light borders (inline solid #hex) → faint hairline */
html[data-theme="dark"] [style*="solid #e5e7eb"], html[data-theme="dark"] [style*="solid #c7d3e3"],
html[data-theme="dark"] [style*="solid #e2e8f0"], html[data-theme="dark"] [style*="solid #dbe5f2"],
html[data-theme="dark"] [style*="solid #dbe4f0"], html[data-theme="dark"] [style*="solid #eef2ff"],
html[data-theme="dark"] [style*="solid #dbeafe"], html[data-theme="dark"] [style*="solid #cbd5e1"],
html[data-theme="dark"] [style*="solid #e2e8f0"] { border-color: rgba(255,255,255,0.14) !important; }
/* navy / blue text (amount #1e3a8a, #1d4ed8) → readable light blue */
html[data-theme="dark"] [style*="color: #1e3a8a"], html[data-theme="dark"] [style*="color:#1e3a8a"],
html[data-theme="dark"] [style*="color: #1d4ed8"], html[data-theme="dark"] [style*="color:#1d4ed8"],
html[data-theme="dark"] [style*="color: #1e40af"], html[data-theme="dark"] [style*="color:#1e40af"] { color: #93c5fd !important; }
/* brown/amber + dark-red text */
html[data-theme="dark"] [style*="color: #92400e"], html[data-theme="dark"] [style*="color:#92400e"],
html[data-theme="dark"] [style*="color: #9a3412"], html[data-theme="dark"] [style*="color:#9a3412"],
html[data-theme="dark"] [style*="color: #b8860b"] { color: #fcd34d !important; }
html[data-theme="dark"] [style*="color: #991b1b"], html[data-theme="dark"] [style*="color:#991b1b"] { color: #fca5a5 !important; }
/* order modal base text + footer */
html[data-theme="dark"] #orderStickerModalContent { color: var(--text-primary); }
html[data-theme="dark"] #orderModalFooter { background: #131f38 !important; border-top-color: rgba(255,255,255,0.10) !important; color: var(--text-primary); }
html[data-theme="dark"] #priceDisplayModal { color: #a5b4ff !important; }

/* ===== dark-mode batch 5 ===== */
/* [A1] leveltest bubbles — make student clearly distinct from teacher */
html[data-theme="dark"] .leveltest-bubble.teacher { background: rgba(148,163,184,0.13) !important; color: #e6ebf4; }
html[data-theme="dark"] .leveltest-bubble.student { background: rgba(59,130,246,0.26) !important; color: #eaf2ff; }
/* [A2] AI총평 (.leveltest-overall) — #0f172a blends into the page; distinct card + light text */
html[data-theme="dark"] .leveltest-overall { background: #16223c !important; border-color: rgba(255,255,255,0.12) !important; }
html[data-theme="dark"] .leveltest-overall,
html[data-theme="dark"] .leveltest-overall-title,
html[data-theme="dark"] .leveltest-overall-body,
html[data-theme="dark"] .leveltest-overall-body * { color: #eef2f8 !important; }
/* [A3] distribution radar graph — SVG axis labels + grid lines invisible on dark */
html[data-theme="dark"] .leveltest-radar svg text { fill: #cdd8ec !important; }
html[data-theme="dark"] .leveltest-radar svg line,
html[data-theme="dark"] .leveltest-radar svg polygon[fill="none"],
html[data-theme="dark"] .leveltest-radar svg circle[fill="none"] { stroke: rgba(255,255,255,0.20) !important; }
html[data-theme="dark"] .leveltest-avatar-distribution-title,
html[data-theme="dark"] .leveltest-avatar-distribution { color: var(--text-primary); }

/* ===== dark-mode batch 6 ===== */
/* [F] toggle (.class-toggle-btn) active sits on yellow #fbbf24 → force DARK text */
html[data-theme="dark"] .class-toggle-btn.active { color: #111827 !important; }
html[data-theme="dark"] .class-toggle-btn { color: var(--text-secondary); }

/* ===== Free-trial and enrollment horizontal wizard ===== */
#orderStickerModalContent {
    overflow-x: hidden !important;
    padding-bottom: 0 !important;
}

.order-wizard {
    min-width: 0;
}

.order-wizard-guide-title {
    margin: 0.2rem 0 1.05rem;
    color: #111827;
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.4;
    text-align: center;
    letter-spacing: 0;
}

.order-wizard-guide-emphasis {
    color: #dc2626;
}

.order-wizard-progress,
.level-test-wizard-progress {
    --wizard-progress-slant: 16px;
    --wizard-progress-arrow: 26px;
    --wizard-progress-overlap: 10px;
    position: relative;
    margin: 0 0 1.3rem;
    padding: 0;
    display: grid;
    gap: 0;
    list-style: none;
    isolation: isolate;
}

.order-wizard-progress {
    grid-template-columns: repeat(var(--order-wizard-step-count, 1), minmax(0, 1fr));
}

.order-wizard-progress li,
.level-test-wizard-progress li {
    position: relative;
    min-width: 0;
    list-style: none;
}

.order-wizard-progress li + li,
.level-test-wizard-progress li + li {
    margin-left: calc(-1 * var(--wizard-progress-overlap));
}

.order-wizard-progress button,
.level-test-wizard-progress button {
    width: 100%;
    min-width: 0;
    min-height: 70px;
    padding: 0.65rem calc(var(--wizard-progress-slant) + 0.35rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    border: 0;
    border-radius: 0;
    background: #e5e7eb;
    color: #64748b;
    clip-path: polygon(var(--wizard-progress-slant) 0, 100% 0, calc(100% - var(--wizard-progress-slant)) 100%, 0 100%);
    font: inherit;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.order-wizard-progress li:first-child button,
.level-test-wizard-progress li:first-child button {
    padding-left: 0.55rem;
    clip-path: polygon(0 0, 100% 0, calc(100% - var(--wizard-progress-slant)) 100%, 0 100%);
}

.order-wizard-progress li:last-child button,
.level-test-wizard-progress li:last-child button {
    padding-right: calc(var(--wizard-progress-arrow) + 0.35rem);
    clip-path: polygon(var(--wizard-progress-slant) 0, calc(100% - var(--wizard-progress-arrow)) 0, 100% 50%, calc(100% - var(--wizard-progress-arrow)) 100%, 0 100%);
}

.order-wizard-progress-number,
.level-test-wizard-progress-number,
.order-wizard-progress-label,
.level-test-wizard-progress-label {
    display: block;
    max-width: 100%;
    color: inherit;
    white-space: nowrap;
}

.order-wizard-progress-number,
.level-test-wizard-progress-number {
    font-size: 0.86rem;
    font-style: italic;
    font-weight: 900;
}

.order-wizard-progress-label,
.level-test-wizard-progress-label {
    font-size: 0.88rem;
    font-weight: 800;
}

.order-wizard-progress button:hover,
.level-test-wizard-progress button:hover {
    background: #d1fae5;
    color: #047857;
}

.order-wizard-progress button:focus-visible,
.level-test-wizard-progress button:focus-visible {
    outline: 2px solid #047857;
    outline-offset: -3px;
}

.order-wizard-progress button.is-current,
.order-wizard-progress button.is-complete,
.level-test-wizard-progress button.is-current,
.level-test-wizard-progress button.is-complete {
    background: #10b981;
    color: #ffffff;
}

.order-wizard-viewport {
    width: 100%;
    min-height: 240px;
    overflow: hidden;
    transition: height 260ms ease;
}

.order-wizard-track {
    width: 100%;
    display: flex;
    align-items: flex-start;
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.order-wizard-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    padding: 0 0.15rem 0.25rem;
    box-sizing: border-box;
}

.order-wizard-slide[hidden],
.order-wizard-class-group[hidden],
.order-wizard-shared-video[hidden],
.order-wizard-trial-summary[hidden],
.order-wizard-footer-actions > [hidden] {
    display: none !important;
}

.order-wizard-slide-heading {
    margin: 50px 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.order-wizard-slide-number,
.level-test-wizard-heading-number {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0.58rem 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    border: 1px solid #047857;
    border-radius: 7px;
    background: #059669;
    color: #ffffff;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
}

.order-wizard-slide-number > [data-order-wizard-slide-number],
.level-test-wizard-heading-step-number {
    color: #ffffff;
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 900;
}

.order-wizard-slide-step-label,
.level-test-wizard-heading-step-label {
    color: #ffffff;
    font-size: 0.92rem;
    font-style: normal;
    font-weight: 800;
}

.order-wizard-slide-heading h4 {
    margin: 0;
    color: #111827;
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0;
}

.order-wizard-slide #appRegistrationStep2 > div:first-child,
.order-wizard-slide #appRegistrationStep3 > div:first-child {
    display: none !important;
}

.order-wizard-slide #appRegistrationStep2,
.order-wizard-slide #appRegistrationStep3 {
    width: 100%;
    box-sizing: border-box;
}

.order-wizard-slide .order-app-step-content {
    width: 100%;
    min-width: 0;
    display: flex !important;
    align-items: flex-start !important;
    gap: 1.25rem !important;
}

.order-wizard-sync-qr-column {
    flex: 0 0 130px;
    width: 130px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
}

.order-wizard-sync-copy {
    min-width: 0;
    flex: 1 1 auto !important;
    align-items: stretch !important;
    text-align: left;
}

.order-wizard-app-note,
.order-wizard-sync-highlight {
    margin: 0 !important;
    padding: 0.85rem 0.95rem !important;
    border-radius: 8px;
    background: #ecfdf5;
    color: #065f46 !important;
    font-size: 0.98rem !important;
    font-weight: 750;
    line-height: 1.5 !important;
}

.order-wizard-scan-instruction {
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    background: transparent;
    color: var(--text-secondary) !important;
    font-size: 0.9rem !important;
    font-weight: 600;
    line-height: 1.5 !important;
}

.order-wizard-sync-status {
    width: max-content !important;
    max-width: 100%;
    margin: 0.55rem auto 0 !important;
    padding: 0.28rem 0.35rem !important;
    box-sizing: border-box;
    font-size: 0.78rem !important;
    line-height: 1.3 !important;
    text-align: center !important;
    white-space: nowrap;
}

.order-wizard-sync-status[data-qr-status="waiting_for_scan"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.65rem 0 0 !important;
    padding: 0.62rem 0.85rem !important;
    box-sizing: border-box;
    border: 1px solid #166534 !important;
    border-radius: 6px !important;
    background: #050505 !important;
    color: #34d399 !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    text-align: center !important;
    white-space: nowrap;
}

.order-wizard-shared-video {
    width: min(100%, 760px);
    margin: 1rem auto 0;
}

.order-wizard-shared-video .order-app-video-panel {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
}

.order-wizard-shared-video video {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
}

.order-wizard-store-actions {
    margin-top: 1rem;
    justify-content: center !important;
}

.order-wizard-store-actions,
.level-test-wizard-store-action {
    width: 100%;
    padding: 0.65rem;
    gap: 0.6rem;
    box-sizing: border-box;
    border: 1px solid #27272a;
    border-radius: 8px;
    background: #050505;
}

.order-wizard-store-actions .mobile-app-store-link[data-mobile-app-store-platform="ios"],
.level-test-wizard-store-action .mobile-app-store-link[data-mobile-app-store-platform="ios"] {
    border-color: #007aff;
    background: #007aff;
}

.order-wizard-store-actions .mobile-app-store-link[data-mobile-app-store-platform="android"],
.level-test-wizard-store-action .mobile-app-store-link[data-mobile-app-store-platform="android"] {
    border-color: #01875f;
    background: #01875f;
}

.order-wizard-store-actions .mobile-app-store-link:hover,
.order-wizard-store-actions .mobile-app-store-link:focus-visible,
.level-test-wizard-store-action .mobile-app-store-link:hover,
.level-test-wizard-store-action .mobile-app-store-link:focus-visible {
    filter: brightness(0.92);
}

.order-wizard-level-selector {
    margin-bottom: 1.15rem;
}

.order-wizard-textbook-help {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #ecfdf5;
}

.order-wizard-textbook-help > p {
    min-width: 0;
    margin: 0;
    color: #065f46;
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.45;
    letter-spacing: 0;
}

.order-wizard-textbook-help-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.order-wizard-textbook-help-button {
    min-height: 42px;
    padding: 0.62rem 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
    cursor: pointer;
}

.order-wizard-textbook-help-button--full {
    border: 1px solid #047857;
    background: #059669;
    color: #ffffff;
}

.order-wizard-textbook-help-button--quick {
    border: 1px solid #d97706;
    background: #ffffff;
    color: #b45309;
}

.order-wizard-level-guide {
    margin: 0 0 0.8rem;
    color: #334155;
    font-size: 1rem;
    font-weight: 800;
}

.order-wizard-level-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.order-wizard-level-group {
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #f8fafc;
}

.order-wizard-level-group > strong {
    display: block;
    margin-bottom: 0.55rem;
    color: #475569;
    font-size: 0.82rem;
}

.order-wizard-level-group--beginner > strong { color: #047857; }
.order-wizard-level-group--intermediate > strong { color: #1d4ed8; }
.order-wizard-level-group--advanced > strong { color: #b45309; }

.order-wizard-level-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    gap: 0.4rem;
}

.order-wizard-level-buttons button {
    min-width: 0;
    min-height: 38px;
    padding: 0.45rem 0.35rem;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #ffffff;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    cursor: pointer;
}

.order-wizard-textbook-group > fieldset,
.order-wizard-details-group > fieldset,
.order-wizard-details-group > div:last-child {
    margin-bottom: 1rem !important;
}

.order-wizard-class-type-section {
    margin-bottom: 1.1rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid #e5e7eb;
}

.order-wizard-detail-section-title {
    margin: 0 0 0.75rem;
    color: #111827;
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: 0;
}

.order-wizard-class-type-section .class-type-grid {
    margin-bottom: 1rem !important;
}

#orderModalFooter {
    position: relative;
    margin-top: 0;
    flex-direction: column;
    align-items: stretch !important;
    justify-content: center !important;
    box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.11);
    z-index: 12;
}

#orderModalFooter.is-trial {
    flex-direction: column;
    align-items: stretch !important;
    justify-content: center !important;
}

#orderModalFooter.is-trial .order-wizard-trial-summary {
    width: min(100%, 760px);
    margin: 0 auto;
}

#orderModalFooter.is-trial .order-wizard-footer-actions {
    width: 100%;
    margin: 0;
    justify-content: center;
}

.order-wizard-paid-benefits {
    width: min(100%, 900px);
    margin: 0 auto;
}

.order-wizard-paid-benefits-title {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 850;
}

.order-wizard-paid-benefit-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.order-wizard-paid-benefit-item {
    flex: 1 1 180px;
    min-width: 0;
    min-height: 48px;
    padding: 0.5rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #ffffff;
    box-sizing: border-box;
}

.order-wizard-paid-benefit-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.82rem;
}

.order-wizard-paid-benefit-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    line-height: 1.25;
}

.order-wizard-paid-benefit-copy strong,
.order-wizard-paid-benefit-copy small {
    overflow-wrap: anywhere;
    letter-spacing: 0;
}

.order-wizard-paid-benefit-copy strong {
    color: #1f2937;
    font-size: 0.78rem;
    font-weight: 800;
}

.order-wizard-paid-benefit-copy small {
    color: #047857;
    font-size: 0.73rem;
    font-weight: 750;
}

.order-wizard-paid-benefit-item--coupon .order-wizard-paid-benefit-icon {
    background: #fff1f2;
    color: #be123c;
}

.order-wizard-paid-benefit-item--point .order-wizard-paid-benefit-icon {
    background: #eff6ff;
    color: #1d4ed8;
}

.order-wizard-paid-benefit-item--gift .order-wizard-paid-benefit-icon {
    background: #fff7ed;
    color: #c2410c;
}

.order-wizard-paid-benefit-item--token .order-wizard-paid-benefit-icon {
    background: #f5f3ff;
    color: #6d28d9;
}

.order-wizard-footer-actions {
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.order-wizard-back,
.order-wizard-next {
    min-width: 112px;
    padding: 0.78rem 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 9px;
    font-weight: 800;
    letter-spacing: 0;
    cursor: pointer;
}

.order-wizard-back {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.order-wizard-next {
    border: 1px solid #047857;
    background: #059669;
    color: #ffffff;
}

.order-wizard-next:disabled {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.order-wizard-trial-summary {
    flex: 1 1 auto;
    min-width: 0;
}

.order-wizard-trial-summary .order-trial-intro {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #065f46 !important;
    font-size: 0.9rem !important;
    line-height: 1.45 !important;
}

.order-wizard-trial-summary .giftishow-benefit-view:not([hidden]) {
    margin-top: 0.45rem;
}

html[data-theme="dark"] .order-wizard-guide-title,
html[data-theme="dark"] .order-wizard-slide-heading h4,
html[data-theme="dark"] .order-wizard-level-guide,
html[data-theme="dark"] .order-wizard-detail-section-title {
    color: var(--text-primary);
}

html[data-theme="dark"] .order-wizard-level-group,
html[data-theme="dark"] .order-wizard-level-buttons button,
html[data-theme="dark"] .order-wizard-back {
    border-color: rgba(255, 255, 255, 0.16);
    background: #1c2942;
    color: var(--text-primary);
}

html[data-theme="dark"] .order-wizard-progress button {
    background: #1c2942;
    color: #cbd5e1;
}

html[data-theme="dark"] .order-wizard-progress button.is-current,
html[data-theme="dark"] .order-wizard-progress button.is-complete {
    background: #059669;
    color: #ffffff;
}

html[data-theme="dark"] .order-wizard-trial-summary .order-trial-intro {
    color: #86efac !important;
}

html[data-theme="dark"] .order-wizard-app-note,
html[data-theme="dark"] .order-wizard-sync-highlight {
    background: rgba(16, 185, 129, 0.14);
    color: #a7f3d0 !important;
}

html[data-theme="dark"] .order-wizard-textbook-help {
    border-color: rgba(52, 211, 153, 0.38);
    background: rgba(16, 185, 129, 0.14);
}

html[data-theme="dark"] .order-wizard-textbook-help > p {
    color: #a7f3d0;
}

html[data-theme="dark"] .order-wizard-textbook-help-button--quick {
    border-color: #f59e0b;
    background: #1c2942;
    color: #fcd34d;
}

html[data-theme="dark"] .order-wizard-class-type-section {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .order-wizard-paid-benefits-title,
html[data-theme="dark"] .order-wizard-paid-benefit-copy strong {
    color: #e5e7eb;
}

html[data-theme="dark"] .order-wizard-paid-benefit-item {
    border-color: rgba(255, 255, 255, 0.14);
    background: #1c2942;
}

@media (max-width: 768px) {
    .order-wizard-guide-title {
        margin-top: 0;
        font-size: 1.18rem;
    }

    .order-wizard-progress {
        margin-bottom: 0.7rem;
    }

    .order-wizard-progress,
    .level-test-wizard-progress {
        --wizard-progress-slant: 10px;
        --wizard-progress-arrow: 18px;
        --wizard-progress-overlap: 6px;
    }

    .order-wizard-progress button,
    .level-test-wizard-progress button {
        min-width: 0;
        min-height: 62px;
        padding: 0.48rem calc(var(--wizard-progress-slant) + 0.2rem);
    }

    .order-wizard-progress-number,
    .level-test-wizard-progress-number {
        font-size: 0.78rem;
    }

    .order-wizard-progress-label {
        font-size: 0.72rem;
    }

    .level-test-wizard-progress-label {
        font-size: 0.82rem;
    }

    .order-wizard-slide {
        padding-inline: 0.05rem;
    }

    .order-wizard-slide-heading {
        margin-top: 50px;
        gap: 0.65rem;
    }

    .order-wizard-slide-number,
    .level-test-wizard-heading-number {
        min-height: 38px;
        padding: 0.5rem 0.62rem;
    }

    .order-wizard-slide-number > [data-order-wizard-slide-number],
    .level-test-wizard-heading-step-number {
        font-size: 1.08rem;
    }

    .order-wizard-slide-step-label,
    .level-test-wizard-heading-step-label {
        font-size: 0.84rem;
    }

    .order-wizard-slide-heading h4 {
        font-size: 1.28rem;
    }

    .order-wizard-level-groups {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .order-wizard-textbook-help {
        align-items: stretch;
        flex-direction: column;
        gap: 0.7rem;
    }

    .order-wizard-textbook-help-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-wizard-textbook-help-button {
        min-width: 0;
        white-space: normal;
    }

    .order-wizard-level-group {
        display: grid;
        grid-template-columns: 74px minmax(0, 1fr);
        align-items: center;
        gap: 0.45rem;
        padding: 0.65rem;
    }

    .order-wizard-level-group > strong {
        margin: 0;
    }

    .order-wizard-level-buttons {
        grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    }

    .order-wizard-shared-video .order-app-video-panel {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .order-wizard-slide .order-app-step-content {
        flex-direction: row !important;
        gap: 0.75rem !important;
    }

    .order-wizard-sync-qr-column {
        flex-basis: 112px;
        width: 112px;
    }

    .order-wizard-sync-qr-column #appSyncQRCodeContainer2 {
        width: 112px !important;
        height: 112px !important;
    }

    #orderModalFooter {
        display: flex !important;
        flex-direction: column;
        align-items: stretch !important;
    }

    #orderModalFooter.is-trial {
        flex-direction: column;
    }

    .order-wizard-paid-benefit-items {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        padding-bottom: 0.1rem;
    }

    .order-wizard-paid-benefit-item {
        flex: 0 0 min(72vw, 238px);
    }

    .order-wizard-trial-summary {
        max-height: 108px;
        overflow-y: auto;
    }

    .order-wizard-footer-actions {
        width: 100%;
        margin: 0;
        gap: 0.45rem;
    }

    #orderModalFooter.is-trial .order-wizard-footer-actions {
        width: 100%;
        margin: 0;
    }

    .order-wizard-back,
    .order-wizard-next,
    #orderSubmitBtnModal {
        flex: 1 1 0;
        min-width: 0 !important;
        padding: 0.72rem 0.75rem !important;
    }

    #orderModalFooter.is-trial .order-wizard-next,
    #orderModalFooter.is-trial .order-wizard-back,
    #orderModalFooter.is-trial #orderSubmitBtnModal {
        flex: 0 1 168px;
        min-width: 112px !important;
    }
}

/* [G] weekly class card: tags/avatar button overflow the narrow column → allow wrap + shrink */
.calendar-week-class-top { flex-wrap: wrap; }
.calendar-week-class-top-right { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.calendar-week-class-status, .calendar-week-class-type, .calendar-week-class-type-short { max-width: 100%; }
.calendar-week-class-card .today-class-avatar-lecture,
.calendar-week-class-actions .today-class-avatar-lecture { max-width: 100%; box-sizing: border-box; overflow: hidden; }

/* [H] mybookflip word-click popup (injected style is #ffffff) → dark (mypage only) */
html[data-theme="dark"] .lesson-wordgame-popup { background: #16223c !important; color: #e6ebf4 !important; border-color: rgba(255,255,255,0.12) !important; }
html[data-theme="dark"] .lesson-wordgame-popup-media { background: #0f1a30 !important; border-color: rgba(255,255,255,0.12) !important; }
html[data-theme="dark"] .lesson-wordgame-popup-info,
html[data-theme="dark"] .lesson-wordgame-popup-description,
html[data-theme="dark"] .lesson-wordgame-popup-description-label,
html[data-theme="dark"] .lesson-wordgame-popup-top { color: #e6ebf4 !important; }
html[data-theme="dark"] .lesson-wordgame-popup [style*="color:#0f172a"],
html[data-theme="dark"] .lesson-wordgame-popup [style*="color: #0f172a"] { color: #e6ebf4 !important; }

/* [E] avatar lecture: ALL markdown (titles/Chinese/quote/code) readable */
html[data-theme="dark"] .vtuber-chat-bubble.ai .vtuber-chat-markdown,
html[data-theme="dark"] .vtuber-chat-bubble.ai .vtuber-chat-markdown * { color: #e9eef6 !important; }
html[data-theme="dark"] .vtuber-chat-markdown h1, html[data-theme="dark"] .vtuber-chat-markdown h2,
html[data-theme="dark"] .vtuber-chat-markdown h3, html[data-theme="dark"] .vtuber-chat-markdown strong { color: #ffffff !important; }
html[data-theme="dark"] .vtuber-chat-markdown blockquote { background: rgba(255,255,255,0.06) !important; border-left-color: var(--primary) !important; color: #dbe4f0 !important; }
html[data-theme="dark"] .vtuber-chat-markdown code,
html[data-theme="dark"] .vtuber-chat-markdown pre { background: rgba(255,255,255,0.10) !important; color: #e9eef6 !important; }
/* game body inner light surfaces → dark */
html[data-theme="dark"] .vtuber-game-body [style*="background:#fff"],
html[data-theme="dark"] .vtuber-game-body [style*="background: #fff"],
html[data-theme="dark"] .vtuber-game-body [style*="background:#f8fafc"],
html[data-theme="dark"] .vtuber-game-body [style*="background: #f8fafc"] { background-color: rgba(20,31,54,0.92) !important; }
html[data-theme="dark"] .vtuber-game-body, html[data-theme="dark"] .vtuber-game-body * { color: #e9eef6 !important; }

/* [C] settings 테마설정 card — make it a clearly distinct filled card in dark */
html[data-theme="dark"] .profile-appearance-card { background: var(--bg-card) !important; border-color: rgba(255,255,255,0.12) !important; box-shadow: var(--shadow-md); }

/* ===== dark-mode batch 7: word-explanation popup sub-elements (mypage only) =====
   The popup has a full dark variant but only when it carries .lesson-wordgame-popup-teacher;
   the plain popup keeps light boxes (설명 #f8fafc, examples #111827/#334155). Replicate
   the dark treatment for ALL popups in dark mode. */
html[data-theme="dark"] .lesson-wordgame-popup-description { background: rgba(255,255,255,0.06) !important; color: #e6ebf4 !important; border-color: rgba(255,255,255,0.10) !important; }
html[data-theme="dark"] .lesson-wordgame-popup-description-chinese { background: rgba(20,184,166,0.14) !important; border-color: rgba(20,184,166,0.30) !important; color: #c7f3e9 !important; }
html[data-theme="dark"] .lesson-wordgame-popup-description-chinese .lesson-wordgame-popup-description-label { color: #5eead4 !important; }
html[data-theme="dark"] .lesson-wordgame-popup-pending { background: rgba(251,191,36,0.12) !important; border-color: rgba(251,191,36,0.30) !important; color: #fde68a !important; }
html[data-theme="dark"] .lesson-wordgame-popup-description-label,
html[data-theme="dark"] .lesson-wordgame-examples-title { color: #93c5fd !important; }
html[data-theme="dark"] .lesson-wordgame-example { border-top-color: rgba(255,255,255,0.12) !important; }
html[data-theme="dark"] .lesson-wordgame-example-source { color: #e9eef6 !important; }
html[data-theme="dark"] .lesson-wordgame-example-pinyin { color: #9fb0c9 !important; }
html[data-theme="dark"] .lesson-wordgame-example-trans { color: #c3cee0 !important; }
html[data-theme="dark"] .lesson-wordgame-popup-word { color: #93c5fd !important; }
html[data-theme="dark"] .lesson-wordgame-popup-pinyin, html[data-theme="dark"] .lesson-wordgame-popup-meaning { color: #e6ebf4 !important; }
/* SRS cards reuse lesson-wordgame popup classes inside a bright foil card.
   Keep the normal popup dark, but do not let that dark text palette bleed into cards. */
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .ttt-srs-back-scroll,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-top,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-info,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-word,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-pinyin,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-meaning,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-meaning-label,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-description,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-description-label,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-examples-title,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-example-source,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-example-text,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-example-pinyin,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-example-trans {
    color: #111 !important;
    text-shadow: none !important;
}
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-info {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-description {
    background: var(--srs-card-soft-bg) !important;
    border-color: var(--srs-card-soft-border) !important;
}
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-media {
    background: var(--srs-card-media-bg) !important;
    border-color: var(--srs-card-soft-border) !important;
}
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-popup-tts,
html[data-theme="dark"] :is(.ttt-srs-overlay, .ttt-srs-showcase) .ttt-srs-card-back .lesson-wordgame-example-tts {
    color: #111 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
/* mini word bubble (clicking an example word) */
html[data-theme="dark"] .lesson-wordgame-mini-bubble { background: #16223c !important; border-color: rgba(255,255,255,0.14) !important; }
html[data-theme="dark"] .lesson-wordgame-mini-meaning { color: #e9eef6 !important; }
html[data-theme="dark"] .lesson-wordgame-mini-pinyin { color: #9fb0c9 !important; }

/* ===== dark-mode batch 8 ===== */
/* 수강신청 리스트 모바일: stacked rows label column .orders-table td::before is #f8f6f6 (white) */
@media (max-width: 768px) {
    html[data-theme="dark"] .orders-table td::before { background: rgba(255,255,255,0.06) !important; color: var(--text-secondary) !important; }
    html[data-theme="dark"] .orders-table td { border-bottom-color: rgba(255,255,255,0.10) !important; }
    html[data-theme="dark"] .orders-table td::after { background: rgba(255,255,255,0.10) !important; }
}

/* 아바타강의 GAME / SPEAK(전체 문장 읽기) panels — transparent + #111827 text over a bright
   scene. Give them a readable dark card + light text (mypage only). */
html[data-theme="dark"] .vtuber-learning-overlay { background: rgba(8,15,30,0.62) !important; }
html[data-theme="dark"] .vtuber-speak,
html[data-theme="dark"] .vtuber-game { background: rgba(8,15,30,0.86) !important; border-radius: 18px; box-shadow: 0 12px 34px rgba(0,0,0,0.55); }
html[data-theme="dark"] .vtuber-speak,
html[data-theme="dark"] .vtuber-speak-card,
html[data-theme="dark"] .vtuber-speak-status,
html[data-theme="dark"] .vtuber-speak-instruction,
html[data-theme="dark"] .vtuber-speak-live,
html[data-theme="dark"] .vtuber-speak-sentence,
html[data-theme="dark"] #vtuberSpeakSentence,
html[data-theme="dark"] .vtuber-game-header span,
html[data-theme="dark"] .vtuber-status { color: #e9eef6 !important; }
html[data-theme="dark"] .vtuber-speak-pinyin { color: #9fb0c9 !important; }
/* game header "next"/skip + game-end/effect buttons readable */
html[data-theme="dark"] #vtuberGameSkip { background: rgba(255,255,255,0.12) !important; color: #e6ebf4 !important; border-color: rgba(255,255,255,0.2) !important; }

/* AI앱목록 리스트 모바일 — same stacked-table white label column (#f8f6f6) as order list */
@media (max-width: 768px) {
    html[data-theme="dark"] .ai-apps-table td::before { background: rgba(255,255,255,0.06) !important; color: var(--text-secondary) !important; }
    html[data-theme="dark"] .ai-apps-table td { border-bottom-color: rgba(255,255,255,0.10) !important; }
    html[data-theme="dark"] .ai-apps-table td::after { background: rgba(255,255,255,0.10) !important; }
    html[data-theme="dark"] .ai-apps-table tr { border-color: rgba(255,255,255,0.10) !important; }
}

/* Match the 테마설정 card's labels/switch/select sizing to the other 수업설정 rows
   (.class-settings-label 0.95rem / .class-toggle pill). */
.profile-appearance-card .sidebar-theme-label { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); gap: 0.5rem; }
.profile-appearance-card .sidebar-theme-label i { font-size: 1rem; }
.profile-appearance-card .profile-appearance-row { padding: 0.6rem 0; gap: var(--spacing-md); }
.profile-appearance-card .theme-switch { padding: 4px; background: var(--bg-soft); min-width: 138px; }
.profile-appearance-card .theme-switch-thumb { top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); }
.profile-appearance-card .theme-switch-opt { flex: 1; width: auto; padding: 0.45rem 0; font-size: 0.98rem; }
.profile-appearance-card .profile-lang-select { padding: 0.45rem 0.9rem; font-size: 0.85rem; font-weight: 700; }

/* 레벨테스트 결과 — mobile: keep the header title on one line */
@media (max-width: 768px) {
    .leveltest-result-header { padding: 0.8rem 0.9rem; gap: 0.5rem; }
    .leveltest-result-header-main { gap: 0.5rem; }
    .leveltest-result-title { font-size: 0.96rem; white-space: nowrap; }
    .leveltest-result-title span { white-space: nowrap; }
    .leveltest-result-avatar-btn { padding: 0.4rem 0.62rem; font-size: 0.8rem; }
}
/* 레벨테스트 분포 레이더 — sharper labels (발음/유창성…) + values (70%…) in dark */
html[data-theme="dark"] .leveltest-radar svg text[font-size="11"] { fill: #f1f5f9 !important; font-weight: 700 !important; }
html[data-theme="dark"] .leveltest-radar svg text[font-size="9"] { fill: #8ec5ff !important; font-weight: 800 !important; }

/* 레벨테스트 결과 — mobile: full-screen modal */
@media (max-width: 768px) {
    .leveltest-result-modal {
        width: 100vw; max-width: 100vw;
        height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh;
        left: 0; top: 0; transform: none; border-radius: 0;
    }
    .leveltest-result-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .leveltest-result-header { cursor: default; }
    .leveltest-resize-handle { display: none; }
}

/* loading spinner — black accent (#111111) invisible on dark loading bg */
html[data-theme="dark"] .i18n-init-active-indicator { border-color: rgba(255,255,255,0.22) !important; border-top-color: var(--primary) !important; }

/* mybookflip: 학습하기(green) vs AI아바타예습 → make avatar BLUE so they're distinct */
html[data-theme="dark"] .learning-grammar-game-btn.mybookflip-avatar-review-btn,
html[data-theme="dark"] .mybookflip-avatar-review-inline-btn { background: linear-gradient(135deg, #3b82f6, #2563eb) !important; color: #ffffff !important; }

/* 오늘 수업 단계: 단계 밑의 버튼(.today-class-action)이 단계 배경과 안 구분됨 → 버튼처럼 보이게 */
html[data-theme="dark"] .today-class-step .today-class-action,
html[data-theme="dark"] .today-class-step-status { background: rgba(255,255,255,0.16) !important; color: #eaf0f8 !important; border: 1px solid rgba(255,255,255,0.24) !important; }
html[data-theme="dark"] .today-class-step.is-active .today-class-action,
html[data-theme="dark"] .today-class-step.is-complete .today-class-action,
html[data-theme="dark"] .today-class-step.is-active .today-class-step-status,
html[data-theme="dark"] .today-class-step.is-complete .today-class-step-status { background: #ffffff !important; color: #0b7a3b !important; border-color: #ffffff !important; }

/* mybookflip 학습하기 panel (right slide-in) — #ffffff panel + #f8fafc game area → dark (mypage only) */
html[data-theme="dark"] .lesson-wordgame-panel { background: #0f1a30 !important; color: #e6ebf4; }
html[data-theme="dark"] .lesson-wordgame-game { background: #0b1326 !important; color: #e6ebf4 !important; }
/* 말하기(speaking) result on the dark game surface: prompt + matched/equal words are #0f172a/#111827
   (invisible on dark) → light. 틀린부분 diff 색은 아바타강의 게임과 "똑같이" 맞춘다:
   extra(추가/틀림)=#ef4444 + 취소선(base CSS 상속), missing(누락)=#38bdf8. 밝게 변형하지 않음. */
html[data-theme="dark"] .lesson-wordgame-game .avatar-lecture-speaking-prompt,
html[data-theme="dark"] .lesson-wordgame-game .avatar-lecture-speaking-diff-equal,
html[data-theme="dark"] .lesson-wordgame-game .avatar-lecture-speaking-diff.waiting,
html[data-theme="dark"] .lesson-wordgame-game .avatar-lecture-speaking-instruction,
html[data-theme="dark"] .lesson-wordgame-game .avatar-lecture-speaking-listening,
html[data-theme="dark"] .lesson-wordgame-game .avatar-lecture-speaking-score { color: #e6ebf4 !important; }
html[data-theme="dark"] .lesson-wordgame-game .avatar-lecture-speaking-diff-missing { color: #38bdf8 !important; }
html[data-theme="dark"] .lesson-wordgame-game .avatar-lecture-speaking-diff-extra { color: #ef4444 !important; }
html[data-theme="dark"] .lesson-wordgame-game [style*="background:#fff"],
html[data-theme="dark"] .lesson-wordgame-game [style*="background: #fff"],
html[data-theme="dark"] .lesson-wordgame-game [style*="background:#f8fafc"],
html[data-theme="dark"] .lesson-wordgame-game [style*="background: #f8fafc"],
html[data-theme="dark"] .lesson-wordgame-game [style*="background:#f1f5f9"] { background-color: #16223c !important; }

/* 복습 대화내용보기 transcript panel (#reviewTranscriptPanel; bg set via cssText=rgb, so id-target) */
html[data-theme="dark"] #reviewTranscriptPanel { background: #0b1326 !important; }
html[data-theme="dark"] #reviewTranscriptPanel .subtitle-history-item { background: #16223c !important; border-color: rgba(255,255,255,0.12) !important; color: #e6ebf4 !important; box-shadow: 0 6px 16px rgba(0,0,0,0.4) !important; }
html[data-theme="dark"] #reviewTranscriptPanel .subtitle-history-item.subtitle-history-item-student { background: rgba(59,130,246,0.24) !important; border-color: rgba(59,130,246,0.4) !important; }
html[data-theme="dark"] #reviewTranscriptPanel .subtitle-history-item * { color: #e6ebf4; }
html[data-theme="dark"] #reviewTranscriptPanel .subtitle-history-empty {
    color: #cbd5e1 !important;
}

/* AI아바타강의 게임/말하기/프리토킹 — strengthen (game body content + freetalk) */
html[data-theme="dark"] .vtuber-overlay.game-active .vtuber-game,
html[data-theme="dark"] .vtuber-game-body { background: rgba(8,15,30,0.9) !important; color: #e9eef6 !important; }
html[data-theme="dark"] .vtuber-game-body *:not(button):not(.is-correct):not(.is-wrong) { color: #e9eef6 !important; }
html[data-theme="dark"] .vtuber-game-body [style*="background:#fff"],
html[data-theme="dark"] .vtuber-game-body [style*="background: #fff"],
html[data-theme="dark"] .vtuber-game-body [style*="background:#f"],
html[data-theme="dark"] .vtuber-game-body [style*="background: #f"] { background-color: #16223c !important; }
html[data-theme="dark"] .vtuber-chat-log { background: rgba(8,15,30,0.4) !important; }

/* ============================================================================
   ORDER MODAL content — iPhone Safari re-serializes inline style hex→rgb(), so
   [style*="#hex"] catches never matched on device. Theme by class/id (reliable)
   + rgb() fallbacks. Gradients also need background-image:none.
   ============================================================================ */
html[data-theme="dark"] #orderStickerModalContent { color: var(--text-primary); }
html[data-theme="dark"] #orderStickerModalContent .class-type-card { background: #16223c !important; background-image: none !important; border-color: rgba(255,255,255,0.16) !important; color: #e6ebf4 !important; }
html[data-theme="dark"] #orderStickerModalContent input[name="classTypeModal"][value="fixed"]:checked + #cardFixed { background: rgba(99,102,241,0.22) !important; background-image: none !important; border-color: #818cf8 !important; }
html[data-theme="dark"] #orderStickerModalContent input[name="classTypeModal"][value="flexible"]:checked + #cardFlexible { background: rgba(16,185,129,0.22) !important; background-image: none !important; border-color: #34d399 !important; }
html[data-theme="dark"] #orderStickerModalContent #continueTeacherBanner { background: rgba(129,140,248,0.16) !important; background-image: none !important; border-color: rgba(129,140,248,0.32) !important; color: #e6ebf4 !important; }
html[data-theme="dark"] #orderStickerModalContent .form-input,
html[data-theme="dark"] #orderStickerModalContent select,
html[data-theme="dark"] #orderStickerModalContent input { background: var(--bg-dark) !important; color: var(--text-primary) !important; border-color: var(--border) !important; }
/* Safari rgb() fallbacks — light backgrounds → dark */
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(255, 255, 255)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(243, 244, 246)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(248, 250, 252)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(249, 250, 251)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(241, 245, 249)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(238, 242, 255)"] { background-color: #16223c !important; background-image: none !important; border-color: rgba(255,255,255,0.14) !important; }
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(224, 231, 255)"] { background-color: rgba(129,140,248,0.18) !important; background-image: none !important; }
/* Safari rgb() fallbacks — dark text → light */
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(15, 23, 42)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(17, 24, 39)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(31, 41, 55)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(51, 65, 85)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(55, 65, 81)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(71, 85, 105)"],
html[data-theme="dark"] #orderStickerModalContent [style*="rgb(100, 116, 139)"] { color: var(--text-primary) !important; }

/* mybookflip 표지 뒤 intro(student-intro) — no background box (just text on paper) */
html[data-theme="dark"] .mybookflip-page--student-intro .mybookflip-student-intro-text,
.mybookflip-page--student-intro .mybookflip-student-intro-text { background: transparent !important; border: none !important; border-left: none !important; box-shadow: none !important; }

/* 수업상세정보 right panel (학습 자료) — window #classDetailModal is #ffffff; right shows it white */
html[data-theme="dark"] #classDetailModal { background: #0b1326 !important; }
html[data-theme="dark"] #classDetailModal .item-list-panel { background: #0e1729 !important; }
html[data-theme="dark"] #classDetailContent,
html[data-theme="dark"] #lessonContentArea,
html[data-theme="dark"] #classDetailLessonContent { background: transparent !important; color: var(--text-primary) !important; }
html[data-theme="dark"] #classDetailLessonContent [style*="rgb(255, 255, 255)"],
html[data-theme="dark"] #classDetailLessonContent [style*="rgb(248, 250, 252)"],
html[data-theme="dark"] #classDetailLessonContent [style*="rgb(241, 245, 249)"] { background-color: #16223c !important; }
html[data-theme="dark"] #classDetailModal #currentItemTitle { color: var(--text-primary) !important; }

/* mybookflip 학습하기 game text (questions / 듣고있어요·말하세요 status) — force light on the dark game panel.
   단, 말하기 diff의 의미색(추가/틀림=빨강+취소선, 누락=파랑)과 정답 공개단어(파랑)는 제외해야
   아바타강의 게임과 똑같이 의미별 색이 유지된다. 이 catch-all이 의미색을 #e9eef6으로 덮어쓰면
   추가/틀림/맞음이 모두 같은 색으로 보이는 버그가 난다. */
html[data-theme="dark"] .lesson-wordgame-game,
html[data-theme="dark"] .lesson-wordgame-game *:not(button):not(.lesson-wordgame-learn-btn):not([class*="correct"]):not([class*="wrong"]):not(.avatar-lecture-speaking-diff-extra):not(.avatar-lecture-speaking-diff-missing):not(.avatar-lecture-speaking-revealed-word) { color: #e9eef6 !important; }
html[data-theme="dark"] .lesson-wordgame-game [style*="rgb(255, 255, 255)"],
html[data-theme="dark"] .lesson-wordgame-game [style*="rgb(248, 250, 252)"],
html[data-theme="dark"] .lesson-wordgame-game [style*="rgb(241, 245, 249)"] { background-color: #16223c !important; }

/* leveltest 분포 레이더 (dark): brighter, off-blue (emerald) data polygon + brighter text */
html[data-theme="dark"] .leveltest-radar svg polygon:not([fill="none"]) { fill: rgba(52,211,153,0.32) !important; stroke: #34d399 !important; }
html[data-theme="dark"] .leveltest-radar svg text[font-size="11"] { fill: #ffffff !important; }
html[data-theme="dark"] .leveltest-radar svg text[font-size="9"] { fill: #6ee7b7 !important; }

/* order modal follow-up (Safari rgb → target by class/id) */
/* [1] modal box bg (inline white) + loading spinner/text during initial load */
html[data-theme="dark"] #orderStickerModal .modal { background: var(--bg-card) !important; }
html[data-theme="dark"] #orderStickerModalContent .fa-spinner,
html[data-theme="dark"] #orderStickerModalContent .order-policy-loading { color: var(--text-secondary) !important; }
/* [2] 王小乔 선생님과 계속 수업 진행 할까요? banner text */
html[data-theme="dark"] #continueTeacherBanner,
html[data-theme="dark"] #continueTeacherBanner * { color: #e9eef6 !important; }
/* [3] 고정/자유 class-type cards — name/desc text light (selected + unselected) */
html[data-theme="dark"] #orderStickerModalContent .class-type-card,
html[data-theme="dark"] #orderStickerModalContent .class-type-card * { color: #e9eef6 !important; }

/* 수강신청 모달 로딩 오버레이 (#orderModalLoadingOverlay: white bg + dark spinner/text) → dark */
html[data-theme="dark"] #orderModalLoadingOverlay { background: rgba(11,19,38,0.96) !important; }
html[data-theme="dark"] #orderModalLoadingOverlay * { color: var(--text-primary) !important; }
html[data-theme="dark"] #orderModalLoadingOverlay .spinner { border-color: rgba(255,255,255,0.22) !important; border-top-color: var(--primary) !important; }

/* 수강신청 모달 약관 동의 박스 (자유=amber #fef3c7/#92400e, 고정=cyan #ecfeff/#0e7490) → 다크 */
html[data-theme="dark"] #flexibleValidityWrap { background: #16223c !important; border-color: rgba(255,255,255,0.12) !important; border-left: 3px solid #f59e0b !important; }
html[data-theme="dark"] #flexibleValidityWrap span,
html[data-theme="dark"] #flexibleValidityWrap strong { color: #e6ebf4 !important; }
html[data-theme="dark"] #fixedValidityWrap { background: #0c2b33 !important; border-color: #155e6b !important; }
html[data-theme="dark"] #fixedValidityWrap span,
html[data-theme="dark"] #fixedValidityWrap strong { color: #7dd3e8 !important; }

/* 채팅 팝업 말풍선 — 받는 쪽(.assistant = 선생님/담당자/수업알림)은 흰배경+검은글자라 다크에서 안 보임.
   인라인 cssText로 색을 넣어 iPhone에서 rgb로 직렬화되므로, 클래스 + !important로 덮어쓴다.
   보내는 쪽(.user)은 파란 배경+흰 글자라 다크에서도 OK → 건드리지 않음. */
html[data-theme="dark"] .chat-popup-bubble.assistant {
    background: rgba(255,255,255,0.16) !important;
    border-color: rgba(255,255,255,0.24) !important;
    color: #eaf0f8 !important;
}
html[data-theme="dark"] .chat-popup-bubble.assistant a { color: #7dd3fc !important; }
html[data-theme="dark"] .chat-typing-indicator { color: #94a3b8 !important; }
/* 학생(.user) 말풍선의 시간(타임스탬프)이 파란 배경에 묻혀 안 보임 → 밝게 */
html[data-theme="dark"] .chat-popup-bubble.user > div:last-child { color: rgba(255,255,255,0.82) !important; }

/* AI앱목록 헤더의 '앱UID등록' 버튼: 다크에서 btn-secondary가 카드색(--bg-card)과 같아 버튼처럼 안 보임 → 채운 버튼 */
html[data-theme="dark"] .ai-apps-card .card-header .btn-secondary {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}
/* 수강신청내역 액션 버튼(재수강/영수증/현금영수증/환불내역/환불요청): 다크에서 btn-secondary가 행 배경과
   같거나 일부는 inline background:transparent라 버튼처럼 안 보임 → 구분되는 채움(!important로 inline도 덮음) */
html[data-theme="dark"] .order-action-buttons .btn-secondary {
    background: rgba(255,255,255,0.10) !important;
    border-color: rgba(255,255,255,0.20) !important;
    color: #e6ebf4 !important;
}

/* #1 시간변경/연기/보강/레벨테스트신청 모달: 헤더 드래그(moveable)로 컨테이너 style 속성이
   rgb()로 재직렬화되면 [style*=#fff] 다크 캐치가 깨져 배경이 흰색으로 되돌아감 →
   컨테이너 배경을 클래스/ID로 직접 지정해 드래그와 무관하게 항상 다크 유지 */
html[data-theme="dark"] .class-action-sticker,
html[data-theme="dark"] .class-time-change-modal,
html[data-theme="dark"] .class-postpone-modal,
html[data-theme="dark"] .fixed-textbook-selector-modal,
html[data-theme="dark"] #levelTestStickerModal .modal {
    background: var(--bg-card) !important;
    background-image: none !important;
}

/* #2 수강료 영수증(.receipt-container)은 인쇄용 → 다크모드에서도 라이트(흰 종이/검은 글자) 유지.
   다크 캐치가 종이를 어둡게 만들지 않도록 라이트 값을 재지정한다. */
html[data-theme="dark"] .receipt-container { background: linear-gradient(135deg, #fefefe 0%, #f8f6f0 100%) !important; }
html[data-theme="dark"] .receipt-container,
html[data-theme="dark"] .receipt-container * { color: #1f2937 !important; border-color: #e5e7eb !important; }
html[data-theme="dark"] .receipt-container .receipt-table td { background-color: #ffffff !important; }
html[data-theme="dark"] .receipt-container .receipt-table td:nth-child(odd) { background-color: #f9fafb !important; }

/* #4 선생님 프로필 모달(#teacherSlotDetailOverlay): 인라인 hex가 iPhone에서 rgb로 직렬화돼
   [style*=#hex] 캐치가 어긋나 흰 배경/안 보이는 X가 됨 → 안정적인 id/data/aria 선택자로 다크 처리.
   닫기 X는 녹색 헤더 위 흰 원 + 검은 ×로 유지(보이게). */
html[data-theme="dark"] #teacherSlotDetailOverlay > div { background: var(--bg-card) !important; }
html[data-theme="dark"] #teacherSlotDetailOverlay > div *:not([data-close]) { color: var(--text-primary) !important; }
html[data-theme="dark"] #teacherSlotDetailOverlay [data-intro-tab-panel] { background: var(--bg-soft) !important; border-color: var(--border) !important; }
html[data-theme="dark"] #teacherSlotDetailOverlay [data-intro-tab-trigger][aria-selected="true"] { color: #93c5fd !important; background: rgba(96,165,250,0.16) !important; }
html[data-theme="dark"] #teacherSlotDetailOverlay [data-close] { background: rgba(255,255,255,0.92) !important; color: #0f172a !important; }

/* 1:1 고객상담 작성/상세 모달: 헤더 드래그(moveable) 시 컨테이너 style 속성이 rgb로 재직렬화되어
   [style*=#fff] 다크 캐치가 깨져 배경이 흰색으로 복귀 → 컨테이너 배경을 ID로 직접 지정 */
html[data-theme="dark"] #counselComposeModal,
html[data-theme="dark"] #counselDetailModal { background: var(--bg-card) !important; }

/* 다크: 스티커 확인/알림 모달(.sticker-modal-content)은 흰 배경 + 검은 제목(h3 #1f2937)이라
   다크에서 제목 글자가 안 보임(예: '2차인증 해제' 확인). 클래스 기반으로 다크 처리. */
html[data-theme="dark"] .sticker-modal-content { background: var(--bg-card) !important; }
html[data-theme="dark"] .sticker-modal-content h3 { color: var(--text-primary) !important; }
html[data-theme="dark"] .sticker-modal-content p { color: #cbd5e1 !important; }
html[data-theme="dark"] .sticker-modal-content .sticker-confirm-cancel { background: rgba(255,255,255,0.12) !important; color: #e6ebf4 !important; }

/* 다크: 수업상세정보 모달 레슨 콘텐츠 — 문법TIP 박스(핵심표현)는 라이트 그라데이션 배경(.learning-grammar-section
   안의 박스)이라 다크에서 흰색으로 떠 글자가 안 보임. mybookflip은 .mybookflip-page로 따로 처리돼 있어 영향 없음. */
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-section > div:has(> .learning-grammar-markdown) {
    background: var(--bg-soft) !important;
    background-image: none !important;
    border-color: rgba(255,255,255,0.12) !important;
    box-shadow: none !important;
}
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown,
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown * { color: #e6ebf4 !important; }
/* 다크: 'AI에게 질문해 보세요' 안내(레슨 콘텐츠 첫 줄 dashed amber 박스) — 라이트 앰버라 글자가 안 보임 */
html[data-theme="dark"] #classDetailLessonContent > div:first-child {
    background: #3a2e12 !important;
    border-color: #b45309 !important;
    color: #fcd34d !important;
}

/* 마크다운 인용(blockquote): learning-markdown이 인라인으로 흰 배경(rgba(255,255,255,0.72)) + 어두운
   글자(#334155)를 넣어 다크모드에서 안 보임. 기존 다크 규칙은 .mybookflip-page / .vtuber-chat-markdown
   에만 한정돼 있어 대화표현·문법TIP·수업상세정보 등에서는 흰색으로 남음. blockquote는 요소 선택자라
   인라인 직렬화 영향 없이 전 컨텍스트를 한 번에 다크 처리한다(레슨 마크다운 외엔 blockquote 미사용). */
html[data-theme="dark"] blockquote {
    background: rgba(255, 255, 255, 0.06) !important;
    border-left-color: var(--primary) !important;
    color: #e6ebf4 !important;
}

/* 수업확인(연기/보강/시간변경) 확인 모달 */
.inline-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 20050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(6px);
}

.inline-confirm-modal {
    width: min(560px, calc(100vw - 28px)) !important;
    max-width: 560px !important;
    max-height: min(760px, calc(100dvh - 32px)) !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32) !important;
    text-align: left !important;
    transform: none !important;
}

.inline-confirm-modal.is-point-postpone-confirm {
    width: min(440px, calc(100vw - 18px)) !important;
    max-width: 440px !important;
    border-radius: 28px !important;
}

.inline-confirm-overlay.is-point-postpone-overlay {
    align-items: center;
    padding: 9px;
    background: rgba(15, 23, 42, 0.56);
}

.inline-confirm-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, #047857, #10b981);
}

.inline-confirm-icon {
    width: 2.45rem;
    height: 2.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 1.05rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.inline-confirm-heading {
    min-width: 0;
}

.inline-confirm-title {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 1.24rem !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    line-height: 1.25 !important;
}

.inline-confirm-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1.15rem 1.35rem 1.2rem;
    background: #ffffff;
}

.inline-confirm-modal.is-point-postpone-confirm .inline-confirm-body {
    padding: 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(239, 106, 33, 0.13), transparent 32%),
        radial-gradient(circle at 0% 12%, rgba(20, 27, 45, 0.06), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #ffffff 55%, #fff8f1 100%);
    scrollbar-width: none;
}

.inline-confirm-modal.is-point-postpone-confirm .inline-confirm-body::-webkit-scrollbar {
    display: none;
}

.inline-confirm-modal.is-point-postpone-confirm .inline-confirm-message {
    margin: 0 !important;
    color: inherit;
    line-height: normal;
}

.inline-confirm-message {
    margin: 0 !important;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.62;
    white-space: pre-line;
    text-align: left;
}

.inline-confirm-footer {
    flex: 0 0 auto;
    padding: 0.95rem 1.35rem 1.1rem;
    border-top: 1px solid #e8edf5;
    background: rgba(248, 250, 252, 0.98);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.05);
}

.inline-confirm-actions {
    display: flex;
    gap: 0.65rem;
    justify-content: center;
}

.inline-confirm-btn {
    flex: 1;
    min-height: 42px;
    padding: 0.66rem 1rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.inline-confirm-btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.inline-confirm-no {
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    color: #475569;
}

.inline-confirm-yes {
    border: 1px solid transparent;
    background: #10b981;
    color: #ffffff;
}

.inline-confirm-yes:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.inline-confirm-loading {
    justify-content: center;
    align-items: center;
    min-height: 2.75rem;
}

.inline-confirm-spinner {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(16, 185, 129, 0.18);
    border-top-color: #10b981;
    border-radius: 999px;
    animation: inlineConfirmSpin 0.7s linear infinite;
}

.class-flow-confirm-shell {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    text-align: left;
}

.class-flow-route-card {
    padding: 0.9rem 1rem;
    border: 1px solid var(--route-card-border);
    border-radius: 15px;
    background: var(--route-card-bg);
}

.class-flow-route-label {
    color: var(--route-label-color);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.2;
}

.class-flow-route-text {
    margin-top: 0.28rem;
    color: var(--route-text-color);
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.42;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.class-flow-arrow {
    display: flex;
    justify-content: center;
    color: var(--flow-arrow-color);
}

.class-flow-arrow i {
    width: 1.95rem;
    height: 1.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--flow-arrow-bg);
    font-size: 0.9rem;
}

.class-flow-question {
    margin-top: 0.2rem;
    color: var(--flow-question-color);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.45;
    text-align: center;
    word-break: keep-all;
}

.point-postpone-flow-shell {
    gap: 12px;
    padding: 8px;
    white-space: normal;
}

.point-postpone-flow-shell * {
    white-space: normal;
}

.point-postpone-schedule-card {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.09);
}

.point-postpone-schedule-item {
    position: relative;
    padding: 15px 18px;
}

.point-postpone-schedule-item.current {
    padding-bottom: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.point-postpone-schedule-item.next {
    padding-top: 22px;
    padding-bottom: 16px;
    border-top: 1px solid #e5ebf3;
    background:
        radial-gradient(circle at 100% 0%, rgba(239, 106, 33, 0.12), transparent 40%),
        linear-gradient(135deg, #fff6eb 0%, #fffdf9 72%);
}

.point-postpone-schedule-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.point-postpone-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #6b7a90;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.2;
}

.point-postpone-label::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

.point-postpone-schedule-item.next .point-postpone-label {
    color: #c94812;
}

.point-postpone-chip {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    line-height: 1;
    font-weight: 850;
    letter-spacing: 0;
}

.point-postpone-schedule-item.next .point-postpone-chip {
    background: #ffe8d1;
    color: #c94812;
}

.point-postpone-lesson-time {
    color: #111827;
    font-size: clamp(21px, 5vw, 24px);
    line-height: 1.16;
    letter-spacing: 0;
    font-weight: 950;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.point-postpone-schedule-item.next .point-postpone-lesson-time {
    color: #9f3413;
}

.point-postpone-sub-info {
    margin-top: 7px;
    color: #8a94a6;
    font-size: 14px;
    line-height: 1.42;
    letter-spacing: 0;
    font-weight: 650;
    word-break: keep-all;
}

.point-postpone-flow-divider {
    position: relative;
    z-index: 10;
    height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    pointer-events: none;
}

.point-postpone-flow-divider::before,
.point-postpone-flow-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #dfe6ef, transparent);
}

.point-postpone-flow-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #141b2d;
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    font-weight: 950;
    box-shadow:
        0 10px 20px rgba(17, 24, 39, 0.2),
        0 0 0 5px rgba(255, 255, 255, 0.95);
}

.point-postpone-confirm-card.point-postpone-point-card {
    margin-top: 0;
    padding: 16px;
    border: 0;
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0%, rgba(239, 106, 33, 0.22), transparent 38%),
        linear-gradient(145deg, #141b2d 0%, #1f293f 100%);
    color: #ffffff;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    white-space: normal;
}

.point-postpone-badge {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffd6b4;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0;
}

.point-postpone-title {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 20px !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    font-weight: 950 !important;
    word-break: keep-all;
}

.point-postpone-desc {
    margin: 8px 0 0 !important;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.43;
    letter-spacing: 0;
    font-weight: 650;
    word-break: keep-all;
}

.point-postpone-agree-box {
    margin-top: 10px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
}

.point-postpone-check {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #f8fafc;
    cursor: pointer;
    user-select: none;
}

.point-postpone-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.point-postpone-custom-check {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin-top: 0;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    transition: 0.18s ease;
}

.point-postpone-check input:checked + .point-postpone-custom-check {
    border-color: #ef6a21;
    background: #ef6a21;
}

.point-postpone-check input:checked + .point-postpone-custom-check::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid #ffffff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.point-postpone-agree-text {
    margin: 0;
    color: #f8fafc;
    font-size: 14px;
    line-height: 1.42;
    letter-spacing: 0;
    font-weight: 800;
    word-break: keep-all;
}

.point-postpone-agree-title,
.point-postpone-agree-detail {
    display: block;
}

.point-postpone-agree-title {
    margin-bottom: 3px;
    font-size: 14px;
    line-height: 1.34;
    font-weight: 900;
}

.point-postpone-agree-detail {
    color: #e2e8f0;
    font-size: 12.5px;
    line-height: 1.4;
    font-weight: 760;
}

.point-postpone-agree-text strong {
    color: #ffbd80;
    font-weight: 950;
}

.point-postpone-point-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1.12fr);
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.point-postpone-point-cell {
    min-width: 0;
    padding: 7px 6px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.point-postpone-result-cell {
    background: rgba(239, 106, 33, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 189, 128, 0.28);
}

.point-postpone-point-label {
    display: block;
    margin-bottom: 4px;
    color: #9aa8bc;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.15;
    white-space: nowrap;
}

.point-postpone-point-value {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1.15;
    white-space: nowrap;
}

.point-postpone-result-cell .point-postpone-point-label {
    color: #ffd6b4;
}

.point-postpone-result-cell .point-postpone-point-value {
    color: #ffbd80;
}

.point-postpone-operator {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffbd80;
    font-size: 15px;
    font-weight: 950;
}

.point-postpone-warning {
    margin-top: 0.8rem;
    color: #fecaca;
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.45;
    word-break: keep-all;
}

html[data-theme="dark"] .inline-confirm-modal {
    background: #141f36 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .inline-confirm-header {
    background: linear-gradient(135deg, #047857, #10b981);
    border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .inline-confirm-footer {
    background: #16223c;
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .inline-confirm-icon {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

html[data-theme="dark"] .inline-confirm-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .inline-confirm-body {
    background: #141f36;
}

html[data-theme="dark"] .inline-confirm-modal.is-point-postpone-confirm .inline-confirm-body {
    background:
        radial-gradient(circle at 100% 0%, rgba(239, 106, 33, 0.13), transparent 32%),
        radial-gradient(circle at 0% 12%, rgba(255, 255, 255, 0.05), transparent 28%),
        linear-gradient(180deg, #0f172a 0%, #111827 55%, #1f1712 100%);
}

html[data-theme="dark"] .inline-confirm-message {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .inline-confirm-no {
    background: rgba(255,255,255,0.10) !important;
    border-color: rgba(255,255,255,0.18) !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] .point-postpone-check {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(251, 146, 60, 0.36);
}

html[data-theme="dark"] .point-postpone-point-card .point-postpone-check {
    background: transparent;
    border-color: transparent;
}

html[data-theme="dark"] .point-postpone-check:has(input:checked) {
    background: rgba(16, 185, 129, 0.14);
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

html[data-theme="dark"] .point-postpone-point-card .point-postpone-check:has(input:checked) {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

html[data-theme="dark"] .point-postpone-schedule-card {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .point-postpone-schedule-item.current {
    background: linear-gradient(180deg, #111827 0%, #151f32 100%);
}

html[data-theme="dark"] .point-postpone-schedule-item.next {
    border-top-color: rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(circle at 100% 0%, rgba(239, 106, 33, 0.18), transparent 42%),
        linear-gradient(135deg, #271b12 0%, #171d2a 72%);
}

html[data-theme="dark"] .point-postpone-label {
    color: #9aa8bc;
}

html[data-theme="dark"] .point-postpone-schedule-item.next .point-postpone-label {
    color: #ffbd80;
}

html[data-theme="dark"] .point-postpone-chip {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

html[data-theme="dark"] .point-postpone-schedule-item.next .point-postpone-chip {
    background: rgba(239, 106, 33, 0.18);
    color: #ffbd80;
}

html[data-theme="dark"] .point-postpone-lesson-time {
    color: #f8fafc;
}

html[data-theme="dark"] .point-postpone-schedule-item.next .point-postpone-lesson-time {
    color: #fed7aa;
}

html[data-theme="dark"] .point-postpone-sub-info {
    color: #a7b2c5;
}

html[data-theme="dark"] .point-postpone-flow-icon {
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.3),
        0 0 0 5px #111827;
}

@media (max-width: 520px) {
    .inline-confirm-overlay {
        align-items: flex-end;
        padding: 0.75rem;
    }

    .inline-confirm-modal {
        width: 100% !important;
        max-height: min(720px, calc(100dvh - 24px)) !important;
        border-radius: 20px !important;
    }

    .inline-confirm-modal.is-point-postpone-confirm {
        width: min(440px, calc(100vw - 18px)) !important;
        max-width: 440px !important;
        max-height: min(760px, calc(100dvh - 24px)) !important;
        border-radius: 24px !important;
    }

    .inline-confirm-header,
    .inline-confirm-body,
    .inline-confirm-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .inline-confirm-title {
        font-size: 1.16rem !important;
    }

    .class-flow-route-text {
        font-size: 0.98rem;
    }

    .inline-confirm-actions {
        gap: 0.5rem;
    }

    .inline-confirm-btn {
        min-height: 44px;
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .inline-confirm-modal.is-point-postpone-confirm .inline-confirm-body {
        padding: 0;
    }

    .point-postpone-schedule-item {
        padding: 14px 16px;
    }

    .point-postpone-schedule-item.current {
        padding-bottom: 20px;
    }

    .point-postpone-schedule-item.next {
        padding-top: 20px;
        padding-bottom: 16px;
    }

    .point-postpone-lesson-time {
        font-size: clamp(21px, 5.8vw, 23px);
        line-height: 1.16;
    }

    .point-postpone-confirm-card.point-postpone-point-card {
        padding: 15px 14px;
    }

    .point-postpone-title {
        font-size: 20px !important;
    }

    .point-postpone-agree-text {
        font-size: 14px;
    }
}

/* 다크: 연기(cwf-gray) 버튼과 그 아래 삼각형(cwf-tri-gray)이 반투명 --b-e2e8f0(rgba(148,163,184,0.20))을
   쓰는데, 삼각형이 -2px 겹치면서 알파가 중첩돼 경계선(테두리)처럼 보임. 둘 다 동일한 '불투명' 색으로
   지정해 버튼+삼각형이 하나로 보이게 한다. (다른 색 버튼은 불투명 hex라 문제 없음) */
html[data-theme="dark"] .calendar-week-action.cwf-gray { background: #2f3b55 !important; }
html[data-theme="dark"] .cwf-tri-gray { background: #2f3b55 !important; }

/* 화상수업 학생 수업내용: JS가 인라인/동적 스타일로 만든 라이트 카드가 다크모드에서 섞여
   글자가 묻히지 않도록 영상 모달 내부만 강하게 보정한다. */
html[data-theme="dark"] #studentVideoModal .student-lesson-content,
html[data-theme="dark"] #studentLessonContent,
html[data-theme="dark"] #studentStickerContent {
    background: #0f172a !important;
    color: #e8eef8 !important;
}
html[data-theme="dark"] #studentVideoModal .student-lesson-inner,
html[data-theme="dark"] #studentVideoModal .student-dialog-section,
html[data-theme="dark"] #studentVideoModal .student-guide-section,
html[data-theme="dark"] #studentVideoModal .student-lesson-card,
html[data-theme="dark"] #studentLessonContent [style*="background: #f8fafc"],
html[data-theme="dark"] #studentLessonContent [style*="background:#f8fafc"],
html[data-theme="dark"] #studentLessonContent [style*="background: #ffffff"],
html[data-theme="dark"] #studentLessonContent [style*="background:#ffffff"],
html[data-theme="dark"] #studentLessonContent [style*="background: white"],
html[data-theme="dark"] #studentStickerContent [style*="background: #f8fafc"],
html[data-theme="dark"] #studentStickerContent [style*="background:#f8fafc"],
html[data-theme="dark"] #studentStickerContent [style*="background: #ffffff"],
html[data-theme="dark"] #studentStickerContent [style*="background:#ffffff"],
html[data-theme="dark"] #studentStickerContent [style*="background: white"] {
    background: #111827 !important;
    background-image: none !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    color: #e8eef8 !important;
}
html[data-theme="dark"] #studentVideoModal .student-lesson-content *,
html[data-theme="dark"] #studentLessonContent [style*="color: #0f172a"],
html[data-theme="dark"] #studentLessonContent [style*="color:#0f172a"],
html[data-theme="dark"] #studentLessonContent [style*="color: #111827"],
html[data-theme="dark"] #studentLessonContent [style*="color:#111827"],
html[data-theme="dark"] #studentLessonContent [style*="color: #1f2937"],
html[data-theme="dark"] #studentLessonContent [style*="color:#1f2937"],
html[data-theme="dark"] #studentLessonContent [style*="color: #334155"],
html[data-theme="dark"] #studentLessonContent [style*="color:#334155"],
html[data-theme="dark"] #studentStickerContent [style*="color: #0f172a"],
html[data-theme="dark"] #studentStickerContent [style*="color:#0f172a"],
html[data-theme="dark"] #studentStickerContent [style*="color: #111827"],
html[data-theme="dark"] #studentStickerContent [style*="color:#111827"],
html[data-theme="dark"] #studentStickerContent [style*="color: #1f2937"],
html[data-theme="dark"] #studentStickerContent [style*="color:#1f2937"],
html[data-theme="dark"] #studentStickerContent [style*="color: #334155"],
html[data-theme="dark"] #studentStickerContent [style*="color:#334155"] {
    color: #e8eef8 !important;
}
html[data-theme="dark"] #studentVideoModal .student-lesson-content [style*="color: #64748b"],
html[data-theme="dark"] #studentVideoModal .student-lesson-content [style*="color:#64748b"],
html[data-theme="dark"] #studentVideoModal .student-lesson-content [style*="color: #6b7280"],
html[data-theme="dark"] #studentVideoModal .student-lesson-content [style*="color:#6b7280"],
html[data-theme="dark"] #studentVideoModal .student-lesson-content [style*="color: #94a3b8"],
html[data-theme="dark"] #studentVideoModal .student-lesson-content [style*="color:#94a3b8"] {
    color: #cbd5e1 !important;
}
html[data-theme="dark"] #studentVideoModal .student-lesson-content button,
html[data-theme="dark"] #studentVideoModal .student-lesson-content button * {
    color: inherit;
}

html[data-theme="dark"] #studentVideoModal .student-video-header,
html[data-theme="dark"] .student-video-header {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

html[data-theme="dark"] #studentVideoModal .student-lesson-hint {
    background: rgba(120, 53, 15, 0.92) !important;
    border-color: rgba(251, 191, 36, 0.78) !important;
    color: #fef3c7 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
}
html[data-theme="dark"] #studentVideoModal .student-lesson-hint *,
html[data-theme="dark"] #studentVideoModal .student-lesson-hint i {
    color: #fde68a !important;
}

html[data-theme="dark"] #studentLessonContent .learning-grammar-section > div:has(> .learning-grammar-markdown),
html[data-theme="dark"] #studentVideoModal .learning-grammar-section > div:has(> .learning-grammar-markdown) {
    background: #111827 !important;
    background-image: none !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    box-shadow: none !important;
    color: #e8eef8 !important;
}
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown *,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown * {
    color: #e8eef8 !important;
}
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown blockquote,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown blockquote {
    background: rgba(255, 255, 255, 0.06) !important;
    border-left-color: #10b981 !important;
}

/* 다크: 교재미리보기/수업상세 문법TIP의 광범위한 흰색 강제 규칙이
   중요어법·대화표현·핵심단어 타이틀과 ==예제 강조== 색을 덮지 않게 복원한다. */
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown,
html[data-theme="dark"] #previewLessonContent .learning-grammar-markdown,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown {
    --learning-markdown-pattern-text: #fbbf24;
    --learning-markdown-title-grammar: #5eead4;
    --learning-markdown-title-dialog: #93c5fd;
    --learning-markdown-title-vocab: #fbbf24;
    --learning-markdown-title-accent-1: #5eead4;
    --learning-markdown-title-accent-2: #c4b5fd;
    --learning-markdown-title-accent-3: #fda4af;
    --learning-markdown-title-accent-4: #93c5fd;
    --learning-markdown-quote-text: #e6ebf4;
    --learning-markdown-quote-bg: rgba(255, 255, 255, 0.06);
    --learning-markdown-quote-border: #10b981;
}
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown .learning-markdown-title-grammar,
html[data-theme="dark"] #previewLessonContent .learning-grammar-markdown .learning-markdown-title-grammar,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown .learning-markdown-title-grammar,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown .learning-markdown-title-grammar {
    color: var(--learning-markdown-title-grammar, #5eead4) !important;
}
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown .learning-markdown-title-dialog,
html[data-theme="dark"] #previewLessonContent .learning-grammar-markdown .learning-markdown-title-dialog,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown .learning-markdown-title-dialog,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown .learning-markdown-title-dialog {
    color: var(--learning-markdown-title-dialog, #93c5fd) !important;
}
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown .learning-markdown-title-vocab,
html[data-theme="dark"] #previewLessonContent .learning-grammar-markdown .learning-markdown-title-vocab,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown .learning-markdown-title-vocab,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown .learning-markdown-title-vocab {
    color: var(--learning-markdown-title-vocab, #fbbf24) !important;
}
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown .learning-markdown-title-accent-1,
html[data-theme="dark"] #previewLessonContent .learning-grammar-markdown .learning-markdown-title-accent-1,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown .learning-markdown-title-accent-1,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown .learning-markdown-title-accent-1 {
    color: var(--learning-markdown-title-accent-1, #5eead4) !important;
}
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown .learning-markdown-title-accent-2,
html[data-theme="dark"] #previewLessonContent .learning-grammar-markdown .learning-markdown-title-accent-2,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown .learning-markdown-title-accent-2,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown .learning-markdown-title-accent-2 {
    color: var(--learning-markdown-title-accent-2, #c4b5fd) !important;
}
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown .learning-markdown-title-accent-3,
html[data-theme="dark"] #previewLessonContent .learning-grammar-markdown .learning-markdown-title-accent-3,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown .learning-markdown-title-accent-3,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown .learning-markdown-title-accent-3 {
    color: var(--learning-markdown-title-accent-3, #fda4af) !important;
}
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown .learning-markdown-title-accent-4,
html[data-theme="dark"] #previewLessonContent .learning-grammar-markdown .learning-markdown-title-accent-4,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown .learning-markdown-title-accent-4,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown .learning-markdown-title-accent-4 {
    color: var(--learning-markdown-title-accent-4, #93c5fd) !important;
}
html[data-theme="dark"] #classDetailLessonContent .learning-grammar-markdown .learning-grammar-pattern,
html[data-theme="dark"] #previewLessonContent .learning-grammar-markdown .learning-grammar-pattern,
html[data-theme="dark"] #studentLessonContent .learning-grammar-markdown .learning-grammar-pattern,
html[data-theme="dark"] #studentVideoModal .learning-grammar-markdown .learning-grammar-pattern {
    color: var(--learning-markdown-pattern-text, #fbbf24) !important;
}
html[data-theme="dark"] .learning-grammar-markdown .learning-markdown-heading .learning-grammar-pattern,
html[data-theme="dark"] .learning-grammar-markdown .learning-markdown-title-item .learning-grammar-pattern {
    color: inherit !important;
}

html[data-theme="dark"] .chat-image-window-header {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-bottom-color: rgba(16, 185, 129, 0.36) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] #studentWbCanvasWrapper {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

html[data-theme="dark"] .student-wb-placeholder-card {
    background: rgba(15, 23, 42, 0.86) !important;
    border: 1px solid rgba(148, 163, 184, 0.32) !important;
    border-radius: 18px;
    color: #f8fafc !important;
    padding: 1rem 1.25rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.32);
}
html[data-theme="dark"] .student-wb-placeholder-card,
html[data-theme="dark"] .student-wb-placeholder-card * {
    color: #f8fafc !important;
}

/* 수업평가 스티커 모달: 배경은 노란 스티커라 다크모드 전역 color override가 오히려
   흰 글자를 만들어 가독성을 깨뜨린다. 이 모달 안에서는 어두운 글자를 유지한다. */
html[data-theme="dark"] #classFeedbackModalOverlay .class-feedback-modal,
html[data-theme="dark"] #classFeedbackModalOverlay .class-feedback-modal *:not(#classFeedbackSubmitBtn):not(#classFeedbackSubmitBtn *):not(.class-feedback-coupon-label):not(.class-feedback-coupon-label *) {
    color: #111827 !important;
}
html[data-theme="dark"] #classFeedbackModalOverlay [style*="color: #111827"],
html[data-theme="dark"] #classFeedbackModalOverlay [style*="color:#111827"],
html[data-theme="dark"] #classFeedbackModalOverlay [style*="color: #1f2937"],
html[data-theme="dark"] #classFeedbackModalOverlay [style*="color:#1f2937"] {
    color: #111827 !important;
}
html[data-theme="dark"] #classFeedbackModalOverlay .class-feedback-modal {
    background: linear-gradient(180deg, #ffe98c 0%, #ffd449 100%) !important;
    border-color: #d4a200 !important;
}
html[data-theme="dark"] #classFeedbackModalOverlay #classFeedbackText {
    background: #fff7c2 !important;
    color: #111827 !important;
    border-color: rgba(0, 0, 0, 0.22) !important;
}
html[data-theme="dark"] #classFeedbackModalOverlay #classFeedbackSubmitBtn {
    background: #374151 !important;
    color: #ffffff !important;
}
/* Level-test application modal */
#levelTestStickerModal .level-test-application-modal {
    background: var(--bg-card) !important;
    color: var(--text-primary);
}

.level-test-application-content {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.level-test-application-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.level-test-application-intro {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border-left: 4px solid #10b981;
    border-radius: 8px;
    background: #ecfdf3;
    color: #065f46;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.55;
}

.level-test-application-intro-sub {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.level-test-wizard {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    color: #1f2937;
}

.level-test-wizard-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scroll-padding-bottom: 1.5rem;
}

.level-test-wizard-loading {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: #475569;
    font-weight: 700;
}

.level-test-wizard-loading[hidden] {
    display: none;
}

.level-test-wizard-guide-title {
    margin: 1rem 0 0;
    color: #111827;
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.4;
    text-align: center;
}

.level-test-wizard-guide-emphasis {
    color: #dc2626;
    white-space: nowrap;
}

.level-test-wizard.is-direct .level-test-wizard-guide-title {
    display: none;
}

.level-test-wizard-progress {
    margin: 1.1rem 0 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.level-test-wizard-progress[hidden] {
    display: none;
}

.level-test-wizard-stage {
    min-width: 0;
    overflow: hidden;
}

.level-test-wizard-slide {
    min-width: 0;
}

.level-test-wizard-slide[hidden] {
    display: none !important;
}

.level-test-wizard-slide.is-active {
    display: block;
}

.level-test-wizard-slide.is-forward {
    animation: levelTestWizardSlideForward 240ms ease-out both;
}

.level-test-wizard-slide.is-backward {
    animation: levelTestWizardSlideBackward 240ms ease-out both;
}

@keyframes levelTestWizardSlideForward {
    from { opacity: 0; transform: translateX(32px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes levelTestWizardSlideBackward {
    from { opacity: 0; transform: translateX(-32px); }
    to { opacity: 1; transform: translateX(0); }
}

.level-test-wizard-heading {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.level-test-wizard:not(.is-direct) .level-test-wizard-heading {
    margin-top: 50px;
}

.level-test-wizard-heading h4 {
    margin: 0;
    color: #111827;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.35;
}

.level-test-wizard-heading p {
    margin: 0.4rem 0 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
}

.level-test-wizard-install-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: start;
    gap: 1.5rem;
}

.level-test-wizard-download-qr {
    width: 190px;
    height: 190px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #ffffff;
}

.level-test-wizard-download-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.level-test-wizard-install-copy {
    align-self: start;
    justify-content: flex-start;
    gap: 0.75rem;
}

.level-test-wizard-note {
    margin: 0;
    padding: 1rem;
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0c4a6e;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.65;
}

.level-test-wizard-sync-layout {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem 1.4rem;
}

.level-test-wizard-sync-qr-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.level-test-wizard-sync-qr {
    width: 180px;
    height: 180px;
    --qr-icon-size: 2.25rem;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #ffffff;
}

.level-test-wizard-install-instruction,
.level-test-wizard-scan-instruction {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.55;
}

.level-test-wizard-qr-status {
    grid-column: 1 / -1;
    justify-self: center;
    width: max-content;
    max-width: 100%;
    margin: 0.45rem auto 0;
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
}

.level-test-wizard-qr-status[data-qr-status="waiting_for_scan"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    justify-self: stretch;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.65rem 0 0 !important;
    padding: 0.62rem 0.85rem !important;
    box-sizing: border-box;
    border: 1px solid #166534 !important;
    border-radius: 6px !important;
    background: #050505 !important;
    color: #34d399 !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    text-align: center !important;
    white-space: nowrap;
}

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

.order-wizard-sync-status[data-qr-status="waiting_for_scan"]::before,
.level-test-wizard-qr-status[data-qr-status="waiting_for_scan"]::before {
    content: "";
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    box-sizing: border-box;
    border: 2px solid rgba(52, 211, 153, 0.32);
    border-top-color: #34d399;
    border-radius: 50%;
    animation: wizardQrWaitingSpin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .order-wizard-sync-status[data-qr-status="waiting_for_scan"]::before,
    .level-test-wizard-qr-status[data-qr-status="waiting_for_scan"]::before {
        animation-duration: 1.8s;
    }
}

.level-test-wizard-sync-badge {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #047857;
    font-size: 0.88rem;
    font-weight: 800;
}

.level-test-wizard-sync-badge[hidden] {
    display: none;
}

.level-test-wizard-sync-copy {
    min-width: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.level-test-wizard-sync-highlight {
    margin: 0;
    padding: 1rem;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #ecfdf5;
    color: #065f46;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.65;
}

.level-test-wizard-video-panel {
    min-width: 0;
    line-height: 0;
}

.level-test-wizard-video-panel video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: transparent;
    pointer-events: none;
}

.level-test-wizard-shared-video {
    width: min(100%, 620px);
    margin: 1.4rem auto 0;
}

.level-test-wizard-shared-video[hidden] {
    display: none;
}

.level-test-wizard-actions {
    margin-top: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.level-test-wizard-actions-end {
    justify-content: flex-end;
}

.level-test-wizard-store-action:empty {
    display: none;
}

.level-test-wizard-next,
.level-test-wizard-back {
    min-height: 42px;
    padding: 0.62rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
}

.level-test-wizard-next {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.level-test-wizard-back {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.level-test-wizard-schedule-heading {
    margin-bottom: 0.85rem;
}

.level-test-wizard.is-direct .level-test-wizard-schedule-heading .level-test-wizard-heading-number {
    display: none;
}

.level-test-wizard-footer {
    position: relative;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.65rem;
}

.level-test-wizard-footer[hidden] {
    display: none;
}

.level-test-wizard-fixed-summary {
    width: min(100%, 760px);
    margin: 0 auto;
    display: grid;
    gap: 0.55rem;
}

.level-test-wizard-fixed-summary .level-test-application-intro {
    margin: 0;
    padding: 0.65rem 0.8rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

.level-test-wizard-fixed-summary .level-test-application-intro-sub {
    margin-top: 0.2rem;
    font-size: 0.8rem;
}

.level-test-wizard-fixed-summary .giftishow-benefit-view {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 9px;
    margin: 0;
    padding: 7px 10px;
}

.level-test-wizard-fixed-summary .giftishow-benefit-visual {
    width: 46px;
    height: 46px;
}

.level-test-wizard-fixed-summary .giftishow-benefit-message {
    font-size: 0.84rem;
}

.level-test-wizard-footer-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.level-test-wizard-footer-actions > [hidden] {
    display: none !important;
}

.level-test-web-only-notice {
    margin: 0.85rem 0 0;
    padding: 0.8rem 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.5;
}

.level-test-web-only-notice[hidden] {
    display: none;
}

.level-test-date-note {
    display: none;
    margin: 0.5rem 0 0;
    color: #b45309;
    font-size: 0.8rem;
}

.level-test-booking-group {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: #f8fafc;
    color: #1f2937;
}

.level-test-mode-field {
    display: grid;
    grid-template-columns: minmax(190px, max-content) minmax(180px, 1fr);
    align-items: end;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(55, 65, 81, 0.22);
}

.level-test-field-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 800;
}

.level-test-mode-note {
    color: #374151;
    font-size: 0.82rem;
    line-height: 1.4;
}

.level-test-schedule-fields {
    display: flex;
    gap: 1rem;
}

.level-test-schedule-field {
    flex: 1;
    min-width: 0;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-booking-group {
    background: var(--bg-soft);
    color: #f8fafc;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-field-label {
    color: #f8fafc;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-mode-field {
    border-bottom-color: rgba(255, 255, 255, 0.25);
}

html[data-theme="dark"] #levelTestStickerModal .level-test-mode-note {
    color: #e5e7eb;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-booking-group select {
    background: #111827 !important;
    color: #f8fafc !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-heading h4,
html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-guide-title {
    color: #f8fafc;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-guide-emphasis {
    color: #f87171;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-heading p,
html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-install-instruction,
html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-scan-instruction {
    color: #d1d5db;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-back {
    border-color: #64748b;
    background: #172033;
    color: #e5e7eb;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-progress button {
    background: #172033;
    color: #cbd5e1;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-progress button.is-current,
html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-progress button.is-complete {
    background: #059669;
    color: #ffffff;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-note {
    border-color: #0ea5e9;
    background: #0c2c3b;
    color: #bae6fd;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-wizard-sync-highlight {
    border-color: #059669;
    background: #052e2b;
    color: #a7f3d0;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-web-only-notice {
    border-color: #b45309;
    background: #3a290e;
    color: #fde68a;
}

.level-test-slots-group {
    margin: 0 0 1.25rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
}

.level-test-slots-legend {
    padding: 0 0.6rem;
    color: #111827;
    font-size: 0.9rem;
    font-weight: 400;
}

#levelTestStickerModal #levelTestSlotsMessage {
    color: #111827 !important;
    font-weight: 400;
}

html[data-theme="dark"] #levelTestStickerModal #levelTestSlotsMessage {
    color: #c7d2fe !important;
}

.level-test-application-footer {
    position: relative;
    flex: 0 0 auto;
    margin: 0 -1.5rem -1.5rem;
    padding: 0.8rem 1.5rem calc(0.8rem + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), #ffffff 42%);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.12);
    z-index: 12;
}

.level-test-application-submit {
    width: min(100%, 280px);
    min-height: 42px;
    padding: 0.68rem 1.1rem;
    border-radius: 9px;
    font-size: 0.94rem;
    font-weight: 800;
}

.level-test-slot-card {
    min-width: 74px;
    min-height: 40px;
    padding: 0.5rem 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: #e5e7eb;
    color: #111827;
    box-shadow: none;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.level-test-slot-card:hover:not(.is-selected) {
    background: #d1d5db;
    color: #111827;
    transform: translateY(-1px);
}

.level-test-slot-card:focus-visible {
    outline: 3px solid rgba(16, 185, 129, 0.3);
    outline-offset: 2px;
}

.level-test-slot-card.is-selected,
.level-test-slot-card[aria-pressed="true"] {
    background: #86efac;
    color: #111827;
    box-shadow: none;
}

.level-test-slot-card:disabled {
    background: #f1f5f9;
    color: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-application-footer {
    border-top-color: rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, rgba(15, 27, 49, 0.96), #0f1b31 42%);
    box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .level-test-slot-card:not(.is-selected) {
    background: #cbd5e1;
    color: #111827;
    box-shadow: none;
}

html[data-theme="dark"] .level-test-slot-card:hover:not(.is-selected) {
    background: #e2e8f0;
    color: #111827;
}

html[data-theme="dark"] .level-test-slot-card.is-selected,
html[data-theme="dark"] .level-test-slot-card[aria-pressed="true"] {
    background: #34d399;
    color: #052e16;
    box-shadow: none;
}

html[data-theme="dark"] #levelTestStickerModal .level-test-slots-legend {
    color: #f8fafc;
    font-weight: 400;
}

html[data-theme="dark"] #levelTestStickerModal #levelTestSlotsMessage {
    color: #f8fafc !important;
}

@media (max-width: 768px) {
    #levelTestStickerModal .level-test-application-modal {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
        border-radius: 14px !important;
    }

    .level-test-application-content {
        padding: 1rem !important;
    }

    .level-test-application-intro {
        margin-bottom: 0.85rem;
        padding: 0.8rem 0.85rem;
        font-size: 0.92rem;
    }

    .level-test-application-intro-sub {
        font-size: 0.82rem;
    }

    .level-test-wizard-progress {
        margin: 0.85rem 0 0;
    }

    .level-test-wizard-guide-title {
        font-size: 1.35rem;
        line-height: 1.35;
    }

    .level-test-wizard-heading {
        margin-bottom: 1rem;
        gap: 0.65rem;
    }

    .level-test-wizard-heading h4 {
        font-size: 1.3rem;
    }

    .level-test-wizard-heading p {
        font-size: 0.84rem;
    }

    #levelTestStickerModal .level-test-wizard-install-layout,
    #levelTestStickerModal .level-test-wizard-sync-layout {
        grid-template-columns: clamp(96px, 31vw, 120px) minmax(0, 1fr);
        align-items: start;
        gap: 0.75rem;
    }

    #levelTestStickerModal .level-test-wizard-install-layout {
        display: grid !important;
    }

    #levelTestStickerModal .level-test-wizard-download-qr {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1;
        margin: 0;
        padding: 6px !important;
    }

    .level-test-wizard-install-copy {
        width: 100% !important;
    }

    .level-test-wizard-install-copy .mobile-app-step-actions {
        justify-content: flex-start;
    }

    .level-test-wizard-sync-qr {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .level-test-wizard-sync-qr-column {
        width: 100%;
        align-items: flex-start;
    }

    .level-test-wizard-sync-qr img,
    .level-test-wizard-sync-qr canvas {
        max-width: 100% !important;
        max-height: 100% !important;
    }

    .level-test-wizard-qr-status {
        width: max-content;
        max-width: 100%;
        margin: 0.35rem auto 0;
        font-size: 0.72rem;
        text-align: center;
    }

    .level-test-wizard-note,
    .level-test-wizard-sync-highlight {
        padding: 0.65rem;
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .level-test-wizard-video-panel {
        width: 100%;
    }

    .level-test-wizard-shared-video {
        margin-top: 1rem;
    }

    .level-test-wizard-actions {
        margin-top: 1rem;
    }

    .level-test-wizard-next,
    .level-test-wizard-back {
        min-height: 44px;
    }

    .level-test-wizard-footer {
        gap: 0.5rem;
    }

    .level-test-wizard-fixed-summary {
        gap: 0.4rem;
    }

    .level-test-wizard-fixed-summary .level-test-application-intro {
        padding: 0.55rem 0.65rem;
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .level-test-wizard-fixed-summary .level-test-application-intro-sub {
        font-size: 0.75rem;
    }

    .level-test-wizard-fixed-summary .giftishow-benefit-view {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 8px;
        padding: 6px 8px;
    }

    .level-test-wizard-fixed-summary .giftishow-benefit-visual {
        width: 40px;
        height: 40px;
    }

    .level-test-wizard-fixed-summary .giftishow-benefit-message {
        font-size: 0.78rem;
    }

    .level-test-schedule-fields {
        flex-direction: row;
        gap: 0.65rem;
    }

    .level-test-mode-field {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .level-test-application-footer {
        margin: 0 -1rem -1rem;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    }

    .level-test-application-submit {
        max-width: 240px;
    }
}

/* Simple level test modal */
#simpleLevelTestModal .simple-leveltest-panel,
#simpleLevelTestModal .simple-leveltest-content,
#simpleLevelTestModal .simple-leveltest-stage,
#simpleLevelTestModal .simple-leveltest-question {
    min-width: 0;
}

#simpleLevelTestModal .simple-leveltest-close {
    min-width: 44px;
    min-height: 44px;
}

#simpleLevelTestModal .simple-leveltest-chip {
    max-width: 100%;
    overflow-wrap: anywhere;
}

#simpleLevelTestModal .simple-leveltest-action {
    min-height: 44px;
}

#simpleLevelTestModal .simple-leveltest-feedback-layer {
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 6.5rem;
    z-index: 4;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

#simpleLevelTestModal .simple-leveltest-feedback {
    box-sizing: border-box;
}

#simpleLevelTestModal .simple-leveltest-cover,
#simpleLevelTestModal .simple-leveltest-cover-placeholder {
    flex: 0 0 120px;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-panel,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-content {
    background: #141f36 !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-header {
    background: #111c32 !important;
    border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-close {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-status-card,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-result-summary,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-recommendation,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-workspace {
    background: #1c2942 !important;
    background-image: none !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-status-card--loading .simple-leveltest-status-title {
    color: #fcd34d !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-status-card--loading .simple-leveltest-status-message {
    color: #fde68a !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-status-card--error .simple-leveltest-status-title,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-status-card--error .simple-leveltest-status-message,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-result-message--error {
    color: #fca5a5 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-result-title,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-result-range,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-recommendation-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-result-copy,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-recommendation-copy,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-result-message {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-result-guide {
    background: #132a4a !important;
    background-image: none !important;
    border-color: #3b82f6 !important;
    color: #dbeafe !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-recommendation-level {
    background: #243358 !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-cover,
html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-cover-placeholder {
    border-color: #64748b !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-cover-placeholder {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-recommendation-button--select {
    background: #243358 !important;
    border-color: #94a3b8 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-recommendation-button--preview {
    background: #2563eb !important;
    color: #ffffff !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-instruction {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-prompt {
    background: #0b1326 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-answer-hint {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-chip {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #111827 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-controls {
    background: #111c32 !important;
    border-top-color: rgba(148, 163, 184, 0.26) !important;
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-action--hard {
    background: #243553 !important;
    border-color: #64748b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-action--check {
    background: #2563eb !important;
    color: #ffffff !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-feedback--success {
    background: rgba(34, 197, 94, 0.16) !important;
    border-color: #22c55e !important;
    color: #bbf7d0 !important;
}

html[data-theme="dark"] #simpleLevelTestModal .simple-leveltest-feedback--error {
    background: rgba(248, 113, 113, 0.16) !important;
    border-color: #f87171 !important;
    color: #fecaca !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-direct-textbook-card {
    background: #28234d !important;
    background-image: none !important;
    border-color: #8b5cf6 !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-direct-textbook-hint {
    color: #ede9fe !important;
}

@media (max-width: 768px) {
    #simpleLevelTestModal {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
    }

    #simpleLevelTestModal .simple-leveltest-panel {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        transform: none !important;
    }

    #simpleLevelTestModal .simple-leveltest-header {
        padding: calc(0.85rem + env(safe-area-inset-top)) 1rem 0.85rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-title {
        font-size: 1.08rem !important;
        line-height: 1.35;
    }

    #simpleLevelTestModal .simple-leveltest-content {
        min-height: 0 !important;
        padding: 1rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-question {
        padding-bottom: 5.8rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-instruction {
        margin-bottom: 0.75rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-prompt {
        margin-bottom: 0.9rem !important;
        padding: 0.85rem 1rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-workspace {
        padding: 0.85rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-answer-area {
        min-height: clamp(190px, 34vh, 280px) !important;
        padding: 0.55rem 0.7rem 1rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-word-bank {
        min-height: 90px !important;
        margin-top: 0.9rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-controls {
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)) !important;
    }

    #simpleLevelTestModal .simple-leveltest-feedback-layer {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(5rem + env(safe-area-inset-bottom));
    }

    #simpleLevelTestModal .simple-leveltest-controls-inner {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-action {
        width: 100%;
        min-width: 0;
        padding: 0.72rem 0.75rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-recommendation {
        align-items: stretch !important;
        flex-direction: column;
        gap: 1rem !important;
    }

    #simpleLevelTestModal .simple-leveltest-recommendation-actions {
        justify-content: flex-end;
    }
}

/* Enrollment start-date calendar */
#orderStickerModalContent .order-start-calendar {
    background: #ffffff;
}

#orderStickerModalContent .order-start-calendar-weekday {
    min-width: 0;
    padding: 0.4rem 0.2rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
}

#orderStickerModalContent .order-start-calendar-weekday.is-sunday {
    color: #dc2626;
}

#orderStickerModalContent .order-start-calendar-weekday.is-saturday {
    color: #2563eb;
}

#orderStickerModalContent .order-start-calendar-day {
    min-width: 0;
    min-height: 38px;
    padding: 0.35rem 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
    user-select: none;
}

#orderStickerModalContent .order-start-calendar-day.is-disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.72;
}

#orderStickerModalContent .order-start-calendar-day.is-holiday {
    color: #dc2626;
    text-decoration: line-through;
}

#orderStickerModalContent .order-start-calendar-day.is-available {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    font-weight: 800;
}

#orderStickerModalContent .order-start-calendar-day.is-available.is-sunday {
    color: #dc2626;
}

#orderStickerModalContent .order-start-calendar-day.is-available.is-saturday {
    color: #2563eb;
}

#orderStickerModalContent .order-start-calendar-day.is-available:hover,
#orderStickerModalContent .order-start-calendar-day.is-available:focus-visible {
    border-color: #60a5fa;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
    outline: none;
    transform: translateY(-1px);
}

#orderStickerModalContent .order-start-calendar-day.is-today:not(.is-selected) {
    border-color: #10b981;
    background: #ecfdf5;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.16);
}

#orderStickerModalContent .order-start-calendar-day.is-selected {
    border-color: #1d4ed8;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22), 0 4px 10px rgba(30, 64, 175, 0.2);
    opacity: 1;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar {
    border-color: rgba(148, 163, 184, 0.28) !important;
    background: #111c32 !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-weekday {
    color: #aebad0 !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-weekday.is-sunday {
    color: #fda4af !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-weekday.is-saturday {
    color: #93c5fd !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-day.is-disabled {
    border-color: transparent !important;
    background: transparent !important;
    color: #63718a !important;
    box-shadow: none !important;
    opacity: 0.68;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-day.is-holiday {
    border-color: rgba(251, 113, 133, 0.2) !important;
    background: rgba(190, 24, 93, 0.1) !important;
    color: #fb7185 !important;
    opacity: 0.82;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-day.is-available {
    border-color: #52698d !important;
    background: #243653 !important;
    color: #f8fafc !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24) !important;
    opacity: 1;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-day.is-available.is-sunday {
    color: #fda4af !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-day.is-available.is-saturday {
    color: #93c5fd !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-day.is-available:hover,
html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-day.is-available:focus-visible {
    border-color: #60a5fa !important;
    background: #2a466b !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.24) !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-day.is-today:not(.is-selected) {
    border-color: #34d399 !important;
    background: #173f3d !important;
    color: #d1fae5 !important;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2) !important;
}

html[data-theme="dark"] #orderStickerModalContent .order-start-calendar-day.is-selected {
    border-color: #93c5fd !important;
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.28), 0 5px 12px rgba(0, 0, 0, 0.32) !important;
    opacity: 1;
}

@media (max-width: 768px) {
    #tossMethodModal {
        align-items: stretch !important;
        padding: 0 !important;
    }

    #tossMethodModal .toss-method-modal-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        overscroll-behavior: contain;
    }
}

/* Mypage modal QA contracts: bounded desktop content, fullscreen mobile flows,
   and explicit dark palettes for legacy inline-rendered dialogs. */
.date-class-list-modal {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 1rem;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.24);
    box-sizing: border-box;
}

/* Shared accessible contrast for light and dark modal surfaces. */
.leveltest-method-step-number {
    background: #047857 !important;
    color: #ffffff !important;
}

:is(
    .orders-analytics-submit,
    .ai-token-point-submit,
    .inline-confirm-yes,
    .level-test-application-submit,
    #orderSubmitBtnModal
) {
    background: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

.orders-analytics-card-meta-label {
    color: #64748b;
}

html[data-theme="dark"] .orders-analytics-card-meta-label {
    color: #cbd5e1;
}

.cash-receipt-modal :is(.cash-receipt-close, .cash-receipt-subtitle) {
    color: #475569 !important;
}

.student-refund-policy-link {
    background: #166534 !important;
    color: #ffffff !important;
}

.ai-token-modal-close,
.ai-token-intro-modal [style*="color: #6b7280"] {
    color: #4b5563 !important;
}

.app-uid-empty,
.simple-leveltest-answer-hint,
.simple-leveltest-close,
.chat-category-divider-label,
.teacher-slot-voice-empty,
.subtitle-history-empty,
.counsel-attachment-empty,
.class-detail-loading {
    color: #64748b !important;
}

.class-detail-current-item-title {
    color: #475569 !important;
}

.class-action-count-note {
    color: #64748b !important;
}

.subtitle-history-empty {
    color: #475569 !important;
}

.chat-popup-translate-label {
    color: #b91c1c;
}

html[data-theme="dark"] .chat-category-divider-label {
    color: #cbd5e1 !important;
}

.chat-popup-translate-label input[type="checkbox"] {
    accent-color: #b91c1c;
}

.class-feedback-coupon-label {
    background: #b45309 !important;
    color: #ffffff !important;
}

#chapterPreviewModal .preview-item-btn:not(.is-selected) .item-number {
    color: #4338ca !important;
}

#chapterPreviewModal .preview-item-btn:not(.is-selected) .item-level {
    color: #64748b !important;
}

html[data-theme="dark"] #chapterPreviewModal .preview-item-btn:not(.is-selected) .item-number {
    color: #a5b4fc !important;
}

html[data-theme="dark"] #chapterPreviewModal .preview-item-btn:not(.is-selected) .item-level {
    color: #cbd5e1 !important;
}

#orderStickerModal .order-period-discount {
    color: #b91c1c !important;
}

#orderStickerModal .is-selected .order-period-discount {
    color: #ffffff !important;
}

#orderStickerModal [style*="color: #6b7280"] {
    color: #4b5563 !important;
}

#orderStickerModal [style*="color: #9ca3af"] {
    color: #64748b !important;
}

#orderStickerModal [style*="color: var(--text-muted)"] {
    color: #64748b !important;
}

html[data-theme="dark"] .app-uid-empty {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #orderStickerModal [style*="color: var(--text-muted)"],
html[data-theme="dark"] #orderStickerModal #orderModalPriceLabel {
    color: #cbd5e1 !important;
}

#previewLessonContent [style*="color: #94a3b8"] {
    color: #64748b !important;
}

html[data-theme="dark"] #previewLessonContent [style*="color: #94a3b8"] {
    color: #cbd5e1 !important;
}

.date-class-list-modal .modal-close {
    color: #374151 !important;
}

html[data-theme="dark"] .date-class-list-modal .modal-close {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .learning-grammar-audio-status {
    color: #cbd5e1 !important;
}

.flexible-add-selected-date {
    color: #475569 !important;
}

.flexible-add-selected-date.is-error {
    color: #b91c1c !important;
}

#flexibleAddModalOverlay .flexible-add-period {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

#flexibleAddModalOverlay .flexible-add-period.is-selected {
    background: #bfdbfe !important;
    color: #1e40af !important;
}

#counselDetailModal .counsel-detail-meta {
    color: #475569 !important;
}

#counselDetailModal .counsel-detail-status {
    color: #ffffff !important;
}

#stickerConfirmModal [data-i18n="delete"] {
    color: #b91c1c !important;
}

html[data-theme="dark"] .flexible-add-modal {
    background: #141f36 !important;
    border-color: #475569 !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] .flexible-add-modal [style*="background: #ffffff"],
html[data-theme="dark"] .flexible-add-modal [style*="background: #f8fafc"] {
    background: #1c2942 !important;
    border-color: #475569 !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] .flexible-add-modal [style*="background: #eef2ff"] {
    background: #16243f !important;
    border-color: #475569 !important;
    color: #dbeafe !important;
}

html[data-theme="dark"] .flexible-add-modal :is(
    [style*="color: #4338ca"],
    [style*="color: #475569"],
    [style*="color: #334155"],
    [style*="color: #64748b"]
) {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .flexible-add-modal select {
    background: #111827 !important;
    border-color: #64748b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] #flexibleAddModalOverlay .flexible-add-period {
    background: #273754 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #flexibleAddModalOverlay .flexible-add-period.is-selected {
    background: #1e3a5f !important;
    color: #dbeafe !important;
}

html[data-theme="dark"] .flexible-add-selected-date.is-error {
    color: #fda4af !important;
}

html[data-theme="dark"] #counselDetailModal .counsel-detail-meta {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #counselDetailHeader {
    background: #16243f !important;
    border-bottom-color: #475569 !important;
}

html[data-theme="dark"] #counselDetailModal .counsel-detail-title,
html[data-theme="dark"] #counselDetailModal .counsel-detail-message {
    color: #f8fafc !important;
}

html[data-theme="dark"] #counselDetailModal .counsel-detail-close {
    background: #273754 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] #counselDetailBody {
    background: #111c32 !important;
}

html[data-theme="dark"] #counselDetailModal .counsel-detail-bubble {
    background: #252f49 !important;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] #counselDetailModal .counsel-detail-bubble.is-admin {
    background: #15314a !important;
}

html[data-theme="dark"] #counselDetailModal .counsel-detail-category-badge {
    background: rgba(129, 140, 248, 0.2) !important;
    color: #c7d2fe !important;
}

html[data-theme="dark"] #counselDetailModal .counsel-detail-footer {
    background: #141f36 !important;
    border-top-color: #475569 !important;
}

html[data-theme="dark"] #passwordChangeAlertOverlay .password-change-alert-card {
    background: #1c2942 !important;
    border: 1px solid #475569;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] #passwordChangeAlertOverlay .password-change-alert-header,
html[data-theme="dark"] #passwordChangeAlertOverlay .password-change-alert-message {
    border-color: #475569 !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] #passwordChangeAlertOverlay .password-change-alert-footer {
    background: #16243f !important;
    border-top-color: #475569 !important;
}

html[data-theme="dark"] #levelTestDetailModal .level-test-detail-schedule {
    background: #3b2c18 !important;
    background-image: none !important;
    border-color: #d97706 !important;
}

html[data-theme="dark"] #levelTestDetailModal .level-test-detail-schedule-label,
html[data-theme="dark"] #levelTestDetailModal .level-test-detail-schedule-teacher {
    color: #fde68a !important;
}

html[data-theme="dark"] #levelTestDetailModal .level-test-detail-schedule-value {
    color: #fef3c7 !important;
}

html[data-theme="dark"] #stickerConfirmModal .modal {
    background: #1c2942 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] #stickerConfirmModal :is(h3, p) {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] #stickerConfirmModal [data-i18n="delete"] {
    background: rgba(185, 28, 28, 0.18) !important;
    color: #fecaca !important;
}

#orderStickerModalContent .order-start-calendar-day.is-disabled {
    color: #64748b;
    opacity: 0.78;
}

#modalOverlay[data-mobile-layout="fullscreen"] {
    padding: 16px;
    overflow: hidden;
    box-sizing: border-box;
}

#modalOverlay[data-mobile-layout="fullscreen"] #modalContent {
    max-height: calc(100dvh - 32px);
}

#modalOverlay[data-mobile-layout="fullscreen"] #modalContent > div {
    max-height: calc(100dvh - 32px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    box-sizing: border-box;
}

.shared-modal-bottom-sheet-handle {
    display: none;
}

@keyframes shared-modal-bottom-sheet-in {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes shared-modal-bottom-sheet-out {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

html[data-theme="dark"] .leveltest-method-modal {
    background: #111c32 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .leveltest-method-body {
    color: #e6ebf4 !important;
}

html[data-theme="dark"] .leveltest-method-step {
    background: #1c2942 !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

html[data-theme="dark"] .leveltest-method-step strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] .leveltest-method-step-copy {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .leveltest-method-step-number {
    background: #047857 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .leveltest-method-tip {
    background: #123a34 !important;
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #d1fae5 !important;
}

html[data-theme="dark"] .cash-receipt-modal {
    background: #141f36 !important;
    border-color: rgba(148, 163, 184, 0.26) !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] .cash-receipt-modal [style*="background:#f8fafc"],
html[data-theme="dark"] .cash-receipt-modal [style*="background: #f8fafc"],
html[data-theme="dark"] .cash-receipt-modal [style*="background:#ffffff"],
html[data-theme="dark"] .cash-receipt-modal [style*="background: #ffffff"] {
    background: #1c2942 !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
}

html[data-theme="dark"] .cash-receipt-modal [style*="color:#0f172a"],
html[data-theme="dark"] .cash-receipt-modal [style*="color: #0f172a"],
html[data-theme="dark"] .cash-receipt-modal [style*="color:var(--text-primary"],
html[data-theme="dark"] .cash-receipt-modal [style*="color: var(--text-primary"] {
    color: #f8fafc !important;
}

html[data-theme="dark"] .cash-receipt-modal [style*="color:#64748b"],
html[data-theme="dark"] .cash-receipt-modal [style*="color: #64748b"],
html[data-theme="dark"] .cash-receipt-modal [style*="color:var(--text-muted"],
html[data-theme="dark"] .cash-receipt-modal [style*="color: var(--text-muted"] {
    color: #b6c2d7 !important;
}

html[data-theme="dark"] .cash-receipt-modal [style*="background:#fff7ed"] {
    background: #3b2417 !important;
    color: #fed7aa !important;
}

html[data-theme="dark"] .ai-token-purchase-modal,
html[data-theme="dark"] .ai-token-intro-modal {
    background: #141f36 !important;
    color: #e6ebf4 !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
}

html[data-theme="dark"] :is(.ai-token-purchase-modal, .ai-token-intro-modal)
    :is(h2, h3, p, label, li, div)[style*="color: #1f2937"],
html[data-theme="dark"] :is(.ai-token-purchase-modal, .ai-token-intro-modal)
    :is(h2, h3, p, label, li, div)[style*="color:#1f2937"],
html[data-theme="dark"] :is(.ai-token-purchase-modal, .ai-token-intro-modal)
    [style*="color: #374151"],
html[data-theme="dark"] :is(.ai-token-purchase-modal, .ai-token-intro-modal)
    [style*="color:#374151"] {
    color: #f8fafc !important;
}

html[data-theme="dark"] :is(.ai-token-purchase-modal, .ai-token-intro-modal)
    [style*="color: #4b5563"],
html[data-theme="dark"] :is(.ai-token-purchase-modal, .ai-token-intro-modal)
    [style*="color:#4b5563"],
html[data-theme="dark"] :is(.ai-token-purchase-modal, .ai-token-intro-modal)
    [style*="color: #6b7280"] {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .ai-token-purchase-modal .token-card,
html[data-theme="dark"] .ai-token-intro-modal [style*="background: #f9fafb"],
html[data-theme="dark"] .ai-token-intro-modal [style*="background: #f3f4f6"] {
    background: #1c2942 !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

html[data-theme="dark"] .ai-token-intro-modal .token-compare-row > div {
    border-color: rgba(148, 163, 184, 0.24) !important;
}

html[data-theme="dark"] .ai-token-intro-modal #tokenAmountSelect {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}

html[data-theme="dark"] .student-permission-modal {
    background: #141f36 !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] .student-permission-modal [style*="color:#0f172a"],
html[data-theme="dark"] .student-permission-modal [style*="color: #0f172a"] {
    color: #f8fafc !important;
}

html[data-theme="dark"] .student-permission-modal [style*="color:#475569"],
html[data-theme="dark"] .student-permission-modal [style*="color: #475569"],
html[data-theme="dark"] .student-permission-modal [style*="color:#64748b"] {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .student-permission-modal [style*="background:#f8fafc"],
html[data-theme="dark"] .student-permission-modal [style*="background: #f8fafc"] {
    background: #1c2942 !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

html[data-theme="dark"] .student-permission-modal [style*="color:#2563eb"] {
    color: #93c5fd !important;
}

html[data-theme="dark"] .student-permission-modal [style*="background:#e2e8f0"] {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .leveltest-ai-section-title,
html[data-theme="dark"] .leveltest-ai-section-body,
html[data-theme="dark"] .leveltest-score-list {
    color: #fed7aa !important;
}

html[data-theme="dark"] .leveltest-diff {
    background: rgba(248, 113, 113, 0.16) !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .leveltest-delete-diff {
    background: rgba(96, 165, 250, 0.16) !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] #chapterPreviewModal .chapter-preview-category-badge {
    background: #15345b !important;
    color: #bfdbfe !important;
}

html[data-theme="dark"] #chapterPreviewModal .chapter-preview-level-badge {
    background: #3b2d12 !important;
    color: #fde68a !important;
}

html[data-theme="dark"] #chapterPreviewModal .chapter-preview-item-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .profile-image-preview-panel {
    background: #141f36 !important;
    border: 1px solid rgba(148, 163, 184, 0.26) !important;
}

html[data-theme="dark"] .profile-image-preview-panel > div:first-child {
    border-bottom-color: rgba(148, 163, 184, 0.24) !important;
}

html[data-theme="dark"] .app-sync-step-label {
    color: #f8fafc !important;
}

html[data-theme="dark"] .orders-analytics-card-meta {
    color: #93c5fd !important;
}

html[data-theme="dark"] :is(
    .orders-analytics-submit,
    .ai-token-point-submit,
    .inline-confirm-yes,
    .level-test-application-submit,
    #orderSubmitBtnModal
) {
    background: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .student-refund-policy-link {
    background: #166534 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .chat-popup-translate-label {
    color: #e6ebf4 !important;
}

#chatPopup :is(.list-item-badge, .chat-popup-item-badge) {
    background: #dc2626 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] #orderStickerModal .order-period-discount {
    color: #fca5a5 !important;
}

html[data-theme="dark"] .class-time-change-days-helper {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] :is(.floating-chat-badge, .chat-badge) {
    background: #b91c1c !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .receipt-container [style*="background: #f9fafb"] {
    background: #f9fafb !important;
    color: #1f2937 !important;
}

html[data-theme="dark"] #subtitleHistoryModal {
    background: #111c32 !important;
    border: 1px solid rgba(148, 163, 184, 0.32) !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-body {
    background: #101a2f !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-list {
    scrollbar-color: #38bdf8 #111c32 !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-list::-webkit-scrollbar-track,
html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-tabs {
    background: #111c32 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-tab {
    background: #1c2942 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-tab.active {
    background: #4f46e5 !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-empty {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-item,
html[data-theme="dark"] #subtitleHistoryModal .subtitle-review-section,
html[data-theme="dark"] #subtitleHistoryModal .subtitle-word-card {
    background: #1c2942 !important;
    border-color: #475569 !important;
    color: #e6ebf4 !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-item.subtitle-history-item-student {
    background: #173b5f !important;
    border-color: #3b82f6 !important;
}

html[data-theme="dark"] #subtitleHistoryModal :is(
    .subtitle-history-source,
    .subtitle-dialog-cn,
    .subtitle-word-meaning,
    .subtitle-review-main
) {
    color: #f8fafc !important;
}

html[data-theme="dark"] #subtitleHistoryModal :is(
    .subtitle-history-meta,
    .subtitle-history-time,
    .subtitle-history-pronunciation,
    .subtitle-dialog-pinyin,
    .subtitle-word-pinyin,
    .subtitle-review-label,
    .subtitle-review-sub,
    .subtitle-review-lecture-status
) {
    color: #aebad0 !important;
}

html[data-theme="dark"] #subtitleHistoryModal :is(
    .subtitle-history-translation,
    .subtitle-review-grammar
) {
    color: #dbeafe !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-history-addition {
    background: #3b2f13 !important;
    border-color: #a16207 !important;
    color: #fde68a !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-dialog-translation {
    background: #16243f !important;
    color: #dbeafe !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-grammar-box {
    background: #16243f !important;
    border-color: #475569 !important;
    color: #e6ebf4 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-grammar-box :is(strong, h1, h2, h3) {
    color: #f8fafc !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-grammar-box code {
    background: #273754 !important;
    color: #e6ebf4 !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-review-lecture-player {
    background: #123a34 !important;
    border-color: #047857 !important;
}

html[data-theme="dark"] #subtitleHistoryModal .subtitle-review-lecture-time {
    color: #a7f3d0 !important;
}

@media (max-width: 768px) {
    #flexibleAddModalOverlay {
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    #flexibleAddModalOverlay .flexible-add-modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-width: 0 !important;
        border-radius: 0 !important;
    }

    #fixedTextbookSelectorOverlay {
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    #fixedTextbookSelectorOverlay .fixed-textbook-selector-modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-width: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        box-sizing: border-box;
    }

    #fixedTextbookSelectorOverlay #fixedTextbookSelectorHeader {
        border-radius: 0 !important;
    }

    #subtitleHistoryModal .subtitle-history-tabs {
        width: 100%;
        min-width: 0;
        display: flex !important;
        grid-template-columns: none !important;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
        box-sizing: border-box;
    }

    #subtitleHistoryModal .subtitle-history-tab {
        flex: 0 0 auto;
        min-width: max-content;
    }

    #modalOverlay[data-mobile-layout="fullscreen"] {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
    }

    #modalOverlay[data-mobile-layout="fullscreen"] #modalContent {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        overflow: hidden !important;
        transform: none !important;
    }

    #modalOverlay[data-mobile-layout="fullscreen"] #modalContent > div {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 0 !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        transform: none !important;
    }

    #modalOverlay[data-mobile-layout="fullscreen"] .date-class-list-modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-width: 0 !important;
        border-radius: 0 !important;
        padding: 1rem !important;
    }

    #modalOverlay[data-mobile-layout="bottom-sheet"] {
        align-items: flex-end !important;
        justify-content: stretch !important;
        padding: 0 !important;
        overflow: hidden;
    }

    #modalOverlay[data-mobile-layout="bottom-sheet"] #modalContent {
        position: fixed !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: min(88dvh, 760px) !important;
        margin: 0 !important;
        overflow: visible !important;
        transform: none !important;
    }

    #modalOverlay[data-mobile-layout="bottom-sheet"] #modalContent > div {
        width: 100% !important;
        max-width: none !important;
        max-height: min(88dvh, 760px) !important;
        margin: 0 !important;
        border-radius: 24px 24px 0 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        animation: shared-modal-bottom-sheet-in 280ms cubic-bezier(0.22, 0.8, 0.28, 1) both;
        will-change: transform;
    }

    #modalOverlay[data-mobile-layout="bottom-sheet"].is-closing {
        pointer-events: none !important;
    }

    #modalOverlay[data-mobile-layout="bottom-sheet"].is-closing #modalContent > div {
        animation: shared-modal-bottom-sheet-out 280ms cubic-bezier(0.4, 0, 1, 1) both;
    }

    #modalOverlay[data-mobile-layout="bottom-sheet"] .shared-modal-bottom-sheet-handle {
        position: absolute;
        top: 8px;
        left: 50%;
        z-index: 3;
        display: block;
        width: 42px;
        height: 5px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.72);
        transform: translateX(-50%);
    }

    #appUidModal,
    #appSyncModal {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
    }

    #appUidModal > .modal,
    #appSyncModal > .modal {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        transform: none !important;
    }

    #appUidModalContent,
    #appSyncModal .app-sync-modal-shell {
        min-height: 0 !important;
        overflow-y: auto !important;
    }

    #levelTestStickerModal .level-test-application-modal {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        transform: none !important;
    }

    #levelTestStickerModal .level-test-application-content,
    #levelTestStickerModal .level-test-application-form,
    #levelTestStickerModal .level-test-wizard,
    #levelTestStickerModal .level-test-wizard-stage,
    #levelTestStickerModal .level-test-wizard-slide {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    #levelTestStickerModal .level-test-app-video-panel {
        width: 100%;
        min-width: 0;
        max-width: 100% !important;
    }

    #passwordChangeModal,
    #counselComposeOverlay,
    #counselDetailOverlay {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
    }

    #passwordChangeModal .password-sticker-card,
    #counselComposeOverlay #counselComposeModal,
    #counselDetailOverlay #counselDetailModal {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        resize: none !important;
        overflow-y: auto !important;
        transform: none !important;
    }

    #profileImagePreviewOverlay {
        padding: 0 !important;
    }

    #profileImagePreviewOverlay .profile-image-preview-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    #modalOverlay[data-mobile-layout="bottom-sheet"] #modalContent > div,
    #modalOverlay[data-mobile-layout="bottom-sheet"].is-closing #modalContent > div {
        animation: none;
    }
}
