/* =====================================================================
   app-web custom overrides for html/common.css
   - common.css 가 reset / typography / 색·그림자·radius / 버튼·입력·테이블
     / topbar / navbar / footer / stat-card / glass-card / page-hero
     / layout-2col·layout-wide·layout-sidebar 등 공통 시스템을 담당.
   - 본 파일은 화면 단위 위젯과 PC 와이드 보정만 담당.
   ===================================================================== */

:root {
    /* style.css 잔존 호환 변수 (common.css 와 매핑) */
    --bg:          var(--bg-body);
    --bg-subtle:   var(--bg-surface);
    --primary-dim: var(--primary-light);
}

/* =====================================================================
   GLOBAL FRAME — 스크롤 시 navbar / topbar 변형
   (app.js 의 setupScrollEvents 가 #siteHeader / #headerTop 에 클래스 부여)
   ===================================================================== */
.navbar.is-scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    border-bottom-color: rgba(99, 102, 241, 0.12);
}

.topbar { transition: padding var(--transition), background var(--transition); }
.topbar.is-compact { padding: 3px 0; }

/* navbar 의 우측 로그인/로그아웃 보조 버튼 */
.nav-links .btn { padding: 7px 14px; font-size: 13px; }
.nav-links .btn-secondary {
    margin-left: 8px;
    border: 1px solid var(--border);
    background: #fff;
}

/* =====================================================================
   SCREEN SWITCHING
   ===================================================================== */
.screen { display: none; }
.screen.active { display: block; animation: fadeInUp 0.35s ease both; }

/* =====================================================================
   GENERIC CARD — common.css 의 .glass-card 가 메인,
   레거시 .card 도 동일 룩으로 유지 (app.js 가 사용 중)
   ===================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.16);
}
.card-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }

.card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: -0.02em;
}
.card a { color: var(--primary); font-weight: 500; }
.card a:hover { color: var(--primary-hover); }

/* =====================================================================
   LOGIN — PC 중앙 카드형, AI 톤 글로우
   ===================================================================== */
#login.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 220px);
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 40px 36px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 102, 241, 0.08);
    position: relative;
    overflow: hidden;
}
.login-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad-primary);
}
.login-container::after {
    content: '';
    position: absolute;
    top: -120px; right: -80px;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.10) 0%, transparent 70%);
    pointer-events: none;
}

.login-logo { text-align: center; margin-bottom: 32px; position: relative; z-index: 1; }
.login-logo h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}
.login-logo p { color: var(--text-muted); font-size: 14px; }

.error-message {
    background: var(--danger-light);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 13px;
    border: 1px solid #fecaca;
}
.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; }

.form-group { margin-bottom: 18px; position: relative; z-index: 1; }
.form-group label,
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.form-group-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}
.form-group-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
.auto-login-label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-muted);
}

/* =====================================================================
   LOADING / EMPTY / SKELETON / TOAST
   ===================================================================== */
.loading {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
    font-size: 14px;
}
.loading::before {
    content: '';
    display: block;
    width: 32px; height: 32px;
    margin: 0 auto 14px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Skeleton primitives (shimmer placeholder) === */
.skel {
    background: linear-gradient(90deg,
        var(--bg-elevated) 0%,
        var(--border-light) 50%,
        var(--bg-elevated) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: var(--radius);
    color: transparent;
    user-select: none;
}
.skel-line { height: 14px; margin-bottom: 8px; }
.skel-line.short { width: 40%; }
.skel-line.medium { width: 70%; }
.skel-line.long { width: 100%; }
.skel-circle { border-radius: 50%; }
.skel-block { width: 100%; }

/* Course card skeleton */
.skel-course-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px 26px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
}
.skel-course-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--bg-elevated);
}
.skel-tag { width: 80px; height: 18px; border-radius: var(--radius-full); margin-bottom: 14px; }
.skel-title { height: 18px; margin-bottom: 14px; }
.skel-meta-line { height: 12px; margin-bottom: 8px; width: 75%; }
.skel-progress { height: 10px; border-radius: var(--radius-full); margin: 16px 0 18px; }
.skel-button { height: 38px; border-radius: var(--radius); }

/* Notice card skeleton */
.skel-notice-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    display: grid;
    grid-template-columns: 76px 1fr 80px;
    gap: 22px;
    align-items: center;
}
.skel-notice-date { height: 56px; border-radius: var(--radius); }
.skel-notice-content > * { margin-bottom: 8px; }

/* Dashboard mini-row skeleton */
.skel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border-light);
}
.skel-row:last-child { border-bottom: none; }
.skel-row-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.skel-row-text { flex: 1; height: 12px; }
.skel-row-meta { width: 60px; height: 12px; }

/* === Empty state (통일된 형태) === */
.empty-state {
    padding: 60px 24px;
    text-align: center;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-xl);
    color: var(--text-muted);
}
.empty-state-emoji { font-size: 48px; margin-bottom: 14px; opacity: 0.7; }
.empty-state-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.empty-state-desc { font-size: 13px; line-height: 1.6; }
.empty-state-action { margin-top: 18px; }
.empty-state.is-error { border-color: rgba(239, 68, 68, 0.30); background: var(--danger-light); }
.empty-state.is-error .empty-state-title { color: var(--danger); }

/* === Toast notification === */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    box-shadow: var(--shadow-md);
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: toastIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.is-leaving { animation: toastOut 0.2s ease forwards; }
.toast.is-success { border-left-color: var(--success); }
.toast.is-error   { border-left-color: var(--danger); }
.toast.is-warning { border-left-color: var(--accent); }
.toast-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.toast-content { flex: 1; line-height: 1.5; overflow-wrap: anywhere; }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.toast-close:hover { color: var(--text); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(20px); }
}
@media (max-width: 640px) {
    .toast-container { left: 16px; right: 16px; max-width: none; top: 72px; }
}

/* =====================================================================
   DASHBOARD — Welcome hero + 2-col layout (common.css .layout-wide 사용)
   ===================================================================== */
.welcome-hero {
    background: var(--grad-hero);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 44px 48px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.welcome-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad-primary);
}
.welcome-hero::after {
    content: '';
    position: absolute;
    top: -120px; right: -60px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.10) 0%, transparent 70%);
    pointer-events: none;
}
.welcome-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
}
.welcome-text h1 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    color: var(--text);
}
.welcome-text p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 640px;
}
.welcome-meta { text-align: right; flex-shrink: 0; }
.welcome-date {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}
.welcome-day { font-size: 13px; color: var(--text-muted); }

/* ===== Welcome hero richer pieces ===== */
.welcome-greeting-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
    letter-spacing: -0.01em;
}
.streak-badge .flame {
    font-size: 15px;
    animation: float 2.4s ease-in-out infinite;
}
.welcome-ai-greeting {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(99, 102, 241, 0.10);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.welcome-ai-avatar {
    width: 36px; height: 36px;
    border-radius: 12px;
    background: var(--grad-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.welcome-ai-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}
.welcome-ai-text strong { color: var(--primary); font-weight: 700; }

/* ===== Dashboard mini grid (활동 + 인사이트 + 추천 등 가로 배치) ===== */
.dashboard-mini-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}
@media (max-width: 1024px) { .dashboard-mini-grid { grid-template-columns: 1fr; } }

/* ===== Activity heatmap (주간 학습 활동) ===== */
.activity-heatmap {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.activity-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    cursor: default;
    min-height: 64px;
}
.activity-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    z-index: 2;
}
.activity-cell.is-today {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.20);
}
.activity-cell.is-present {
    background: linear-gradient(135deg, #10b981, #34d399);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.22);
}
.activity-cell.is-late {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.22);
}
.activity-cell.is-absent {
    background: linear-gradient(135deg, #ef4444, #f87171);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.22);
}
.activity-cell.is-future {
    background: var(--bg-surface);
    border-style: dashed;
}
.activity-day-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0.75;
    text-transform: uppercase;
}
.activity-day-num {
    font-size: 16px;
    font-weight: 800;
    margin-top: 2px;
    letter-spacing: -0.02em;
}
.activity-cell.is-present .activity-day-label,
.activity-cell.is-late .activity-day-label,
.activity-cell.is-absent .activity-day-label {
    opacity: 0.95;
}
.activity-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}
.activity-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.activity-legend i {
    width: 10px; height: 10px;
    border-radius: 3px;
    display: inline-block;
}
.activity-legend i.dot-present { background: linear-gradient(135deg, #10b981, #34d399); }
.activity-legend i.dot-late    { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.activity-legend i.dot-absent  { background: linear-gradient(135deg, #ef4444, #f87171); }
.activity-legend i.dot-none    { background: var(--bg-elevated); border: 1px solid var(--border); }

/* ===== AI 인사이트 카드 ===== */
.insight-card {
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(6, 182, 212, 0.04)),
        var(--bg-card);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--radius-xl);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
}
.insight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-cool);
}
.insight-card::after {
    content: '';
    position: absolute;
    top: -60px; right: -40px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.10) 0%, transparent 70%);
    pointer-events: none;
}
.insight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}
.insight-header .icon-orb {
    width: 36px; height: 36px;
    border-radius: 12px;
    background: var(--grad-cool);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.30);
}
.insight-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}
.insight-header .ai-dots-mini {
    margin-left: auto;
    display: inline-flex;
    gap: 3px;
}
.insight-header .ai-dots-mini span {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--secondary);
    animation: dotPulse 1.4s ease-in-out infinite;
}
.insight-header .ai-dots-mini span:nth-child(2) { animation-delay: 0.2s; }
.insight-header .ai-dots-mini span:nth-child(3) { animation-delay: 0.4s; }

.insight-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}
.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.insight-item:hover {
    border-color: rgba(99, 102, 241, 0.30);
    background: #fff;
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}
.insight-emoji {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}
.insight-body { flex: 1; min-width: 0; }
.insight-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
    line-height: 1.4;
}
.insight-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
}
.insight-arrow {
    color: var(--primary);
    font-size: 16px;
    align-self: center;
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity var(--transition);
}
.insight-item:hover .insight-arrow { opacity: 1; }

/* ===== Mini course tile (대시보드 강의 내부) — 더 풍성하게 ===== */
.course-list .course-item .course-progress-row .progress-bar { height: 8px; }

/* Dashboard stat-card-* 변형은 common.css 가 담당 */
.stat-card-blue  .stat-value { background: var(--grad-primary);                            -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card-cyan  .stat-value { background: var(--grad-cool);                               -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card-purple .stat-value { background: linear-gradient(135deg, #8b5cf6, #a855f7);     -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card-pink  .stat-value { background: var(--grad-sunset);                             -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Dashboard 우측 컬럼 stack */
.right-stack { display: flex; flex-direction: column; gap: 24px; }

/* Section card (대시보드 카드 컨테이너) */
.section-card { padding: 28px; }
.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.section-card-header h3 {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    letter-spacing: -0.02em;
}
.section-card-header h3 .icon-box {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.icon-box.blue   { background: var(--primary-light); }
.icon-box.cyan   { background: var(--secondary-light); }
.icon-box.purple { background: var(--purple-light); }
.icon-box.amber  { background: var(--accent-light); }

.section-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.section-more:hover { color: var(--primary-hover); }

/* =====================================================================
   DASHBOARD — Course list (시안 02_dashboard.html 기반)
   ===================================================================== */
.course-list { display: flex; flex-direction: column; gap: 14px; }
.course-item {
    display: flex;
    align-items: stretch;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.course-item:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: inherit;
}
.course-accent {
    width: 4px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: stretch;
}
.course-accent.indigo { background: var(--grad-primary); }
.course-accent.cyan   { background: var(--grad-cool); }
.course-accent.purple { background: linear-gradient(135deg, #8b5cf6, #a855f7); }

.course-body { flex: 1; min-width: 0; }
.course-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.course-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.course-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}
.course-tag.ai       { background: var(--primary-light);   color: var(--primary); }
.course-tag.data     { background: var(--secondary-light); color: var(--secondary); }
.course-tag.literacy { background: var(--purple-light);    color: var(--purple); }

.course-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.course-progress-row .progress-bar { flex: 1; }
.course-pct {
    font-size: 13px;
    font-weight: 700;
    min-width: 38px;
    text-align: right;
}
.course-pct.indigo { color: var(--primary); }
.course-pct.cyan   { color: var(--secondary); }
.course-pct.purple { color: var(--purple); }

.progress-fill.cool   { background: var(--grad-cool); }
.progress-fill.purple { background: linear-gradient(135deg, #8b5cf6, #a855f7); }

/* =====================================================================
   DASHBOARD — Quiz list (점수 뱃지)
   ===================================================================== */
.quiz-list { display: flex; flex-direction: column; gap: 12px; }
.quiz-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}
.quiz-item:hover {
    border-color: rgba(99, 102, 241, 0.20);
    box-shadow: var(--shadow-xs);
    transform: translateX(2px);
}
.quiz-score-badge {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.quiz-score-badge.high { background: var(--success-light); color: var(--success); }
.quiz-score-badge.mid  { background: var(--accent-light);  color: var(--accent); }
.quiz-score-badge.low  { background: var(--danger-light);  color: var(--danger); }

.quiz-info { flex: 1; min-width: 0; }
.quiz-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.quiz-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.quiz-score-text { font-size: 13px; font-weight: 700; flex-shrink: 0; }

/* =====================================================================
   DASHBOARD — Notice list (간단 행 형식)
   ===================================================================== */
.notice-list { display: flex; flex-direction: column; gap: 0; }
.notice-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border-light);
    transition: padding var(--transition);
    cursor: pointer;
}
.notice-row:last-child { border-bottom: none; }
.notice-row:hover { padding-left: 6px; }
.notice-row:hover .notice-title-text { color: var(--primary); }

.notice-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}
.notice-dot.important { background: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10); }
.notice-dot.system    { background: var(--primary); }
.notice-dot.general   { background: var(--secondary); box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.10); }

.notice-title-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notice-date-text { font-size: 12px; color: var(--text-dim); flex-shrink: 0; }

/* =====================================================================
   DASHBOARD — Chatbot CTA
   ===================================================================== */
.chatbot-cta {
    margin-top: 32px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(6, 182, 212, 0.25);
}
.chatbot-cta::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-cool);
}
.chatbot-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}
.chatbot-cta-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1 1 320px;
    min-width: 240px;
}
.chatbot-cta-icon {
    width: 60px; height: 60px;
    border-radius: 18px;
    background: var(--grad-cool);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.28);
}
.chatbot-cta-text h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}
.chatbot-cta-text p { font-size: 14px; color: var(--text-secondary); }
.chatbot-cta-bg {
    position: absolute;
    top: -60px; right: -30px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.chatbot-cta-bg-2 {
    position: absolute;
    bottom: -40px; right: 100px;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    pointer-events: none;
}
.chatbot-pulse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--success);
    margin-top: 6px;
    font-weight: 600;
}
.chatbot-pulse .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* =====================================================================
   DASHBOARD — Chat preview (사이드 미리보기 채팅)
   ===================================================================== */
.dashboard-chat-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    flex: 1 1 480px;
    min-width: min(100%, 340px);
    max-width: 100%;
    width: 100%;
    transition: box-shadow var(--transition);
}
.dashboard-chat-preview:hover { box-shadow: var(--shadow); }

.dashboard-chat-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}
.dashboard-chat-preview-header a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.dashboard-chat-preview-intro {
    margin-bottom: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.dashboard-chat-preview-intro .summary {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 6px;
}
.dashboard-chat-preview-intro .detail {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.dashboard-chat-preview-body {
    max-height: min(48vh, 380px);
    min-height: 240px;
    overflow-y: auto;
    padding: 10px 4px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}
.dashboard-chat-preview-body-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dashboard-chat-preview-placeholder {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    padding: 20px 8px;
}

.dashboard-chat-preview-msg {
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.dashboard-chat-preview-msg.user {
    background: var(--grad-primary);
    color: #fff;
    margin-left: 8%;
    max-width: 92%;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.18);
}
.dashboard-chat-preview-msg.bot {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    margin-right: 8%;
    max-width: 92%;
}

.dashboard-chat-preview-input-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}
.dashboard-chat-preview-input { flex: 1; }

.dashboard-chat-preview-send {
    width: 46px; height: 46px;
    border-radius: var(--radius);
    border: none;
    background: var(--grad-primary);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.20);
    flex-shrink: 0;
}
.dashboard-chat-preview-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.30);
}
.dashboard-chat-preview-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* =====================================================================
   GENERIC CHAT (구 .chat-box / .chat-msg) — 영상 상세 등에서 사용
   ===================================================================== */
.chat-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-height: 240px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--bg-surface);
}
.chat-msg {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    max-width: 85%;
    font-size: 14px;
    line-height: 1.55;
}
.chat-msg.user {
    background: var(--grad-primary);
    color: #fff;
    margin-left: auto;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.18);
}
.chat-msg.bot {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}
.chat-input-wrap { display: flex; gap: 12px; margin-top: 16px; }
.chat-input-wrap input { flex: 1; }

/* =====================================================================
   MARKDOWN — chatbot 응답 렌더링
   .chat-msg.bot, .dashboard-chat-preview-msg.bot, .chatbot-msg.bot 내부
   ===================================================================== */
.chat-msg.bot,
.dashboard-chat-preview-msg.bot {
    /* 마크다운 컨텐츠가 들어가므로 약간 더 여유 */
    font-size: 14px;
    line-height: 1.65;
}
.chat-msg.bot p,
.dashboard-chat-preview-msg.bot p {
    margin: 0 0 10px;
}
.chat-msg.bot p:last-child,
.dashboard-chat-preview-msg.bot p:last-child { margin-bottom: 0; }

.chat-msg.bot strong,
.dashboard-chat-preview-msg.bot strong {
    font-weight: 700;
    color: var(--text);
}
.chat-msg.bot em,
.dashboard-chat-preview-msg.bot em { font-style: italic; }
.chat-msg.bot del,
.dashboard-chat-preview-msg.bot del {
    color: var(--text-muted);
    text-decoration: line-through;
}

.chat-msg.bot h2,
.chat-msg.bot h3,
.chat-msg.bot h4,
.chat-msg.bot h5,
.dashboard-chat-preview-msg.bot h2,
.dashboard-chat-preview-msg.bot h3,
.dashboard-chat-preview-msg.bot h4,
.dashboard-chat-preview-msg.bot h5 {
    font-weight: 800;
    color: var(--text);
    line-height: 1.35;
    letter-spacing: -0.02em;
    margin: 14px 0 8px;
}
.chat-msg.bot h2,
.dashboard-chat-preview-msg.bot h2 { font-size: 18px; }
.chat-msg.bot h3,
.dashboard-chat-preview-msg.bot h3 { font-size: 16px; }
.chat-msg.bot h4,
.chat-msg.bot h5,
.dashboard-chat-preview-msg.bot h4,
.dashboard-chat-preview-msg.bot h5 { font-size: 14px; }
.chat-msg.bot h2:first-child,
.chat-msg.bot h3:first-child,
.chat-msg.bot h4:first-child,
.dashboard-chat-preview-msg.bot h2:first-child,
.dashboard-chat-preview-msg.bot h3:first-child,
.dashboard-chat-preview-msg.bot h4:first-child { margin-top: 0; }

.chat-msg.bot ul,
.chat-msg.bot ol,
.dashboard-chat-preview-msg.bot ul,
.dashboard-chat-preview-msg.bot ol {
    margin: 8px 0 12px;
    padding-left: 22px;
}
.chat-msg.bot li,
.dashboard-chat-preview-msg.bot li {
    margin-bottom: 6px;
    line-height: 1.6;
}
.chat-msg.bot li::marker,
.dashboard-chat-preview-msg.bot li::marker { color: var(--primary); font-weight: 700; }

.chat-msg.bot a,
.dashboard-chat-preview-msg.bot a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.chat-msg.bot a:hover,
.dashboard-chat-preview-msg.bot a:hover {
    color: var(--primary-hover);
}

.chat-msg.bot code,
.dashboard-chat-preview-msg.bot code {
    font-family: 'SF Mono', 'Fira Code', Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: var(--bg-elevated);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}
.chat-msg.bot pre,
.dashboard-chat-preview-msg.bot pre {
    margin: 10px 0;
    padding: 14px 16px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.55;
    border: 1px solid #1e293b;
}
.chat-msg.bot pre code,
.dashboard-chat-preview-msg.bot pre code {
    background: none;
    color: inherit;
    border: none;
    padding: 0;
    font-size: inherit;
}

.chat-msg.bot blockquote,
.dashboard-chat-preview-msg.bot blockquote {
    margin: 10px 0;
    padding: 10px 16px;
    border-left: 3px solid var(--primary);
    background: var(--primary-light);
    color: var(--text-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}

/* dashboard 미니 챗 프리뷰는 글씨 크기 살짝 작게 */
.dashboard-chat-preview-msg.bot { font-size: 13.5px; line-height: 1.6; }
.dashboard-chat-preview-msg.bot h2 { font-size: 16px; }
.dashboard-chat-preview-msg.bot h3 { font-size: 14.5px; }
.dashboard-chat-preview-msg.bot pre { font-size: 12px; padding: 10px 12px; }

/* =====================================================================
   CHATBOT — 풀페이지 모드 (mode-chatbot-only)
   ===================================================================== */
body.mode-chatbot-only #headerTop,
body.mode-chatbot-only #siteHeader,
body.mode-chatbot-only .footer {
    display: none !important;
}
body.mode-chatbot-only .main-content {
    max-width: 100%;
    padding: 0;
}

.chatbot-page { width: 100%; }
.chatbot-page-solo {
    min-height: 100vh;
    background: var(--bg-surface);
    padding: 20px;
}
.chatbot-shell {
    max-width: 1024px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 70vh;
    position: relative;
}
.chatbot-shell::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-cool);
    z-index: 2;
}
.chatbot-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(6, 182, 212, 0.04));
}
.chatbot-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}
.chatbot-subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.chatbot-messages {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    background: var(--bg-surface);
}
.chatbot-empty {
    color: var(--text-muted);
    font-size: 14px;
    padding: 24px 8px;
    text-align: center;
}
.chatbot-inputbar {
    display: flex;
    gap: 10px;
    padding: 16px 18px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
}
.chatbot-input { flex: 1; min-width: 0; }
.chatbot-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.chatbot-hints {
    display: flex;
    gap: 10px;
    padding: 14px 18px 18px;
    background: var(--bg-card);
    flex-wrap: wrap;
}
.chatbot-hint {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.chatbot-hint:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: var(--primary-light);
    color: var(--primary);
}

/* =====================================================================
   DASHBOARD — Legacy course card / empty state (app.js 일부에서 사용 중)
   ===================================================================== */
.dashboard-empty {
    padding: 28px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.dashboard-course-card {
    cursor: pointer;
    padding: 22px 24px;
    margin-bottom: 14px;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}
.dashboard-course-card:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.dashboard-course-card-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text);
    letter-spacing: -0.02em;
}
.dashboard-course-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}
.dashboard-course-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.dashboard-course-progress-bar > div {
    height: 100%;
    background: var(--grad-primary);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.dashboard-course-progress-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    min-width: 40px;
    text-align: right;
}
.dashboard-course-current {
    font-size: 13px;
    color: var(--text-muted);
}

/* 강의 상세 — 교안 다운로드 영역 */
.course-handouts {
    margin-top: 16px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}
.handout-download-btn { padding: 7px 14px; font-size: 13px; }

/* survey area sub-page (탭별 영역 컨테이너) */
.survey-area-page { animation: fadeIn 0.25s ease both; }

/* =====================================================================
   COURSES PAGE — 3-column grid (시안 03_courses.html)
   ===================================================================== */
.page-hero .hero-subtitle {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}
.hero-stat .emoji { font-size: 16px; }
.hero-stat strong {
    color: var(--primary);
    font-weight: 800;
    font-size: 16px;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 1024px) { .course-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .course-grid { grid-template-columns: 1fr; } }

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    text-decoration: none;
    color: inherit;
}
.course-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    color: inherit;
}

.course-card .course-accent {
    height: 4px;
    width: auto;
    align-self: stretch;
    border-radius: 0;
}
.course-card .course-accent.indigo  { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.course-card .course-accent.cyan    { background: linear-gradient(90deg, #06b6d4, #6366f1); }
.course-card .course-accent.emerald { background: linear-gradient(90deg, #10b981, #06b6d4); }
.course-card .course-accent.amber   { background: linear-gradient(90deg, #f59e0b, #f97316); }
.course-card .course-accent.purple  { background: linear-gradient(90deg, #8b5cf6, #a855f7); }

.course-card .course-body {
    padding: 24px 26px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

.course-badge-row { margin-bottom: 12px; }

.course-card .course-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.4;
    /* 2-line clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.4em * 2);
}

.course-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.course-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}
.course-meta-item .emoji {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.course-progress-section {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.course-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.course-progress-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}
.course-progress-pct {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.pct-high { color: var(--success); }
.pct-mid  { color: var(--primary); }
.pct-low  { color: var(--accent); }

.course-progress-bar { margin-bottom: 16px; }
.progress-bar-lg { height: 10px; }

.progress-fill.success { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-fill.primary { background: var(--grad-primary); }
.progress-fill.amber   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.course-action { display: flex; }
.course-action .btn {
    width: 100%;
    font-size: 14px;
    padding: 11px 0;
}

.course-empty {
    grid-column: 1 / -1;
    padding: 60px 24px;
    text-align: center;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-xl);
    color: var(--text-muted);
}
.course-empty-emoji { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.course-empty-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.course-empty-desc { font-size: 13px; }

/* =====================================================================
   COURSE DETAIL
   ===================================================================== */
.course-detail-header { margin-bottom: 28px; }
.course-detail-header h2 {
    font-size: 26px;
    margin-bottom: 8px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.course-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 18px;
    cursor: pointer;
    transition: color var(--transition);
}
.course-detail-back:hover { color: var(--primary); }

.video-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition);
}
.video-list-item:hover {
    border-color: rgba(99, 102, 241, 0.30);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.video-list-item.completed {
    border-left: 4px solid var(--success);
}

/* =====================================================================
   VIDEO DETAIL — Plyr 컨테이너 + 커스텀 테마
   ===================================================================== */
.video-detail-player-wrap {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: var(--radius-lg);
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}
.video-detail-player-wrap .plyr {
    border-radius: var(--radius-lg);
    overflow: hidden;
}
/* Plyr accent (인디고 그라데이션 톤으로 통일) */
:root {
    --plyr-color-main: #6366f1;
    --plyr-video-control-color: #fff;
    --plyr-video-control-color-hover: #fff;
    --plyr-video-control-background-hover: rgba(99, 102, 241, 0.85);
    --plyr-video-progress-buffered-background: rgba(255, 255, 255, 0.30);
    --plyr-range-fill-background: linear-gradient(90deg, #6366f1, #8b5cf6);
    --plyr-tooltip-background: #0f172a;
    --plyr-tooltip-color: #fff;
    --plyr-menu-background: rgba(15, 23, 42, 0.96);
    --plyr-menu-color: #fff;
    --plyr-menu-arrow-color: #fff;
    --plyr-menu-back-border-color: rgba(255, 255, 255, 0.10);
    --plyr-menu-back-border-shadow-color: rgba(255, 255, 255, 0.05);
    --plyr-control-radius: 6px;
    --plyr-font-family: var(--font, 'Inter', sans-serif);
}
.plyr--full-ui input[type=range] {
    color: var(--plyr-color-main);
}
.plyr__control--overlaid {
    background: rgba(99, 102, 241, 0.92);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.40);
}
.plyr__control--overlaid:hover { background: rgba(79, 70, 229, 1); }
.plyr__progress__buffer { color: rgba(255, 255, 255, 0.28); }
.plyr--video .plyr__control:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* === 이전 위치 이어보기 안내 배너 === */
.video-resume-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(6, 182, 212, 0.06));
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    animation: fadeInUp 0.3s ease both;
}
.video-resume-icon {
    font-size: 18px;
    line-height: 1;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 8px;
    border-radius: var(--radius);
    flex-shrink: 0;
}
#videoResumeText { flex: 1; }
.video-resume-restart {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.video-resume-restart:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.video-detail-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: -0.02em;
}
.video-detail-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.6;
}
.video-detail-info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 22px;
    font-size: 14px;
}
.video-detail-info-card .info-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.video-detail-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.video-detail-tab {
    padding: 12px 22px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--transition), border-color var(--transition);
}
.video-detail-tab:hover { color: var(--text); }
.video-detail-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.video-detail-panel { margin-bottom: 22px; }
.video-detail-handouts-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}
.video-detail-handout-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.video-detail-handout-item .handout-actions { display: flex; gap: 10px; }

.video-detail-nav {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}
.video-detail-nav .nav-btns {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.video-chat-messages {
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto;
    padding: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
}
.video-chat-messages .chat-msg {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
}
.video-chat-input-wrap { display: flex; gap: 10px; }
.video-chat-input-wrap .input { flex: 1; }

/* =====================================================================
   PDF.js VIEWER (overlay 모달)
   ===================================================================== */
.pdf-viewer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: auto;
}
.pdf-viewer-modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 1000px;
    width: 100%;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}
.pdf-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
}
.pdf-viewer-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}
.pdf-viewer-close { flex-shrink: 0; }
.pdf-viewer-canvas-wrap {
    flex: 1;
    overflow: auto;
    padding: 18px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-surface);
}
.pdf-viewer-loading {
    color: var(--text-muted);
    font-size: 15px;
    padding: 24px;
}
.pdf-viewer-pages {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}
.pdf-viewer-page {
    width: min(900px, 100%);
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 14px;
}
.pdf-viewer-page canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #fff;
}
.pdf-viewer-page-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.pdf-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-wrap: wrap;
}
.pdf-viewer-divider {
    width: 1px; height: 20px;
    background: var(--border);
    display: inline-block;
}
.pdf-viewer-pagenum {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    min-width: 64px;
    text-align: center;
}

/* =====================================================================
   NOTICE LIST (notice 페이지) — 시안 07_notice_list.html
   ===================================================================== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.filter-bar .filter-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-right: 4px;
    letter-spacing: -0.01em;
}

.notice-count {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.notice-count strong { color: var(--primary); font-weight: 800; }

.notice-list-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* notice-card (목록 카드) */
.notice-card {
    display: grid;
    grid-template-columns: 76px 1fr auto;
    gap: 22px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    position: relative;
}
.notice-card:hover {
    border-left-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: inherit;
}
.notice-card:hover .notice-card-title { color: var(--primary); }
.notice-card.is-important {
    border-left-color: var(--danger);
    background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}
.notice-card.is-important:hover {
    border-left-color: var(--primary);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.notice-date-col { text-align: center; padding: 8px 0; }
.notice-date-month {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.04em;
    line-height: 1;
    margin-bottom: 4px;
}
.notice-date-day {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1.1;
}
.notice-date-year {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

.notice-card-content { min-width: 0; }
.notice-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 6px;
    transition: color var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
}
.notice-card-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notice-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-dim);
}
.notice-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.notice-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}
.notice-views {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* =====================================================================
   NOTICE DETAIL — content + sidebar
   ===================================================================== */
.notice-content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 0;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.notice-content-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-primary);
}
.notice-content-inner { padding: 40px 44px; }

.notice-title-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}
.notice-title-row h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: -0.03em;
    flex: 1;
}

.notice-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.notice-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.notice-meta-item .meta-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.notice-body {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 36px;
}

.notice-attachments {
    padding: 24px 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.notice-attachments h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.attachment-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}
.attachment-item:last-child { border-bottom: none; padding-bottom: 0; }
.attachment-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.attachment-info { flex: 1; min-width: 0; }
.attachment-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attachment-size { font-size: 12px; color: var(--text-dim); }
.attachment-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.attachment-download:hover {
    background: var(--grad-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

/* sidebar (이전/다음 글) */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.sidebar-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-cool);
}
.sidebar-header {
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--border);
}
.sidebar-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.notice-nav-item {
    display: block;
    padding: 18px 26px;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.notice-nav-item:last-child { border-bottom: none; }
.notice-nav-item:hover { background: var(--bg-hover); }
.notice-nav-item:hover .notice-nav-title { color: var(--primary); }
.notice-nav-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.notice-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: color var(--transition);
}
.notice-nav-date {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}
.nav-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 6px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}
.sidebar-back {
    padding: 20px 26px;
    border-top: 1px solid var(--border);
}

@media (min-width: 1025px) {
    .detail-sidebar { position: sticky; top: 90px; align-self: start; }
}

/* page-hero icon (07/08 등 페이지 hero) */
.page-hero .hero-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.12);
}

/* =====================================================================
   QUIZ
   ===================================================================== */
.quiz-timer {
    padding: 12px 22px;
    background: var(--primary-light);
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    display: inline-block;
    border: 1px solid rgba(99, 102, 241, 0.20);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

/* =====================================================================
   SURVEY (literacy-survey)
   ===================================================================== */
.survey-area-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}
.survey-area-tab {
    padding: 12px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
}
.survey-area-tab:hover {
    border-color: rgba(99, 102, 241, 0.30);
    color: var(--primary);
}
.survey-area-tab.active {
    border-color: var(--primary);
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.22);
}

.survey-question-block {
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
}
.survey-question-block:hover { box-shadow: var(--shadow-sm); }

.survey-question-text {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 16px;
    color: var(--text);
    line-height: 1.5;
}

.survey-option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.survey-option-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition);
    min-height: 44px;
}
.survey-option-group label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.survey-option-group label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}
.survey-option-group input { margin: 0; accent-color: var(--primary); }

.survey-result-card {
    padding: 28px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--grad-hero);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.survey-result-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-primary);
}
.survey-result-score {
    font-size: 32px;
    font-weight: 800;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}
.survey-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.survey-pdf-link:hover { color: var(--primary-hover); }

/* =====================================================================
   PROFILE — 편집 + 비밀번호 변경
   ===================================================================== */
.profile-hero {
    text-align: center;
    padding: 40px 32px 36px;
    background: var(--grad-hero);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.profile-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad-primary);
}
.profile-hero::after {
    content: '';
    position: absolute;
    top: -120px; right: -60px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.10) 0%, transparent 70%);
    pointer-events: none;
}

.profile-avatar-ring {
    width: 110px; height: 110px;
    border-radius: 50%;
    margin: 0 auto 16px;
    padding: 4px;
    background: var(--grad-primary);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.30);
    position: relative;
    z-index: 1;
}
.profile-avatar-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.04em;
}

.profile-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}
.profile-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.profile-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.profile-section-title .icon-box { flex-shrink: 0; }

.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}
@media (max-width: 640px) { .profile-info-grid { grid-template-columns: 1fr; } }

.profile-info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
}
.profile-info-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}
.profile-info-value {
    font-size: 15px;
    color: var(--text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 640px) { .profile-form-grid { grid-template-columns: 1fr; } }
.profile-form-field { display: flex; flex-direction: column; gap: 6px; }
.profile-form-field label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.profile-form-field .input { padding: 10px 14px; font-size: 14px; }
.profile-form-field input:disabled,
.profile-form-field .input:disabled {
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
}

.profile-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.profile-status-msg {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    display: none;
}
.profile-status-msg.is-success {
    display: block;
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.20);
}
.profile-status-msg.is-error {
    display: block;
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.20);
}

.password-toggle {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}
.password-toggle:hover { color: var(--primary-hover); text-decoration: underline; }

.profile-danger-zone {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* =====================================================================
   QUIZ RESULT DETAIL
   ===================================================================== */
.quiz-result-hero {
    text-align: center;
    padding: 36px 32px;
    background: var(--grad-hero);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.quiz-result-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad-primary);
}

.quiz-result-circle {
    width: 140px; height: 140px;
    margin: 0 auto 16px;
    position: relative;
}
.quiz-result-circle svg {
    transform: rotate(-90deg);
    width: 100%; height: 100%;
}
.quiz-result-circle-bg { stroke: var(--bg-elevated); }
.quiz-result-circle-fill {
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz-result-circle-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}
.quiz-result-circle-text small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.quiz-result-summary-row {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-secondary);
}
.quiz-result-summary-row span strong { color: var(--text); font-weight: 700; }

.quiz-question-result {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 14px;
    transition: box-shadow var(--transition);
}
.quiz-question-result:hover { box-shadow: var(--shadow-sm); }
.quiz-question-result.is-correct   { border-left-color: var(--success); }
.quiz-question-result.is-incorrect { border-left-color: var(--danger); }

.quiz-question-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.quiz-question-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}
.quiz-question-text {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.55;
}
.quiz-question-points {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-muted);
}
.quiz-question-points.is-correct   { background: var(--success-light); color: var(--success); }
.quiz-question-points.is-incorrect { background: var(--danger-light);  color: var(--danger); }

.quiz-answer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.quiz-answer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
}
.quiz-answer-row.is-correct {
    background: var(--success-light);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.22);
    font-weight: 600;
}
.quiz-answer-row.is-user-wrong {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.22);
    font-weight: 600;
    text-decoration: line-through;
}
.quiz-answer-row .ans-mark {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    background: var(--bg-elevated);
    color: var(--text-muted);
}
.quiz-answer-row.is-correct .ans-mark   { background: var(--success); color: #fff; }
.quiz-answer-row.is-user-wrong .ans-mark{ background: var(--danger);  color: #fff; }
.quiz-answer-tag {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
}

.quiz-short-answer {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    font-size: 14px;
}
.quiz-short-answer .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    margin-right: 8px;
}

/* =====================================================================
   ATTENDANCE — Visual chart (donut + per-course bars)
   ===================================================================== */
.attendance-overview {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    margin-bottom: 28px;
}
@media (max-width: 768px) { .attendance-overview { grid-template-columns: 1fr; } }

.attendance-donut {
    width: 200px; height: 200px;
    margin: 0 auto;
    position: relative;
}
.attendance-donut svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.attendance-donut-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.attendance-donut-rate {
    font-size: 36px;
    font-weight: 800;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.04em;
    line-height: 1;
}
.attendance-donut-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.attendance-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: center;
}
.attendance-legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 14px;
}
.attendance-legend-row .swatch {
    width: 12px; height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}
.attendance-legend-row .label { flex: 1; color: var(--text-secondary); font-weight: 500; }
.attendance-legend-row .count { font-weight: 700; color: var(--text); }
.swatch-present { background: var(--success); }
.swatch-late    { background: var(--accent); }
.swatch-absent  { background: var(--danger); }

.attendance-course-list { display: flex; flex-direction: column; gap: 14px; }
.attendance-course-row {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    transition: box-shadow var(--transition);
}
.attendance-course-row:hover { box-shadow: var(--shadow-sm); }
.attendance-course-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.attendance-course-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attendance-course-rate {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}
.attendance-course-bar-stack {
    display: flex;
    height: 10px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--bg-elevated);
}
.attendance-course-bar-seg { transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.attendance-course-bar-seg.present { background: var(--success); }
.attendance-course-bar-seg.late    { background: var(--accent); }
.attendance-course-bar-seg.absent  { background: var(--danger); }
.attendance-course-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* =====================================================================
   SURVEY RESULT — Bar chart per area
   ===================================================================== */
.survey-result-areas {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}
.survey-result-area-row {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    transition: box-shadow var(--transition);
}
.survey-result-area-row:hover { box-shadow: var(--shadow-sm); }
.survey-result-area-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.survey-result-area-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.survey-result-area-score {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.01em;
}
.survey-result-area-level {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
}

/* =====================================================================
   ATTENDANCE / PROFILE 등 공용 보조
   ===================================================================== */
.handout-view-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.handout-view-link:hover { color: var(--primary-hover); text-decoration: underline; }

.handout-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.handout-actions .btn { padding: 7px 14px; font-size: 13px; }

.meta-icon { display: inline-flex; align-items: center; }

/* =====================================================================
   RESPONSIVE — 모바일/태블릿 보정 (PC 우선)
   ===================================================================== */
@media (max-width: 1024px) {
    .welcome-hero { padding: 32px 28px; }
    .welcome-text h1 { font-size: 24px; }
    .notice-content-inner { padding: 28px 24px; }
    .notice-title-row h1 { font-size: 22px; }
}

@media (max-width: 768px) {
    .welcome-content { flex-direction: column; text-align: center; }
    .welcome-meta { text-align: center; }

    .chatbot-cta-inner { flex-direction: column; text-align: center; }
    .chatbot-cta-left { flex-direction: column; }

    .notice-card { grid-template-columns: 1fr; gap: 12px; padding: 20px; }
    .notice-date-col { display: flex; align-items: center; gap: 8px; text-align: left; padding: 0; }
    .notice-date-day { font-size: 22px; }
    .notice-card-right { flex-direction: row; align-items: center; }
    .notice-card-title { white-space: normal; }

    .notice-content-inner { padding: 22px 18px; }
    .notice-title-row h1 { font-size: 20px; }
    .notice-meta-row { gap: 12px; }

    .chatbot-page-solo { padding: 12px; }
    .chatbot-shell { min-height: calc(100vh - 24px); border-radius: var(--radius-lg); }
    .chatbot-header { padding: 18px 18px 12px; }
    .chatbot-messages { padding: 16px; }
    .chatbot-inputbar { padding: 12px; }
    .chatbot-hints { padding: 12px 14px 16px; }

    .login-container { padding: 32px 24px 28px; }
}
