/* =====================================================================
   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 와이드 보정만 담당.
   ===================================================================== */

/* Pretendard — PC 로그인/인트로 페이지의 reference 디자인에 사용 */
@font-face {
    font-family: 'Pretendard'; font-style: normal; font-weight: 400;
    src: url('intro/fonts/Pretendard-Regular.woff') format('woff'),
         url('intro/fonts/Pretendard-Regular.otf') format('opentype');
    font-display: swap;
}
@font-face {
    font-family: 'Pretendard'; font-style: normal; font-weight: 500;
    src: url('intro/fonts/Pretendard-SemiBold.woff') format('woff'),
         url('intro/fonts/Pretendard-SemiBold.otf') format('opentype');
    font-display: swap;
}
@font-face {
    font-family: 'Pretendard'; font-style: normal; font-weight: 700;
    src: url('intro/fonts/Pretendard-Bold.woff') format('woff'),
         url('intro/fonts/Pretendard-Bold.otf') format('opentype');
    font-display: swap;
}

: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 로그인 페이지 (ref_resources/pc/login.html 기반 디자인)
   body.login-mode 클래스가 있을 때 topbar/navbar/footer 숨김 (app.js 가 토글)
   ===================================================================== */
body.login-mode { font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif; }
body.login-mode .topbar,
body.login-mode .navbar,
body.login-mode .footer,
body.login-mode .bg-mesh,
body.login-mode .bg-grid { display: none !important; }
body.login-mode .page-wrapper { display: block; }
body.login-mode .main-content { padding: 0 !important; margin: 0 !important; max-width: none !important; }

#login.screen.active {
    display: block;
    padding: 0;
    margin: 0;
}

.pc-login {
    width: 100%;
    min-height: 100vh;
    background: url('intro/images/login_bg.png') no-repeat center;
    background-size: cover;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pc-login-container {
    position: relative;
    width: 100%;
    max-width: 1460px;
    margin: 0 auto;
    padding: 40px 5%;
    box-sizing: border-box;
}
.pc-login-box {
    width: 100%;
    max-width: 536px;
    background: #fff;
    border-radius: 25px;
    box-shadow: 0 3px 20px 0 rgba(0,0,0,0.22);
    padding: 54px;
    box-sizing: border-box;
    text-align: center;
}
.pc-login-title { display: block; margin-bottom: 50px; }
.pc-login-title strong {
    display: block;
    font-size: 33px;
    font-weight: 700;
    color: #172C70;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}
.pc-login-title p { font-size: 18px; color: #808C9C; }

.pc-login-form dl { display: block; margin-bottom: 25px; text-align: left; }
.pc-login-form dl > dt {
    font-size: 16px;
    color: #000;
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}
.pc-login-form dl > dd { display: block; width: 100%; }
.pc-login-form input {
    width: 100%;
    height: 54px;
    box-sizing: border-box;
    border-radius: 13px;
    border: 0;
    font-size: 16px;
    text-indent: 20px;
    background: #F7F7F7;
    font-family: inherit;
    color: #000;
}
.pc-login-form input::placeholder { font-size: 16px; color: #A8B2C1; }
.pc-login-form input:focus { outline: 2px solid #6B6EFF; outline-offset: 0; }

.pc-login-options { display: flex; margin-bottom: 30px; }
.pc-chk-box { margin-right: auto; }
.pc-chk-box input[type="checkbox"] {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.pc-chk-box input[type="checkbox"] + label {
    display: inline-block;
    position: relative;
    cursor: pointer;
    user-select: none;
    color: #666;
    font-size: 15px;
    margin: 0;
}
.pc-chk-box input[type="checkbox"] + label:before {
    content: ' ';
    display: inline-block;
    width: 15px; height: 15px;
    vertical-align: middle;
    background: #fff;
    border: 1px solid #a1a1a1;
    margin: 0 6px 2px 0;
    border-radius: 3px;
    position: relative;
}
.pc-chk-box input[type="checkbox"]:checked + label:before {
    background: #6B6EFF;
    border-color: #6B6EFF;
}
.pc-chk-box input[type="checkbox"]:checked + label:after {
    content: '';
    display: block;
    width: 8px; height: 4px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    position: absolute;
    top: 7px; left: 4px;
    transform: rotate(135deg);
}

.pc-login-btn {
    display: flex;
    width: 100%;
    line-height: 54px;
    height: 54px;
    border-radius: 13px;
    background: linear-gradient(90deg, #6B6EFF, #3AA3FF);
    border: 0;
    color: #fff;
    font-family: inherit;
    font-size: 19px;
    font-weight: 500;
    margin-bottom: 60px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: filter 0.15s ease;
}
.pc-login-btn:hover { filter: brightness(1.05); }
.pc-login-btn:active { filter: brightness(0.95); }
.pc-login-btn .material-symbols-outlined { font-size: 22px; }

.pc-login-footer { font-size: 13px; color: #808C9C; }
.pc-login-logos {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}
.pc-login-logos img { height: 36px; width: auto; }

#login.screen .error-message {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 13px;
    border: 1px solid #fecaca;
    text-align: left;
}

@media (max-width: 640px) {
    .pc-login-box { padding: 32px 24px; border-radius: 16px; }
    .pc-login-title { margin-bottom: 24px; }
    .pc-login-title strong { font-size: 24px; }
    .pc-login-title p { font-size: 15px; }
    .pc-login-form input { height: 48px; border-radius: 10px; font-size: 15px; }
    .pc-login-btn { height: 50px; line-height: 50px; font-size: 17px; margin-bottom: 32px; }
    .pc-login-logos img { height: 28px; }
}

/* =====================================================================
   PC 대시보드 — ref_resources/pc/index.html 기반 (#dashboard 안에 scoped)
   - Section-1: hero 배경(main_bg) + 좌(welcome + quick-banner) / 우(AI 챗봇)
   - Section-2: 라이트 그레이 + 카드(dash-box) 3 row
   ===================================================================== */
#dashboard.screen.active { padding: 0; margin: 0; font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif; }
body:has(#dashboard.screen.active) .main-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    max-width: none !important;
}
/* 대시보드 모드: body 자체 배경을 hero 와 같은 짙은 인디고로 (흰 여백 제거) */
body:has(#dashboard.screen.active) { background: #0a1d52 !important; }
body:has(#dashboard.screen.active) .bg-mesh,
body:has(#dashboard.screen.active) .bg-grid { display: none !important; }

/* 좌상단 로고: 대시보드에서는 reference 의 PNG 로고로 교체 (스크롤 전 = 흰, 스크롤 후 = 컬러) */
.navbar .logo .logo-img { display: none; height: 36px; width: auto; }
body:has(#dashboard.screen.active) .navbar .logo .logo-icon,
body:has(#dashboard.screen.active) .navbar .logo > span { display: none !important; }
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) .logo .logo-img--white {
    display: inline-block;
}
body:has(#dashboard.screen.active) .navbar.is-scrolled .logo .logo-img--color {
    display: inline-block;
}

/* === Hero 가 navbar/topbar 뒤로 확장되도록 + 헤더는 hero 위에 투명 오버레이 === */
/* topbar 에 position:relative + z-index 부여해 hero(margin-top -92) 위에 표시 */
body:has(#dashboard.screen.active) .topbar {
    position: relative;
    z-index: 301;   /* navbar(300) 위에 (둘 다 시각적으로 hero 보다 위) */
}
body:has(#dashboard.screen.active) .ref-dash-section-1 {
    z-index: 0;
}

/* 스크롤 전(.is-compact / .is-scrolled 미적용) 상태에서만 투명 처리, 스크롤 시 기본(흰색) 복귀 */
body:has(#dashboard.screen.active) .topbar:not(.is-compact),
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) {
    background: transparent !important;
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
body:has(#dashboard.screen.active) .topbar:not(.is-compact) .topbar-org,
body:has(#dashboard.screen.active) .topbar:not(.is-compact) .topbar-links a {
    color: rgba(255, 255, 255, 0.92) !important;
}
body:has(#dashboard.screen.active) .topbar:not(.is-compact) .topbar-links a:hover {
    color: #fff !important;
}
body:has(#dashboard.screen.active) .topbar:not(.is-compact) .lang-select {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23fff' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") !important;
}
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) .logo span,
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) .nav-links > a {
    color: #fff !important;
}
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) .nav-links > a:hover {
    color: rgba(255, 255, 255, 0.75) !important;
}
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) .logo-icon {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) !important;
}
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) #headerLogoutBtn,
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) #headerLoginBtn {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    color: #fff !important;
}
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) #headerLogoutBtn:hover,
body:has(#dashboard.screen.active) .navbar:not(.is-scrolled) #headerLoginBtn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
}

.ref-dash-container {
    max-width: 1460px; margin: 0 auto;
    padding: 0 32px; box-sizing: border-box;
    position: relative;
}

/* === Section 1 — Hero === */
.ref-dash-section-1 {
    background: url('intro/images/main_bg.png') no-repeat center top;
    background-size: cover;
    padding: 24px 0 56px;
    color: #fff;
    position: relative;
    /* navbar(60px) + topbar(~32px) 뒤로 hero 배경이 깔리도록 위로 -92px 끌어올리고 그만큼 padding-top 보충 */
    margin-top: -92px;
    padding-top: 116px;
}
.ref-dash-section-1 .ref-dash-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 25px;
    align-items: stretch;
}
.ref-dash-section-1 .dash-box {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    color: #1f2937;
}

/* welcome */
.ref-dash-welcome { margin-bottom: 25px; }
.ref-dash-welcome .title {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between;
    gap: 12px; margin-bottom: 6px;
}
.ref-dash-welcome .title h2 {
    font-size: 29px; font-weight: 600; color: #172C70;
    letter-spacing: -0.02em; margin: 0;
}
.ref-dash-welcome .title .date {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 0; font-size: 13px; color: #64748b;
    background: #f1f5f9; padding: 6px 12px; border-radius: 999px;
    white-space: nowrap;
}
.ref-dash-welcome .title .date .material-symbols-outlined { font-size: 16px; }
.ref-dash-welcome-desc {
    font-size: 17px; color: #64748b; line-height: 1.6;
    margin: 0 0 60px;
}
.ref-dash-welcome .greeting {
    background: #DBEEFF;
    border-radius: 0 15px 15px 15px;
    padding: 15px 25px;
    position: relative;
    font-size: 16px;
    color: #172C70;
    line-height: 1.6;
}
.ref-dash-welcome .greeting::before {
    content: '';
    display: block;
    width: 0; height: 2px;
    border-top: 25px solid #DBEEFF;
    border-right: 21px solid transparent;
    position: absolute;
    top: -22px; left: 3px;
    transform: rotate(270deg);
}
.ref-dash-streak {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 14px;
    padding: 6px 12px; border-radius: 999px;
    background: #fff7ed; color: #c2410c; font-size: 12px; font-weight: 600;
    border: 1px solid #fed7aa;
}

/* quick banner (4 stats) */
.ref-dash-quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px;
}
.ref-dash-quick > a {
    display: flex; align-items: stretch; justify-content: space-between;
    min-height: 164px;
    border-radius: 15px;
    box-sizing: border-box;
    padding: 25px;
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(16px) brightness(1.3);
    backdrop-filter: blur(16px) brightness(1.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ref-dash-quick > a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.ref-dash-quick > a > dl {
    display: flex; flex-direction: column; justify-content: space-between;
    flex: 1;
}
.ref-dash-quick > a > dl > dt {
    font-size: 19px; font-weight: 500; color: #1f2937;
    margin-bottom: 14px;
}
.ref-dash-quick > a > dl > dd {
    margin: 0; line-height: 1;
    display: flex; align-items: baseline; gap: 4px;
}
.ref-dash-quick > a > dl > dd > strong {
    font-size: 42px; font-weight: 700;
}
.ref-dash-quick > a > dl > dd > span {
    font-size: 20px; font-weight: 500;
}
.ref-dash-quick > a:nth-child(1) > dl > dd,
.ref-dash-quick > a:nth-child(2) > dl > dd { color: #6B6EFF; }
.ref-dash-quick > a:nth-child(3) > dl > dd,
.ref-dash-quick > a:nth-child(4) > dl > dd { color: #1AB1FF; }
.ref-dash-quick > a > .icon {
    position: absolute; bottom: 12px; right: 12px;
    width: 96px; height: 96px;
    display: flex; align-items: center; justify-content: center;
}
.ref-dash-quick > a > .icon img { max-width: 100%; max-height: 100%; }

/* AI 챗봇 */
.ref-dash-chat {
    display: flex; flex-direction: column;
    min-height: 460px;
}
.ref-dash-chat .cont-top {
    display: flex; align-items: center; gap: 15px;
    margin-bottom: 15px;
}
.ref-dash-chat .chatbot-img {
    width: 64px; height: 64px;
    border-radius: 16px; overflow: hidden;
    background: linear-gradient(135deg, #818cf8, #38bdf8);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ref-dash-chat .chatbot-img img { width: 100%; height: 100%; object-fit: cover; }
.ref-dash-chat .cont-top .title { flex: 1; min-width: 0; }
/* 헤더 우측 상단 '전체보기 +' → AI 챗봇 페이지 이동 */
.ref-dash-chat .cont-top .ref-dash-chat-more {
    align-self: flex-start;
    flex-shrink: 0;
    margin-top: 4px;
    font-size: 13px; font-weight: 500; color: #1AB1FF;
    text-decoration: none; white-space: nowrap;
}
.ref-dash-chat .cont-top .ref-dash-chat-more:hover { text-decoration: underline; }
.ref-dash-chat .cont-top .title > strong {
    display: flex; flex-wrap: wrap; align-items: center;
    font-size: 22px; font-weight: 700; color: #0f172a;
    margin-bottom: 4px;
}
.ref-dash-chat .cont-top .title > strong > .status {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: #0AC5A5;
    margin-left: 10px;
    background: #ecfdf5; padding: 4px 10px; border-radius: 999px;
    font-weight: 500;
    border: 1px solid #BFF2E9;
}
.ref-dash-chat .cont-top .title > strong > .status::before {
    content: ''; display: block;
    width: 8px; height: 8px;
    background: #0AC5A5; border: 3px solid #BFF2E9; border-radius: 50%;
    box-sizing: content-box;
}
.ref-dash-chat .cont-top .title > p {
    font-size: 13.5px; color: #64748b; margin: 0; line-height: 1.5;
}
.ref-dash-chat .chat-body {
    background: linear-gradient(90deg, #E8E8FF, #DBEFFF);
    border-radius: 10px;
    padding: 20px;
    flex: 1; display: flex; flex-direction: column; min-height: 0;
}
.ref-dash-chat .chat-wrap {
    flex: 1; overflow-y: auto;
    padding-right: 6px;
    margin-bottom: 14px;
}
.ref-dash-chat-placeholder {
    color: #64748b; font-size: 13.5px; text-align: center;
    padding: 40px 12px; line-height: 1.6;
}
.ref-dash-chat .chat-msg,
.ref-dash-chat .dashboard-chat-preview-msg {
    border-radius: 12px;
    padding: 12px 14px;
    width: fit-content; max-width: 85%;
    margin-bottom: 12px;
    clear: both;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.05);
    color: #1f2937;
    font-size: 13px; line-height: 1.55;
}
.ref-dash-chat .chat-msg.user,
.ref-dash-chat .dashboard-chat-preview-msg.user {
    background: linear-gradient(90deg, #6B6EFF, #3AA3FF);
    color: #fff;
    float: right;
}
.ref-dash-chat .chat-msg.ai,
.ref-dash-chat .dashboard-chat-preview-msg.bot {
    background: #fff;
    float: left;
}
.ref-dash-chat .chat-input-wrap {
    display: flex; align-items: center;
    width: 100%; height: 53px;
    background: #fff; border-radius: 9px;
    box-shadow: 0 3px 6px rgba(61, 62, 116, 0.14);
    padding: 0 6px 0 18px; box-sizing: border-box;
    flex-shrink: 0;
}
.ref-dash-chat .chat-input-wrap input {
    flex: 1; border: 0; outline: none; background: transparent;
    font-size: 14px; font-family: inherit; color: #1f2937;
    height: 100%;
}
.ref-dash-chat .chat-input-wrap input::placeholder { color: #94a3b8; }
.ref-dash-chat .send-btn {
    width: 38px; height: 38px;
    border: 0; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: filter 0.15s ease;
}
.ref-dash-chat .send-btn:hover { filter: brightness(1.1); }
.ref-dash-chat .send-btn .material-symbols-outlined { font-size: 18px; }

/* 2단(데스크톱) 레이아웃에서만: 챗봇 카드 높이를 좌측 컬럼(통계 카드)에 맞추고
   메시지는 카드 내부에서 스크롤 → 카드/배경 이미지가 세로로 늘어나는 현상 방지.
   셀의 실제 높이는 0(자식이 absolute)이라 그리드 행 높이는 좌측 컬럼이 결정한다. */
@media (min-width: 1201px) {
    .ref-dash-section-1 .ref-dash-chat-cell {
        position: relative;
        min-height: 460px;
    }
    .ref-dash-section-1 .ref-dash-chat-cell > .ref-dash-chat {
        position: absolute;
        inset: 0;
        min-height: 0;
    }
}

/* === Section 2 — Light === */
.ref-dash-section-2 {
    background: #F1F5F9;
    padding: 36px 0 56px;
}
#dashboard .dashboard-row {
    display: flex; gap: 25px;
    width: 100%;
    margin-bottom: 25px;
}
#dashboard .dashboard-row:last-child { margin-bottom: 0; }
#dashboard .dashboard-row.nowrap > .dash-box {
    flex: 1 1 0; min-width: 0;
}
#dashboard .dashboard-row .wd-60 { flex: 0 0 calc(60% - 12.5px); min-width: 0; }
#dashboard .dashboard-row .wd-40 { flex: 0 0 calc(40% - 12.5px); min-width: 0; }
#dashboard .dashboard-row .wd-60,
#dashboard .dashboard-row .wd-40 {
    display: flex; flex-direction: column;
}
#dashboard .mg-b25 { margin-bottom: 25px !important; }

#dashboard .ref-dash-section-2 .dash-box {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 3px 10px rgba(224, 232, 241, 1);
    box-sizing: border-box;
}
#dashboard .dash-box > .title {
    display: flex; align-items: center; flex-wrap: wrap;
    margin-bottom: 20px;
}
#dashboard .dash-box > .title h2 {
    font-size: 20px; color: #0f172a; margin: 0 auto 0 0;
    font-weight: 700;
}
#dashboard .dash-box > .title .date {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: #64748b;
}
#dashboard .dash-box > .title .date p { margin: 0; }
#dashboard .dash-box > .title .view-more {
    font-weight: 500; color: #1AB1FF; font-size: 13px;
    text-decoration: none;
}
#dashboard .dash-box > .title .view-more:hover { text-decoration: underline; }

/* activity legend */
#dashboard .activity-legend {
    display: flex; gap: 14px; margin-bottom: 16px; padding: 0; list-style: none;
}
#dashboard .activity-legend > li {
    display: inline-flex; align-items: center; color: #475569; font-size: 13px;
}
#dashboard .activity-legend .status {
    display: inline-block; width: 12px; height: 12px;
    border-radius: 50%; margin-right: 6px;
    background: #C2CED9;
}
#dashboard .activity-legend .status--present { background: #0AC5A5; }
#dashboard .activity-legend .status--late    { background: #FFB92D; }
#dashboard .activity-legend .status--absent  { background: #FF6060; }
#dashboard .activity-legend .status--none    { background: #C2CED9; }

/* insight cards */
#dashboard .insight-wrap a {
    display: flex; align-items: center;
    background: #fff;
    border: 1px solid #D7DEE8;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
    padding: 15px;
    margin-bottom: 15px;
    text-decoration: none; color: inherit;
    transition: background 0.15s ease;
}
#dashboard .insight-wrap a:last-child { margin-bottom: 0; }
#dashboard .insight-wrap a:nth-child(4n+1) { border-left: 3px solid #0AC5A5; }
#dashboard .insight-wrap a:nth-child(4n+2) { border-left: 3px solid #6B6EFF; }
#dashboard .insight-wrap a:nth-child(4n+3) { border-left: 3px solid #1AB1FF; }
#dashboard .insight-wrap a:nth-child(4n+0) { border-left: 3px solid #FF6060; }
#dashboard .insight-wrap a:nth-child(4n+1):hover { background: #eaf9f6; }
#dashboard .insight-wrap a:nth-child(4n+2):hover { background: #f1f1ff; }
#dashboard .insight-wrap a:nth-child(4n+3):hover { background: #E1F0FF; }
#dashboard .insight-wrap a:nth-child(4n+0):hover { background: #fff3f6; }
#dashboard .insight-wrap a > .icon {
    width: 47px; text-align: center; flex-shrink: 0;
}
#dashboard .insight-wrap a > .icon img { max-width: 40px; }
#dashboard .insight-wrap a > dl {
    margin: 0 0 0 12px; flex: 1; min-width: 0;
}
#dashboard .insight-wrap a > dl > dt {
    font-size: 14.5px; font-weight: 600; color: #0f172a; margin-bottom: 3px;
}
#dashboard .insight-wrap a > dl > dd {
    font-size: 13px; color: #64748b; line-height: 1.4;
}
#dashboard .insight-wrap a > span.material-symbols-outlined {
    margin-left: auto; color: #94a3b8;
}

/* course list (대시보드 전용) */
#dashboard .course-list {
    list-style: none; padding: 0; margin: 0;
    display: block;
}
#dashboard .course-list > li {
    background: #fff;
    border: 1px solid #D7DEE8;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
#dashboard .course-list > li:last-child { margin-bottom: 0; }
#dashboard .course-list > li:hover { border-color: #1AB1FF; }
#dashboard .course-list .course-title {
    display: flex; width: 100%; align-items: center; gap: 8px;
    margin-bottom: 10px;
}
#dashboard .course-list .course-title > strong {
    margin: 0 auto 0 0; font-size: 14.5px; color: #0f172a;
    font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#dashboard .course-list .course-tag {
    border-radius: 30px;
    border: 1px solid #0AC5A5;
    background: #D8F2ED;
    padding: 2px 10px;
    font-size: 12px; color: #0AC5A5;
    font-weight: 500;
    flex-shrink: 0;
}
#dashboard .course-list .course-progress {
    display: flex; gap: 10px; align-items: center;
}
#dashboard .course-list .course-progress > span {
    color: #0AC5A5; font-weight: 600; font-size: 13px;
}
#dashboard .course-list .course-progress .progress-bar {
    flex: 1; height: 7px;
    background: #E4E9EF;
    overflow: hidden;
    position: relative;
    border-radius: 30px;
}
#dashboard .course-list .course-progress .progress-bar > span {
    display: block; height: 100%;
    border-radius: 30px;
    background: linear-gradient(90deg, #1AB1FF, #0AC5A5);
    position: absolute; top: 0; left: 0;
}

/* quiz list */
#dashboard .quiz-list {
    list-style: none; padding: 0; margin: 0;
    display: block;
}
#dashboard .quiz-list > li {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    background: #fff;
    border: 1px solid #D7DEE8;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
    padding: 17px;
    margin-bottom: 12px;
}
#dashboard .quiz-list > li:last-child { margin-bottom: 0; }
#dashboard .quiz-list > li > dl {
    margin: 0; flex: 1; min-width: 0;
}
#dashboard .quiz-list > li > dl > dt {
    font-size: 14.5px; font-weight: 600; color: #0f172a;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-bottom: 3px;
}
#dashboard .quiz-list > li > dl > dd {
    font-size: 13px; color: #64748b;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#dashboard .quiz-list > li > a.btn {
    min-width: 92px; line-height: 36px; height: 36px;
    border-radius: 7px; font-size: 13px;
    padding: 0 14px; gap: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; font-weight: 500;
}
#dashboard .quiz-list > li > a.btn.gray-btn {
    background: #A8B2C1; color: #fff;
}
#dashboard .quiz-list > li > a.btn.gray-btn:hover { background: #808C9C; }
#dashboard .quiz-list > li > a.btn.gradient-btn {
    background: linear-gradient(90deg, #1AB1FF, #0AC5A5); color: #fff;
}
#dashboard .quiz-list > li > a.btn.gradient-btn:hover { background: #1AB1FF; filter: brightness(1.05); }

/* notice */
#dashboard .notice-main {
    display: flex; gap: 15px; align-items: flex-start;
    border-bottom: 1px solid #D7DEE8;
    padding-bottom: 15px; margin-bottom: 10px;
    position: relative; padding-right: 70px;
}
#dashboard .notice-main .date {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 49px; height: 49px;
    background: #E1F0FF; color: #1AB1FF;
    border-radius: 8px;
    flex-shrink: 0;
}
#dashboard .notice-main .date > strong {
    font-size: 22px; font-weight: 600; line-height: 1;
}
#dashboard .notice-main .date > p {
    font-size: 11px; line-height: 1; margin: 2px 0 0;
}
#dashboard .notice-main dl { margin: 0; flex: 1; min-width: 0; }
#dashboard .notice-main dl > dt {
    font-size: 15.5px; font-weight: 600; color: #0f172a;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-bottom: 4px;
}
#dashboard .notice-main dl > dd {
    font-size: 13px; color: #64748b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#dashboard .notice-main .category {
    position: absolute; top: 0; right: 0;
    display: inline-block; width: auto; min-width: 57px;
    line-height: 22px; height: 24px;
    border-radius: 30px; text-align: center; padding: 0 10px 0 18px;
    font-weight: 500; font-size: 11.5px;
    box-sizing: border-box;
}
#dashboard .notice-main .category.important {
    background: #FFE3E3; border: 1px solid #FF6060; color: #ff6060;
}
#dashboard .notice-main .category.basic {
    background: #E1F0FF; border: 1px solid #1AB1FF; color: #1AB1FF;
}
#dashboard .notice-main .category > i {
    display: block; width: 8px; height: 8px;
    border-radius: 50%; font-size: 0;
    position: absolute; top: 7px; left: 7px;
}
#dashboard .notice-main .category.important > i { background: #FF6060; }
#dashboard .notice-main .category.basic > i { background: #1AB1FF; }
#dashboard .notice-list {
    list-style: none; padding: 0; margin: 0;
    display: block; gap: 0;
}
#dashboard .notice-list > li {
    padding: 10px 0;
    border-bottom: 1px solid #D7DEE8;
    display: flex; gap: 12px; align-items: center;
}
#dashboard .notice-list > li:last-child { border-bottom: 0; }
#dashboard .notice-list > li > a {
    color: #0f172a; font-size: 13.5px;
    flex: 1; min-width: 0;
    text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#dashboard .notice-list > li > a:hover { color: #1AB1FF; }
#dashboard .notice-list > li > p {
    margin: 0; color: #94a3b8; font-size: 12px;
    flex-shrink: 0;
}

/* literacy survey */
#dashboard .survey-wrap {
    display: flex; gap: 15px; align-items: center;
    text-decoration: none; color: inherit;
    padding: 6px 0;
}
#dashboard .survey-wrap .img-section {
    width: 64px; height: 64px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
#dashboard .survey-wrap .img-section img { max-width: 100%; max-height: 100%; }
#dashboard .survey-wrap dl { margin: 0; flex: 1; min-width: 0; }
#dashboard .survey-wrap dl dt {
    font-size: 15.5px; font-weight: 600; color: #0f172a;
    margin-bottom: 4px;
}
#dashboard .survey-wrap dl dd {
    font-size: 13px; color: #64748b; line-height: 1.5;
}

/* activity heatmap (기존 마크업과 호환) */
#dashboard .activity-heatmap {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
    margin-bottom: 16px;
}
#dashboard .activity-heatmap .activity-cell {
    aspect-ratio: 1 / 1;
    border: 1px solid #D7DEE8; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: transform 0.15s ease;
    background: #fff;
}
#dashboard .activity-heatmap .activity-cell:hover { transform: translateY(-2px); }
#dashboard .activity-heatmap .activity-cell.is-today {
    border-color: #1AB1FF; box-shadow: inset 0 0 0 1px #1AB1FF; background: #E1F0FF; color: #1AB1FF;
}
#dashboard .activity-heatmap .activity-cell.is-present { border-color: #0AC5A5; background: #D8F2ED; color: #0AC5A5; }
#dashboard .activity-heatmap .activity-cell.is-late    { border-color: #FFB92D; background: #FFF7E0; color: #b45309; }
#dashboard .activity-heatmap .activity-cell.is-absent  { border-color: #FF6060; background: #FFE3E3; color: #b91c1c; }
#dashboard .activity-heatmap .activity-day-label { font-size: 11px; color: inherit; opacity: 0.7; }
#dashboard .activity-heatmap .activity-day-num   { font-size: 16px; font-weight: 700; }

/* 반응형 */
@media (max-width: 1200px) {
    .ref-dash-section-1 .ref-dash-container { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
    #dashboard .dashboard-row { flex-direction: column; }
    #dashboard .dashboard-row .wd-60,
    #dashboard .dashboard-row .wd-40 { flex: 1 1 auto; width: 100%; }
}
@media (max-width: 640px) {
    .ref-dash-container { padding: 0 16px; }
    .ref-dash-section-1 { padding: 24px 0 32px; }
    .ref-dash-section-2 { padding: 24px 0 32px; }
    .ref-dash-welcome .title h2 { font-size: 22px; }
    .ref-dash-welcome-desc { font-size: 14px; margin-bottom: 28px; }
    .ref-dash-quick { grid-template-columns: 1fr; }
    .ref-dash-quick > a { min-height: 120px; padding: 18px; }
    .ref-dash-quick > a > dl > dd > strong { font-size: 32px; }
    .ref-dash-quick > a > .icon { width: 64px; height: 64px; }
    .ref-dash-chat { min-height: 380px; }
    #dashboard .dash-box { padding: 18px; }
    #dashboard .dash-box > .title h2 { font-size: 17px; }
}

/* =====================================================================
   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-messages)과 영상 내 챗봇(.video-chat-messages)에 동일 적용 */
.chatbot-messages .chat-turn,
.video-chat-messages .chat-turn { margin-bottom: 4px; }
/* 턴 안 마지막 말풍선의 여백 제거 — 영상 챗봇은 컨테이너 gap 으로 간격을 준다 */
.video-chat-messages .chat-turn > .chat-msg:last-child { margin-bottom: 0; }
/* 질문 말풍선: 텍스트 + 삭제 버튼 가로 배치 (hover 시 삭제 버튼 노출) */
.chatbot-messages .chat-msg.user,
.video-chat-messages .chat-msg.user {
    display: flex; align-items: flex-start; gap: 8px;
}
.chatbot-messages .chat-msg.user .chat-msg-text,
.video-chat-messages .chat-msg.user .chat-msg-text { min-width: 0; word-break: break-word; }
.chatbot-messages .chat-msg-del,
.video-chat-messages .chat-msg-del {
    flex-shrink: 0; border: 0; background: transparent; cursor: pointer;
    color: rgba(255,255,255,0.75); padding: 0; line-height: 1;
    opacity: 0; transition: opacity .15s ease, color .15s ease;
}
.chatbot-messages .chat-msg.user:hover .chat-msg-del,
.video-chat-messages .chat-msg.user:hover .chat-msg-del { opacity: 1; }
.chatbot-messages .chat-msg-del:hover,
.video-chat-messages .chat-msg-del:hover { color: #fff; }
.chatbot-messages .chat-msg-del .material-symbols-outlined,
.video-chat-messages .chat-msg-del .material-symbols-outlined { font-size: 16px; }
.chatbot-messages .chat-msg.bot.chat-pending { color: var(--text-muted); font-style: italic; }
/* 챗봇 '답변 생성 중...' 로딩 표시 (애니메이션 점) */
.chat-typing-dots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.chat-typing-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: 0.35;
    animation: chatTyping 1.2s infinite ease-in-out both;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatTyping {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}
.chat-msg.bot.chat-pending, .dashboard-chat-preview-msg.bot.chat-pending {
    color: var(--text-muted); font-style: italic;
}
/* 원문 보기 토글 버튼 */
.chatbot-messages .chat-src-wrap { margin-top: 10px; }
.chatbot-messages .chat-src-btn {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; color: var(--primary);
    background: var(--primary-light); border: 1px solid var(--border-light);
    border-radius: 999px; padding: 5px 12px; cursor: pointer;
    font-family: inherit;
}
.chatbot-messages .chat-src-btn:hover { filter: brightness(0.97); }
.chatbot-messages .chat-src-btn .material-symbols-outlined { font-size: 15px; }

/* ===== 원문 보기 우측 드로어 (Sphinx AI Talk '원문' 패널 벤치마킹) ===== */
.src-drawer-overlay {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(15, 23, 42, 0); transition: background .22s ease;
}
.src-drawer-overlay.open { background: rgba(15, 23, 42, 0.38); }
.src-drawer {
    position: absolute; top: 0; right: 0; height: 100%;
    width: 460px; max-width: 92vw;
    background: var(--bg-card);
    box-shadow: -8px 0 30px rgba(15, 23, 42, 0.18);
    display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .22s ease;
}
.src-drawer-overlay.open .src-drawer { transform: translateX(0); }
.src-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.src-drawer-title { font-size: 20px; font-weight: 800; color: var(--text); }
.src-drawer-close {
    border: 0; background: transparent; cursor: pointer; padding: 4px;
    color: var(--text-muted); line-height: 1; border-radius: 8px;
    display: inline-flex; transition: background .15s, color .15s;
}
.src-drawer-close:hover { background: var(--bg-surface); color: var(--text); }
.src-drawer-body {
    flex: 1; overflow-y: auto; padding: 8px 24px 24px;
}
.src-drawer-loading, .src-drawer-empty {
    color: var(--text-muted); font-size: 14px; padding: 28px 4px; text-align: center;
}
/* 출처 카드 */
.src-card { padding: 20px 0; border-bottom: 1px solid var(--border-light); }
.src-card:last-child { border-bottom: 0; }
.src-card-head {
    display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px;
}
.src-card-name {
    flex: 1; min-width: 0; font-size: 15px; font-weight: 700;
    color: var(--primary); word-break: break-word;
}
.src-card-page { flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.src-card-cont {
    font-size: 14px; line-height: 1.7; color: var(--text-secondary);
    white-space: pre-wrap; word-break: break-word;
}
.src-card-foot { margin-top: 14px; }
.src-card-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--primary);
    border: 1px solid var(--primary); border-radius: 8px; padding: 5px 12px;
}
.src-card-badge .material-symbols-outlined { font-size: 16px; color: #e2574c; }

@media (max-width: 640px) {
    .src-drawer { width: 100%; max-width: 100%; }
}
.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 — 영상 좌측 / PDF 교안 우측 2단 split 레이아웃
   ===================================================================== */
/* 영상 화면에서는 main-content 의 max-width 를 풀어서 split 공간 확보 */
body:has(#video-player.screen.active) .main-content {
    max-width: 1800px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}
.video-split-back {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}
.video-split-back:hover { color: var(--primary); }
.video-split {
    display: grid;
    /* 3 컬럼: 좌측영상 / 리사이저(22px = 기존 gap 크기) / 우측PDF
       --video-split-left 는 JS 가 드래그로 갱신 (기본은 1.2fr) */
    grid-template-columns:
        minmax(420px, var(--video-split-left, 1.2fr))
        22px
        minmax(360px, 1fr);
    gap: 0;
    column-gap: 0;
    align-items: start;
}

/* 가운데 드래그 리사이저 */
.video-split-resizer {
    position: relative;
    align-self: stretch;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    background: transparent;
    outline: none;
}
.video-split-resizer::before {
    content: '';
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    transform: translateX(-50%);
    width: 4px; border-radius: 2px;
    background: var(--border);
    transition: background 0.15s ease, width 0.15s ease;
}
.video-split-resizer:hover::before,
.video-split-resizer:focus-visible::before,
.video-split-resizer.is-dragging::before {
    background: var(--primary);
    width: 5px;
}
.video-split-resizer-grip {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 24px; height: 44px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; /* 클릭은 리사이저로 통과 */
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.video-split-resizer:hover .video-split-resizer-grip,
.video-split-resizer.is-dragging .video-split-resizer-grip {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.video-split-resizer-grip::before {
    content: '';
    width: 2px; height: 16px;
    background: var(--text-muted);
    border-radius: 1px;
    box-shadow: -4px 0 0 var(--text-muted), 4px 0 0 var(--text-muted);
}
.video-split-resizer:hover .video-split-resizer-grip::before,
.video-split-resizer.is-dragging .video-split-resizer-grip::before {
    background: var(--primary);
    box-shadow: -4px 0 0 var(--primary), 4px 0 0 var(--primary);
}

/* 드래그 중에는 좌·우 안의 iframe/canvas 가 마우스 이벤트 가로채지 않도록 */
.video-split.is-resizing { user-select: none; }
.video-split.is-resizing iframe,
.video-split.is-resizing canvas,
.video-split.is-resizing .plyr,
.video-split.is-resizing .pdf-viewer-pages {
    pointer-events: none;
}
.video-split-left { margin-bottom: 0; }
.video-split-right {
    position: sticky;
    top: 90px;             /* 헤더 높이 고려 */
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.video-split-right .video-split-mode {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;   /* flex 자식이 부모 높이 안에 맞춰 스크롤되도록 */
}
.video-split-pdf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
}
.video-split-pdf-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
}
.video-split-pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.video-split-pdf-toolbar .btn {
    padding: 6px 10px; font-size: 12px; min-width: 0;
}
.video-split-pdf-toolbar .pdf-viewer-pagenum {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 6px;
    min-width: 56px;
    text-align: center;
}
.video-split-pdf-toolbar .pdf-viewer-divider {
    width: 1px; height: 18px;
    background: var(--border);
    margin: 0 4px;
}
.video-split-pdf-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px;
    background: #f8fafc;
    position: relative;
}
.video-split-pdf-scroll .pdf-viewer-pages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.video-split-pdf-scroll .pdf-viewer-page {
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}
.video-split-pdf-scroll .pdf-viewer-page canvas {
    display: block;
    max-width: 100%;
    height: auto;
}
.video-split-pdf-scroll .pdf-viewer-page-meta {
    display: flex; justify-content: space-between;
    padding: 4px 10px; font-size: 11px; color: var(--text-muted);
    background: #f1f5f9;
}
.video-split-pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    padding: 60px 24px;
    height: 100%;
    min-height: 320px;
}
.video-split-pdf-placeholder .placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.4;
}
.video-split-pdf-placeholder p {
    font-size: 13.5px;
    line-height: 1.7;
    margin: 0;
}
.video-split-pdf-placeholder strong {
    color: var(--primary);
    font-weight: 700;
}
.video-split-pdf-scroll .pdf-viewer-loading {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 13px;
}

/* === 우측 챗봇 모드 (AI 챗봇 탭 클릭 시) === */
.video-split-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, #eef2ff 0%, #ecfeff 100%);
    flex-shrink: 0;
}
.video-split-chat-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #818cf8, #38bdf8);
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px;
    color: #fff;
}
.video-split-chat-title {
    flex: 1;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}
.video-split-chat-online {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: #16a34a;
    background: #f0fdf4; padding: 4px 10px; border-radius: 999px;
    border: 1px solid #bbf7d0;
}
.video-split-chat-online .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #16a34a;
    animation: pcDashPulse 1.6s ease-in-out infinite;
}
.video-split-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    background: #f8fafc;
    min-height: 0;
}
.video-split-chat-body .video-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}
.video-split-chat-body .video-chat-messages:empty::before {
    content: '강의 내용에 대해 자유롭게 질문해 보세요. 예) 이번 챕터의 핵심 개념은 뭐예요?';
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 32px 12px;
    line-height: 1.6;
}
.video-split-chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}
.video-split-chat-input .input {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0 14px;
    font-size: 13.5px;
    font-family: inherit;
    background: var(--bg-surface);
    color: var(--text);
}
.video-split-chat-input .input:focus {
    outline: 2px solid rgba(99, 102, 241, 0.25);
    border-color: var(--primary);
}
.video-split-chat-input .btn {
    flex-shrink: 0;
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

/* 반응형: 1024px 이하(태블릿 이하)에서만 1열로 stack. 노트북·데스크탑은 항상 2단 */
@media (max-width: 1024px) {
    .video-split {
        grid-template-columns: 1fr;
    }
    .video-split-resizer { display: none; }   /* stack 모드에서는 리사이저 숨김 */
    .video-split-right {
        position: static;
        max-height: 70vh;
    }
}

/* =====================================================================
   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;
    /* 출처 드로어(.src-drawer-overlay, 1100)에서 열리는 상위 모달이므로 그보다 위.
       단 토스트(1500)보다는 아래로 둔다. */
    z-index: 1200;
    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; }
}

/* 스트리밍 답변 생성 중 표시되는 커서 */
.chat-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    vertical-align: -0.12em;
    background: currentColor;
    opacity: 0.65;
    animation: chatTypingCursorBlink 1s steps(2, start) infinite;
}
@keyframes chatTypingCursorBlink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
    .chat-typing-cursor { animation: none; }
}

/* 답변 생성 중 로딩바 (로고 + 진행 막대). 스트리밍이 끝나면 제거된다. */
.chat-loading-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 4px 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
}
.chat-loading-bar-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex: 0 0 auto;
    animation: chatLoadingLogoPulse 1.6s ease-in-out infinite;
}
.chat-loading-bar-track {
    position: relative;
    flex: 1 1 auto;
    height: 4px;
    min-width: 60px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    overflow: hidden;
}
.chat-loading-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 38%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary, var(--primary)));
    animation: chatLoadingBarSweep 1.25s ease-in-out infinite;
}
.chat-loading-bar-text {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
.chat-loading-bar--compact { margin: 6px 0 2px 0; padding: 6px 10px; }
.chat-loading-bar--compact .chat-loading-bar-logo { width: 18px; height: 18px; }
.chat-loading-bar--compact .chat-loading-bar-text { font-size: 11px; }

@keyframes chatLoadingBarSweep {
    0%   { left: -40%; }
    100% { left: 100%; }
}
@keyframes chatLoadingLogoPulse {
    0%, 100% { opacity: 0.55; transform: scale(0.94); }
    50%      { opacity: 1;    transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .chat-loading-bar-logo { animation: none; opacity: 1; }
    .chat-loading-bar-fill { animation: none; width: 100%; opacity: 0.5; }
}

/* 출처 카드의 P.n 배지를 눌러 pdf.js 뷰어로 원문을 여는 버튼 */
.src-card-badge--link {
    cursor: pointer;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
    background: color-mix(in srgb, var(--primary) 7%, transparent);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    font: inherit;
}
.src-card-badge--link:hover {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
.src-card-badge--link:active { transform: translateY(1px); }
.src-card-badge--link:disabled { opacity: 0.6; cursor: progress; }
.src-card-badge--link.is-loading .material-symbols-outlined {
    animation: chatLoadingLogoPulse 1s ease-in-out infinite;
}
