/* ============================================================================
   GoalSkill - 3-Panel Chat Layout (Claude-inspired)
   Color scheme based on login page pastel gradients
   ============================================================================ */

/* --- Color Variables --- */
:root {
    --bg-gradient-1: #e8e3f3;
    --bg-gradient-2: #FFEBF0;
    --bg-gradient-3: #fffbeb;
    --c-body-pink: #FFEBF0;
    --c-mint: #a7f3d0;
    --c-mint-dark: #6ee7b7;
    --c-cream: #fffbeb;
    --c-lavender: #e9d5ff;
    --c-lavender-dark: #c4b5fd;
    --c-knob-blue: #bae6fd;
    --c-knob-yellow: #fde68a;
    --c-knob-pink: #fbcfe8;
    --c-heart-red: #ff90a4;
    --c-shadow-light: rgba(255, 255, 255, 0.6);
    --c-shadow-dark: rgba(0, 0, 0, 0.15);
    --c-text-grey: #71717a;
    --c-text-dark: #334155;
    --c-input-bg: #fff;
    --c-border: #e2e8f0;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 56px;
    --keyboard-width: 230px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-speed: 0.3s;

    --app-zoom: 1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100vh;
    width: 100vw;
    font-family: 'Noto Sans JP', 'M PLUS Rounded 1c', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, var(--bg-gradient-3) 100%);
    overflow: hidden;
}

/* ============================================================================
   APP LAYOUT - 3 Panel Flexbox
   ============================================================================ */
.app-layout {
    display: flex;
    zoom: var(--app-zoom);
    height: calc(100vh / var(--app-zoom));
    width: calc(100vw / var(--app-zoom));
}

/* ============================================================================
   LEFT SIDEBAR
   ============================================================================ */
.sidebar {
    display: none !important;
}

#component-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sidebar-collapsed {
    display: none !important;
}

.sidebar-expand-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--c-text-grey);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-expand-btn:hover {
    background: rgba(233, 213, 255, 0.3);
    color: var(--c-text-dark);
}

/* Sidebar Header */
.sidebar-header {
    padding: 16px 16px 8px;
}

.sidebar-logo-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--c-text-dark);
    letter-spacing: -0.5px;
}

.sidebar-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
}

.sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--c-text-grey);
    font-size: 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-btn:hover {
    background: rgba(233, 213, 255, 0.3);
    color: var(--c-text-dark);
}

/* Sidebar Search */
.sidebar-search {
    padding: 8px 16px 12px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 13px;
    color: #cbd5e1;
    pointer-events: none;
    transition: color 0.2s;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    color: var(--c-text-dark);
    background: rgba(255, 255, 255, 0.6);
    outline: none;
    transition: all 0.25s;
}

.search-input:focus {
    border-color: var(--c-lavender);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(233, 213, 255, 0.2);
}

.search-input:focus+.search-icon,
.search-input:not(:placeholder-shown)+.search-icon {
    color: var(--c-lavender-dark);
}

.search-input::placeholder {
    color: #cbd5e1;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 4px 12px;
    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--c-text-grey);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.sidebar-nav-item:hover {
    background: rgba(233, 213, 255, 0.2);
    color: var(--c-text-dark);
}

.sidebar-nav-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: var(--c-border);
    margin: 8px 16px;
}

/* Sidebar Chat Logs */
.sidebar-chat-logs {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 16px;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-section-title i {
    font-size: 12px;
}

.chat-log-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--c-text-grey);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-log-item:hover {
    background: rgba(167, 243, 208, 0.15);
    color: var(--c-text-dark);
}

.chat-log-item.active {
    background: rgba(233, 213, 255, 0.25);
    color: var(--c-text-dark);
    font-weight: 600;
}

.chat-log-item i {
    font-size: 13px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* Chat log title (ellipsis) */
.chat-log-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Day label (Day 1, Day 2, オンボーディング, etc.) */
.chat-log-date-label {
    padding: 10px 12px 4px;
    font-size: 10px;
    font-weight: 800;
    color: #6d28d9;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-log-date-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 10px;
    background: linear-gradient(135deg, var(--c-lavender-dark), #a78bfa);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Emoji icon in chat-log-item */
.chat-log-day-icon {
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1;
}

/* Delete button (appears on hover) */
.chat-log-delete-btn {
    opacity: 0;
    border: none;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-log-item:hover .chat-log-delete-btn {
    opacity: 1;
}

.chat-log-delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Loading state */
.chat-log-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    color: #94a3b8;
    font-size: 12px;
}

/* Empty state */
.chat-log-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    color: #cbd5e1;
    font-size: 12px;
}

/* Scrollbar for sidebar */
.sidebar-chat-logs::-webkit-scrollbar {
    width: 4px;
}

.sidebar-chat-logs::-webkit-scrollbar-thumb {
    background: var(--c-lavender);
    border-radius: 10px;
}

.sidebar-chat-logs::-webkit-scrollbar-track {
    background: transparent;
}

/* Sidebar Shortcut Buttons (Quick Access) */
.sidebar-shortcut-area {
    flex-shrink: 0;
    padding: 0 12px 16px;
}

.sidebar-shortcut-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
}

.sidebar-shortcut-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.sidebar-shortcut-btn i {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-shortcut-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Curriculum button style */
.shortcut-curriculum {
    background: linear-gradient(135deg, rgba(196, 181, 253, 0.3), rgba(233, 213, 255, 0.45));
    color: #6d28d9;
}

.shortcut-curriculum:hover {
    background: linear-gradient(135deg, rgba(196, 181, 253, 0.5), rgba(233, 213, 255, 0.65));
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(196, 181, 253, 0.3);
}

.shortcut-curriculum:active {
    transform: translateX(1px) scale(0.98);
}

/* Daily check button style */
.shortcut-daily {
    background: linear-gradient(135deg, rgba(167, 243, 208, 0.3), rgba(110, 231, 183, 0.3));
    color: #047857;
}

.shortcut-daily:hover {
    background: linear-gradient(135deg, rgba(167, 243, 208, 0.5), rgba(110, 231, 183, 0.5));
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(167, 243, 208, 0.3);
}

.shortcut-daily:active {
    transform: translateX(1px) scale(0.98);
}

/* Sidebar Profile Area */
.sidebar-profile-area {
    flex-shrink: 0;
    padding: 0 12px 12px;
    position: relative;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-profile:hover {
    background: rgba(233, 213, 255, 0.15);
}

.sidebar-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-lavender), var(--c-knob-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    color: #6d28d9;
    font-weight: 700;
}

.sidebar-profile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-profile-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.sidebar-profile-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile-day {
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--c-lavender-dark), #a78bfa);
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.sidebar-profile-id {
    font-size: 11px;
    color: var(--c-text-grey);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile-menu-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--c-text-grey);
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
}

.sidebar-profile:hover .sidebar-profile-menu-btn {
    opacity: 1;
}

.sidebar-profile-menu-btn:hover {
    background: rgba(233, 213, 255, 0.3);
    color: var(--c-text-dark);
}

/* Profile Dropdown */
.sidebar-profile-dropdown {
    position: absolute;
    bottom: 60px;
    left: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    z-index: 100;
    animation: dropdownSlideUp 0.15s ease;
}

@keyframes dropdownSlideUp {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-grey);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.sidebar-dropdown-item:hover {
    background: rgba(255, 144, 164, 0.1);
    color: #dc2626;
}

.sidebar-dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

/* ============================================================================
   CENTER: MAIN CHAT AREA
   ============================================================================ */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.4);
    align-items: center;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Display Bar (Top carousel) --- */
.display-bar {
    padding: 10px 20px 6px;
    flex-shrink: 0;
}

.display-content {
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 10px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-height: 42px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.display-item {
    display: none;
    align-items: center;
    gap: 10px;
    width: 100%;
    animation: displayFadeIn 0.5s ease;
}

.display-item.active {
    display: flex;
}

@keyframes displayFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.display-icon {
    font-size: 16px;
    color: var(--c-lavender-dark);
    min-width: 20px;
    text-align: center;
}

.display-text {
    font-size: 13px;
    color: var(--c-text-dark);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.display-dots {
    display: none;
}

/* --- Split-View Container --- */
.split-view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    position: relative;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-view-container.active {
    flex-direction: row;
    align-items: stretch;
}

/* --- Chat Column (Wraps Area + Input) --- */
.chat-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    position: relative;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Chat Area --- */
.chat-area {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.chat-screen {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* ★ 버블 영역 중앙 정렬 */
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}

/* Scrollbar for chat */
.chat-screen::-webkit-scrollbar {
    width: 5px;
}

.chat-screen::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

.chat-screen::-webkit-scrollbar-track {
    background: transparent;
}

/* Message Bubbles */
.message {
    display: flex;
    margin-bottom: 4px;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.bubble {
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 75%;
    font-size: 16px;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    word-break: break-word;
}

/* marked.js が生成する <p> タグのマージンをリセット */
.bubble p {
    margin: 0 0 6px 0;
}

.bubble p:last-child {
    margin-bottom: 0;
}

.bubble br {
    display: block;
    margin-bottom: 4px;
    content: "";
}

.message.bot .bubble {
    background-color: #ffc4d0;
    color: #333;
    border-top-left-radius: 6px;
}

/* ── カテゴリー別バブルカラー ── */
/* condition — コーラルピンク */
.message.bot.cat-condition .bubble {
    background-color: #ffd6df;
}

/* findgoal — イエロー */
.message.bot.cat-findgoal .bubble {
    background-color: #ffd6df;
}

/* summary — ミント */
.message.bot.cat-summary .bubble {
    background-color: #ffd6df;
}

/* studyplan — グリーン */
.message.bot.cat-studyplan .bubble {
    background-color: #ffd6df;
}

/* general — ライム */
.message.bot.cat-general .bubble {
    background-color: #ffd6df;
}

/* journal — スカイブルー */
.message.bot.cat-journal .bubble {
    background-color: #bfdbfe;
}

/* curriculum — ラベンダー */
.message.bot.cat-curriculum .bubble {
    background-color: #ddd6fe;
}

/* mbti — ライトパープル */
.message.bot.cat-mbti .bubble {
    background-color: #ede9fe;
}

/* it — インディゴブルー */
.message.bot.cat-it .bubble {
    background-color: #c7d2fe;
}

/* spi — シアン */
.message.bot.cat-spi .bubble {
    background-color: #a7f3caad
}

/* selfpr — ローズピンク */
.message.bot.cat-selfpr .bubble {
    background-color: #fbcfe8;
}

/* interview — ティール */
.message.bot.cat-interview .bubble {
    background-color: #99f6e4;
}

/* quiz — アンバー */
.message.bot.cat-quiz .bubble {
    background-color: #fde68a;
}

/* company_info — スレート */
.message.bot.cat-company_info .bubble {
    background-color: #e2e8f0;
}

/* Content cards (YouTube, PPT, Quiz buttons) - outside bubbles */
.content-card {
    padding: 4px 15px;
    max-width: 40%;
}

.content-card.content-media {
    max-width: 60%;
}

.message.user .bubble {
    background-color: var(--c-cream);
    color: #333;
    border-bottom-right-radius: 6px;
}

/* ============================================================================
   Chat Dividers
   ============================================================================ */
.chat-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 10px;
    position: relative;
    width: 100%;
}

.chat-divider::before,
.chat-divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px dashed rgba(233, 213, 255, 0.6);
}

.chat-divider span {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    margin: 0 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.chat-divider span i {
    margin-right: 4px;
    color: #c4b5fd;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Chat Input Bar --- */
.chat-input-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 16px;
    margin: 0 20px;
    /* horizontal margin = chat-screen horizontal padding */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid var(--c-border);
    border-radius: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 820px;
}

.chat-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(241, 245, 249, 0.8);
    color: var(--c-text-grey);
    font-size: 15px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-action-btn:hover {
    background: var(--c-lavender);
    color: var(--c-text-dark);
    transform: scale(1.05);
}



.chat-action-btn.keyboard-toggle-btn.active {
    background: var(--c-lavender);
    color: #5b21b6;
}

/* 마이크/전송 토글 버튼 */
.mic-send-btn {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}

.mic-send-btn.send-mode {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    transform: scale(1.05);
}

.mic-send-btn.send-mode:hover {
    background: linear-gradient(135deg, #6d28d9, #4c1d95);
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.mic-send-btn.recording {
    background: #ef4444;
    color: #fff;
    animation: micPulse 1.2s ease-in-out infinite;
}

@keyframes micPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* 아이콘 전환 애니메이션 */
.mic-send-btn i {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.15s ease;
    display: inline-block;
}

.mic-send-btn.animating i {
    transform: scale(0) rotate(90deg);
    opacity: 0;
}


/* ★ 새 단일 행 레이아웃 */
.chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chat-input-wrapper {
    flex: 1;
    min-width: 0;
}

.chat-input {
    width: 100%;
    height: auto;
    min-height: 72px;
    /* Increased to better align with the guide's vertical height */
    max-height: 120px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: var(--c-text-dark);
    background: transparent;
    outline: none;
    transition: all 0.25s;
    resize: none;
    overflow-y: auto;
}

.chat-input:focus {
    background: rgba(241, 245, 249, 0.5);
}

.chat-input::placeholder {
    color: #cbd5e1;
}


/* + 이미지 버튼 */
.chat-image-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100% !important;
    padding: 0 !important;
    border-radius: 12px !important;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    height: 32px;
    background: rgba(241, 245, 249, 0.9) !important;
    border: 1px solid var(--c-border) !important;
    color: var(--c-text-grey) !important;
}

.chat-image-btn:hover {
    background: var(--c-lavender) !important;
    border-color: #c4b5fd !important;
    color: var(--c-lavender-dark) !important;
}

.chat-image-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Right side actions (stacked) */
.chat-input-actions-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

.chat-input-actions-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.chat-input-actions-bottom {
    display: flex;
    width: 100%;
}

/* Old actions row - kept for fallback */
.chat-input-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

/* ★ Chat input bar wrapper */
.chat-input-bar-wrapper {
    flex-shrink: 0;
    padding-bottom: 8px;
    width: 100%;
    display: flex;
    justify-content: center;
    /* ★ 버블 영역(860px)과 완벽히 일치하는 최대 너비 */
    max-width: 860px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ★ Button Guide card — Glassmorphism UI */
.chat-btn-guide {
    position: absolute;
    /* 중앙 정렬된 채팅바(860px)의 우측에 10px 간격을 두고 배치 */
    left: calc(50% + 440px);
    bottom: 8px;
    width: max-content;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid var(--c-border);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 100;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hide in split-mode completely */
.split-view-container.split-mode .chat-btn-guide {
    display: none !important;
}

/* Guide box transition classes */
.chat-btn-guide.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
}

/* Guide items inside the card */
.guide-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 4px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.guide-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.guide-item i {
    font-size: 14px;
    width: 18px;
    text-align: center;
    color: #4f46e5;
    /* Theme Blue/Indigo */
    flex-shrink: 0;
}

/* Special pulse animation for diagnostic STT mic */
.guide-item i.mic-pulse {
    font-size: 18px;
    color: #7c3aed;
    /* Purple for diagnostic accent */
    animation: sttMicPulse 2s ease-in-out infinite;
}

.guide-action {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    white-space: normal;
    word-break: keep-all;
    line-height: 1.4;
}

/* ★ 아이템 수에 따른 가이드 박스 크기 자동 조절 (채팅바 높이 맞춤) */
.chat-btn-guide[data-count="2"] {
    gap: 8px;
    padding: 10px 18px;
}

.chat-btn-guide[data-count="2"] .guide-action {
    font-size: 15px;
}

.chat-btn-guide[data-count="2"] .guide-item i {
    font-size: 18px;
    width: 24px;
}

.chat-btn-guide[data-count="2"] .guide-item {
    padding: 6px 10px;
}

.chat-btn-guide[data-count="1"] {
    gap: 0;
    padding: 18px 20px;
}

.chat-btn-guide[data-count="1"] .guide-action {
    font-size: 18px;
}

.chat-btn-guide[data-count="1"] .guide-item i {
    font-size: 22px;
    width: 28px;
}

.chat-btn-guide[data-count="1"] .guide-item {
    padding: 12px 14px;
}

@keyframes sttMicPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

/* File Attachment Preview */
.file-attach-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    background: rgba(233, 213, 255, 0.15);
    border-radius: 8px;
    font-size: 13px;
    color: var(--c-text-dark);
    animation: fadeIn 0.2s ease;
}

.file-attach-preview i {
    color: var(--c-lavender-dark);
    font-size: 14px;
}

.file-attach-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.file-attach-remove {
    background: none;
    border: none;
    color: var(--c-text-grey);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.file-attach-remove:hover {
    color: var(--c-heart-red);
    background: rgba(255, 144, 164, 0.1);
}

/* ============================================================================
   OVERLAY MODAL SYSTEM (PDF & Analysis)
   ============================================================================ */
.gs-overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.gs-overlay-modal.active {
    opacity: 1;
    visibility: visible;
}

.gs-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gs-overlay-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    max-height: 95vh;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.gs-overlay-modal.active .gs-overlay-content {
    transform: scale(1) translateY(0);
}

.gs-overlay-pdf {
    width: 96%;
    max-width: 96vw;
    height: 92vh;
}

.gs-overlay-analysis {
    width: 96%;
    max-width: 1200px;
}

.gs-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(233, 213, 255, 0.25), rgba(186, 230, 253, 0.25));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.gs-overlay-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    color: var(--c-text-dark);
}

.gs-overlay-title i {
    color: var(--c-lavender-dark);
    font-size: 18px;
}

.gs-overlay-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gs-overlay-link {
    font-size: 12px;
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.gs-overlay-link:hover {
    opacity: 0.7;
}

.gs-overlay-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(241, 245, 249, 0.8);
    color: var(--c-text-grey);
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gs-overlay-close:hover {
    background: rgba(255, 144, 164, 0.15);
    color: var(--c-heart-red);
}

.gs-overlay-body {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.gs-overlay-pdf .gs-overlay-body {
    padding: 0;
}

.gs-overlay-pdf .gs-overlay-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.gs-overlay-analysis .gs-overlay-body {
    padding: 12px 16px;
}

.gs-overlay-calendar {
    width: 96%;
    max-width: 90vw;
    max-height: 92vh;
}

.gs-overlay-calendar .gs-overlay-body {
    padding: 16px;
    overflow-y: auto;
}

.gs-calendar-date {
    padding: 6px 12px;
    border: 2px solid var(--c-lavender);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    color: #555;
    outline: none;
    cursor: pointer;
    background: white;
}

.gs-calendar-date:focus {
    border-color: var(--c-lavender-dark);
    box-shadow: 0 0 0 3px rgba(196, 181, 253, 0.2);
}

/* ============================================================================
   PROGRESS MODAL — Dual Card (CERT / PJT) Layout
   ============================================================================ */
.gs-progress-modal {
    width: 96%;
    max-width: 90vw;
    padding: 0;
    background: #fdfdfd;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
}

.gs-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.gs-progress-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05em;
    font-weight: 800;
    color: white;
}

.gs-progress-header-title i {
    font-size: 1.1em;
}

.gs-progress-close {
    color: white !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.gs-progress-close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.gs-progress-body {
    padding: 16px 16px 20px 16px;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.gs-progress-body::-webkit-scrollbar {
    width: 6px;
}

.gs-progress-body::-webkit-scrollbar-track {
    background: transparent;
}

.gs-progress-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.gs-progress-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.gs-progress-loading {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.gs-progress-loading i {
    font-size: 28px;
    color: #6366f1;
}

/* ── Dual Cards Row ── */
.gs-progress-dual-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}

/* ── Individual Card ── */
.gs-progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    animation: progressCardIn 0.4s ease both;
}

.gs-progress-card-cert {
    background: linear-gradient(160deg, #f4f0ff 0%, #ede9fe 40%, #f5f3ff 100%);
    border-color: rgba(124, 58, 237, 0.1);
}

.gs-progress-card-pjt {
    background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 40%, #f0f9ff 100%);
    border-color: rgba(59, 130, 246, 0.1);
    animation-delay: 0.08s;
}

@keyframes progressCardIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Badge Title ── */
.gs-progress-card-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78em;
    font-weight: 800;
    color: #7c3aed;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.gs-progress-card-badge i {
    font-size: 0.9em;
}

.gs-progress-card-badge-pjt {
    color: #3b82f6;
}

/* ── Ring Wrapper ── */
.gs-progress-card-ring-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.gs-progress-card-ring-wrap svg {
    position: absolute;
    top: 0;
    left: 0;
}

.gs-progress-card-ring-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    gap: 1px;
}

.gs-progress-card-pct {
    font-size: 1.45em;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.gs-progress-card-pct small {
    font-size: 0.45em;
    color: #94a3b8;
    font-weight: 700;
}

.gs-progress-card-complete {
    font-size: 0.55em;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.gs-progress-ring-fill {
    transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── TOBU Motivational Message ── */
.gs-progress-tobu-msg {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(3, 105, 161, 0.05), rgba(3, 105, 161, 0.1));
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(3, 105, 161, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.gs-progress-tobu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.gs-progress-tobu-bubble {
    position: relative;
    background: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 700;
    color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    flex: 1;
}

.gs-progress-tobu-bubble::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 8px 6px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}

/* ── Detail Toggle Button ── */
.gs-progress-detail-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72em;
    font-weight: 700;
    color: #3b82f6;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.gs-progress-detail-toggle:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.gs-progress-detail-toggle i {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.gs-progress-detail-toggle.open i {
    transform: rotate(180deg);
}

/* ── Collapsible Detail Section ── */
.gs-progress-detail-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease;
    padding: 0 0;
}

.gs-progress-detail-section.open {
    max-height: 2500px;
    padding: 14px 0 0;
}

.gs-progress-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.78em;
    font-weight: 700;
    color: #475569;
}

.gs-progress-detail-header i {
    color: #94a3b8;
    margin-right: 5px;
}

.gs-progress-detail-count {
    font-size: 0.9em;
    color: #94a3b8;
    font-weight: 600;
}

/* ── Grid Tiles (PJT details) ── */
.gs-progress-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 2px;
}

.gs-progress-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px 8px;
    background: #fafbfc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    animation: progressTileIn 0.35s ease both;
}

.gs-progress-tile:hover {
    background: #fff;
    border-color: var(--tile-color, #6366f1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 0 0 1px var(--tile-color, #6366f1);
    transform: translateY(-2px);
}

/* ── Ring inside tile ── */
.gs-progress-tile-ring {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-progress-tile-ring svg {
    position: absolute;
    top: 0;
    left: 0;
}

.gs-progress-tile-pct {
    font-size: 0.75em;
    font-weight: 800;
    color: #334155;
    z-index: 1;
    line-height: 1;
}

.gs-progress-tile-pct small {
    font-size: 0.6em;
    color: #94a3b8;
    font-weight: 700;
}

/* ── Label ── */
.gs-progress-tile-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.62em;
    font-weight: 700;
    color: #475569;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
}

.gs-progress-tile-label i {
    font-size: 0.85em;
    flex-shrink: 0;
}

/* ── Entrance animation ── */
@keyframes progressTileIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── Header action buttons (CERT / PJT category browse) ── */
.gs-progress-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gs-progress-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all 0.2s ease;
}

.gs-progress-cat-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.gs-progress-cat-btn.active {
    background: #ffffff;
    color: #6d28d9;
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.gs-progress-cat-btn-pjt.active {
    color: #1d4ed8;
}

.gs-progress-cat-btn i {
    font-size: 0.95em;
}

/* ── Category browser (CERT / PJT detail view) ── */
.gs-progress-browser {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: progressCardIn 0.3s ease both;
}

.gs-progress-browser-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef0f5;
}

.gs-progress-browser-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.gs-progress-browser-back:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.gs-progress-browser-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 0.9em;
    font-weight: 800;
}

.gs-progress-browser-title i {
    color: #6366f1;
}

.gs-progress-browser-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #eef0f5;
}

.gs-progress-browser-tab {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 0.75em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.gs-progress-browser-tab:hover {
    border-color: #c7d2fe;
    color: #4f46e5;
}

.gs-progress-browser-tab.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.gs-progress-browser-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.gs-progress-browser-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.gs-progress-browser-item.is-active {
    border-color: rgba(34, 197, 94, 0.35);
    background: linear-gradient(135deg, #f0fdf4, #ffffff 60%);
}

.gs-progress-browser-item.is-active:hover {
    border-color: #22c55e;
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.12);
    transform: translateY(-1px);
}

.gs-progress-browser-item.is-inactive {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.85;
}

.gs-progress-browser-item-status {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    flex-shrink: 0;
    font-size: 0.85em;
}

.gs-progress-browser-item.is-active .gs-progress-browser-item-status {
    background: #dcfce7;
    color: #16a34a;
}

.gs-progress-browser-item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.gs-progress-browser-item-name {
    font-size: 0.82em;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gs-progress-browser-item.is-inactive .gs-progress-browser-item-name {
    color: #64748b;
}

.gs-progress-browser-item-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7em;
    font-weight: 600;
    color: #16a34a;
}

.gs-progress-browser-item-date.gs-progress-browser-item-pending {
    color: #94a3b8;
}

.gs-progress-browser-empty {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 0.85em;
    font-weight: 600;
}

.gs-progress-browser-loading {
    text-align: center;
    padding: 18px;
    color: #94a3b8;
    font-size: 0.85em;
}

.gs-progress-browser-loading i {
    color: #6366f1;
    margin-right: 6px;
}

/* ── Resource panel inside browser ── */
.gs-progress-browser-resource {
    margin-top: 6px;
    padding: 12px;
    border: 1px solid #eef2ff;
    background: #f8faff;
    border-radius: 12px;
}

.gs-progress-browser-resource-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #c7d2fe;
}

.gs-progress-browser-resource-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 800;
    color: #312e81;
}

.gs-progress-browser-resource-title i {
    color: #6366f1;
}

.gs-progress-browser-resource-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72em;
    font-weight: 700;
    color: #16a34a;
}

.gs-progress-browser-resource-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gs-progress-browser-resource-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s;
}

.gs-progress-browser-resource-row:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.gs-progress-browser-resource-thumb {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: #f1f5f9;
    flex-shrink: 0;
}

.gs-progress-browser-resource-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.gs-progress-browser-resource-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.gs-progress-browser-resource-row-title {
    font-size: 0.82em;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gs-progress-browser-resource-row-type {
    font-size: 0.66em;
    font-weight: 700;
    color: #6366f1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.gs-progress-browser-resource-row > i {
    color: #94a3b8;
}

/* ── Quiz section in resource panel ── */
.gs-progress-browser-quiz-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #c7d2fe;
}

.gs-progress-browser-quiz-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82em;
    font-weight: 800;
    color: #4338ca;
    margin-bottom: 8px;
}

.gs-progress-browser-quiz-section-title i {
    color: #6366f1;
}

.gs-progress-browser-quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
}

.gs-progress-browser-quiz-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 0.78em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
    width: 100%;
}

.gs-progress-browser-quiz-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.gs-progress-browser-quiz-btn-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.78em;
    flex-shrink: 0;
}

.gs-progress-browser-quiz-btn.is-correct {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
    color: #166534;
}

.gs-progress-browser-quiz-btn.is-correct .gs-progress-browser-quiz-btn-icon {
    background: #dcfce7;
    color: #16a34a;
}

.gs-progress-browser-quiz-btn.is-correct:hover {
    border-color: #22c55e;
}

.gs-progress-browser-quiz-btn.is-wrong {
    border-color: rgba(239, 68, 68, 0.35);
    background: linear-gradient(135deg, #fef2f2, #ffffff);
    color: #991b1b;
}

.gs-progress-browser-quiz-btn.is-wrong .gs-progress-browser-quiz-btn-icon {
    background: #fee2e2;
    color: #dc2626;
}

.gs-progress-browser-quiz-btn.is-wrong:hover {
    border-color: #ef4444;
}

.gs-progress-browser-quiz-btn-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* ── Quiz detail modal (popup over everything) ── */
.gs-quiz-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gs-quiz-detail-modal.active {
    opacity: 1;
}

.gs-quiz-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.gs-quiz-detail-content {
    position: relative;
    width: min(560px, 92vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.2s ease;
}

.gs-quiz-detail-modal.active .gs-quiz-detail-content {
    transform: translateY(0) scale(1);
}

.gs-quiz-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
}

.gs-quiz-detail-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
    font-weight: 800;
}

.gs-quiz-detail-verdict {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.18);
}

.gs-quiz-detail-verdict.is-correct {
    background: #16a34a;
}

.gs-quiz-detail-verdict.is-wrong {
    background: #dc2626;
}

.gs-quiz-detail-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.gs-quiz-detail-close:hover {
    background: rgba(255, 255, 255, 0.32);
}

.gs-quiz-detail-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.gs-quiz-detail-meta {
    font-size: 0.72em;
    color: #94a3b8;
    margin-bottom: 8px;
}

.gs-quiz-modal-section {
    margin-bottom: 12px;
}

.gs-quiz-modal-section-title {
    font-size: 0.72em;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.gs-quiz-modal-question {
    font-size: 0.88em;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.gs-quiz-modal-img {
    max-width: 100%;
    margin-top: 6px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.gs-quiz-modal-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.gs-quiz-modal-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    font-size: 0.85em;
    color: #1e293b;
}

.gs-quiz-modal-option.is-correct {
    border-color: #22c55e;
    background: #f0fdf4;
}

.gs-quiz-modal-option.is-user:not(.is-correct) {
    border-color: #ef4444;
    background: #fef2f2;
}

.gs-quiz-modal-option-key {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-weight: 800;
    font-size: 0.85em;
    flex-shrink: 0;
}

.gs-quiz-modal-option.is-correct .gs-quiz-modal-option-key {
    background: #16a34a;
    color: #ffffff;
}

.gs-quiz-modal-option.is-user:not(.is-correct) .gs-quiz-modal-option-key {
    background: #dc2626;
    color: #ffffff;
}

.gs-quiz-modal-option-val {
    flex: 1;
}

.gs-quiz-modal-option-tag {
    font-size: 0.7em;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: #16a34a;
    color: #ffffff;
}

.gs-quiz-modal-option-tag.is-wrong {
    background: #dc2626;
}

.gs-quiz-modal-option-tag.is-user-correct {
    background: #2563eb;
}

.gs-quiz-modal-answer {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.86em;
    color: #1e293b;
    white-space: pre-wrap;
}

.gs-quiz-modal-answer.is-correct {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #166534;
    font-weight: 700;
}

.gs-quiz-modal-explanation {
    padding: 10px 12px;
    border-radius: 8px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    color: #581c87;
    font-size: 0.82em;
    line-height: 1.55;
    white-space: pre-wrap;
}

.gs-progress-browser-locked {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
}

.gs-progress-browser-locked i {
    font-size: 1.4em;
}

.gs-progress-browser-locked-title {
    font-size: 0.85em;
    font-weight: 800;
}

.gs-progress-browser-locked-desc {
    font-size: 0.75em;
    color: #9a3412;
    margin-top: 2px;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .gs-progress-modal {
        max-width: 96%;
    }

    .gs-progress-dual-cards {
        gap: 8px;
    }

    .gs-progress-card {
        padding: 14px 8px 12px;
    }

    .gs-progress-card-ring-wrap {
        width: 80px;
        height: 80px;
    }

    .gs-progress-card-pct {
        font-size: 1.15em;
    }

    .gs-progress-card-msg-text {
        font-size: 0.6em;
    }

    .gs-progress-tiles {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .gs-progress-tile-ring {
        width: 42px;
        height: 42px;
    }

    .gs-progress-tile-pct {
        font-size: 0.65em;
    }

    .gs-progress-tile-label {
        font-size: 0.55em;
    }

    .gs-progress-cat-btn span {
        display: none;
    }

    .gs-progress-cat-btn {
        padding: 6px 10px;
    }

    .gs-progress-browser-items {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   ANALYSIS MODAL (Chat area card)
   ============================================================================ */
.analysis-modal-card {
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    font-family: inherit;
}

.analysis-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(233, 213, 255, 0.3), rgba(186, 230, 253, 0.3));
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 15px;
    font-weight: 800;
    color: var(--c-text-dark);
}

.analysis-modal-header i {
    color: var(--c-lavender-dark);
    font-size: 18px;
}

.analysis-modal-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analysis-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.analysis-modal-item.done {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.15);
}

.analysis-modal-item.pending {
    background: rgba(241, 245, 249, 0.6);
    border-color: rgba(0, 0, 0, 0.04);
}

.analysis-modal-item.pending:hover {
    border-color: var(--c-lavender);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.analysis-modal-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.analysis-modal-icon-wrap.done {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.analysis-modal-icon-wrap.pending {
    background: rgba(233, 213, 255, 0.3);
    color: var(--c-lavender-dark);
}

.analysis-modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.analysis-modal-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text-dark);
}

.analysis-modal-result {
    font-size: 12px;
    color: var(--c-text-grey);
}

.analysis-modal-item.done .analysis-modal-result {
    color: #22c55e;
    font-weight: 700;
}

.analysis-start-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--c-lavender), var(--c-knob-pink));
    color: #5b21b6;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.analysis-start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(233, 213, 255, 0.5);
}

/* Pulse glow animation for pending items */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(233, 213, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 16px rgba(233, 213, 255, 0.8), 0 0 24px rgba(196, 181, 253, 0.3);
    }
}

/* AI Analysis Comment inside modal */
.analysis-ai-comment {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(186, 230, 253, 0.15), rgba(233, 213, 255, 0.15));
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.analysis-ai-comment-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-lavender-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.analysis-ai-comment-body {
    font-size: 13px;
    line-height: 1.7;
    color: var(--c-text-dark);
}

/* Analysis modal - wider */
.gs-overlay-analysis {
    max-width: 640px !important;
    width: 90% !important;
}

.gs-overlay-analysis .gs-overlay-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Re-take button for completed items */
.analysis-retake-btn {
    padding: 4px 12px;
    border: 1px solid rgba(233, 213, 255, 0.6);
    border-radius: 16px;
    background: rgba(233, 213, 255, 0.2);
    color: var(--c-lavender-dark);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.analysis-retake-btn:hover {
    background: rgba(233, 213, 255, 0.5);
    border-color: var(--c-lavender);
}

/* SPI personality detail text */
.analysis-modal-detail {
    font-size: 11px;
    color: var(--c-text-grey);
    margin-top: 4px;
    line-height: 1.5;
    max-height: 60px;
    overflow-y: auto;
}

/* ============================================================================
   FLOATING ACTION BUTTON (above chat bar)
   ============================================================================ */
.floating-action-bar {
    display: flex;
    justify-content: center;
    padding: 12px 16px 8px;
    transition: opacity 0.25s, transform 0.25s;
}

.floating-action-bar.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.floating-action-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--c-lavender), var(--c-knob-pink));
    color: #5b21b6;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(233, 213, 255, 0.5);
    transition: all 0.2s;
}

.floating-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233, 213, 255, 0.7);
}

.floating-action-btn:active {
    transform: translateY(0);
}

/* ============================================================================
   RIGHT: KEYBOARD PANEL
   ============================================================================ */
.keyboard-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: var(--keyboard-width);
    min-width: var(--keyboard-width);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1),
        opacity var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Keyboard Panel Header */
.keyboard-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.keyboard-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--c-text-grey);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keyboard-close-btn:hover {
    background: rgba(233, 213, 255, 0.3);
    color: var(--c-text-dark);
}

.keyboard-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text-dark);
}

/* Keyboard Buttons Grid — 1×6 vertical */
.keyboard-btn-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 16px;
}

.kb-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-height: 0;
}

.kb-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kb-btn:active:not(:disabled) {
    transform: translateY(0);
}

.kb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ★ 상황별 비활성화 스타일 (프로그램 진행에 따른 제어) */
.kb-btn.kb-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(60%);
    transform: none !important;
    box-shadow: none !important;
}

.kb-btn-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.kb-btn.kb-primary {
    background: linear-gradient(135deg, rgba(233, 213, 255, 0.4), rgba(251, 207, 232, 0.4));
    color: #5b21b6;
    box-shadow: 0 2px 6px rgba(233, 213, 255, 0.3);
}

.kb-btn.kb-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(233, 213, 255, 0.7), rgba(251, 207, 232, 0.7));
}

.kb-btn.kb-secondary {
    background: rgba(241, 245, 249, 0.8);
    color: var(--c-text-grey);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kb-btn.kb-accent {
    background: linear-gradient(135deg, rgba(167, 243, 208, 0.4), rgba(186, 230, 253, 0.4));
    color: #065f46;
    box-shadow: 0 2px 6px rgba(167, 243, 208, 0.3);
}

.kb-btn.kb-accent:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(167, 243, 208, 0.7), rgba(186, 230, 253, 0.7));
}

.kb-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--c-knob-yellow);
    color: #92400e;
}

/* Keyboard Divider */
.keyboard-divider {
    height: 1px;
    background: var(--c-border);
    margin: 4px 16px;
}

/* Analysis Section */
.analysis-section {
    padding: 8px 16px 16px;
}

.analysis-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: none;
    background: rgba(241, 245, 249, 0.6);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.analysis-toggle-btn:hover {
    background: rgba(233, 213, 255, 0.2);
}

.analysis-toggle-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text-dark);
}

.analysis-toggle-left i {
    color: var(--c-lavender-dark);
    font-size: 16px;
}

.analysis-toggle-icon {
    color: var(--c-text-grey);
    font-size: 12px;
    transition: transform 0.3s;
}

.analysis-toggle-icon.open {
    transform: rotate(180deg);
}

/* Analysis Panel (expandable) */
.analysis-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    animation: expandIn 0.3s ease;
}

@keyframes expandIn {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 400px;
    }
}

.analysis-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.analysis-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--c-lavender);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.analysis-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon {
    font-size: 18px;
}

.status-icon.incomplete {
    color: #d4d4d8;
}

.status-icon.complete {
    color: #22c55e;
}

.analysis-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.analysis-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-dark);
}

.analysis-result {
    font-size: 11px;
    color: var(--c-text-grey);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scrollbar for keyboard panel */
.keyboard-panel::-webkit-scrollbar {
    width: 4px;
}

.keyboard-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.keyboard-panel::-webkit-scrollbar-track {
    background: transparent;
}

/* ============================================================================
   TYPING INDICATOR — "Thinking" Animation
   ============================================================================ */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px;
}

.typing-label {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.3px;
    animation: typingLabelPulse 2s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes typingLabelPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--typing-dot-color, var(--c-mint));
    border-radius: 50%;
    animation: typingWave 1.8s ease-in-out infinite;
}

/* ── カテゴリー別タイピングドットカラー ── */
.message.bot.cat-condition .typing-dot {
    --typing-dot-color: #f472b6;
}

.message.bot.cat-findgoal .typing-dot {
    --typing-dot-color: #f472b6;
}

.message.bot.cat-summary .typing-dot {
    --typing-dot-color: #f472b6;
}

.message.bot.cat-studyplan .typing-dot {
    --typing-dot-color: #f472b6;
}

.message.bot.cat-general .typing-dot {
    --typing-dot-color: #f472b6;
}

.message.bot.cat-journal .typing-dot {
    --typing-dot-color: #60a5fa;
}

.message.bot.cat-curriculum .typing-dot {
    --typing-dot-color: #8b5cf6;
}

.message.bot.cat-mbti .typing-dot {
    --typing-dot-color: #a78bfa;
}

.message.bot.cat-it .typing-dot {
    --typing-dot-color: #818cf8;
}

.message.bot.cat-spi .typing-dot {
    --typing-dot-color: #34d399;
}

.message.bot.cat-selfpr .typing-dot {
    --typing-dot-color: #f472b6;
}

.message.bot.cat-interview .typing-dot {
    --typing-dot-color: #34d399;
}

.message.bot.cat-quiz .typing-dot {
    --typing-dot-color: #fbbf24;
}

.message.bot.cat-company_info .typing-dot {
    --typing-dot-color: #94a3b8;
}

.typing-dot:nth-child(1) {
    background: linear-gradient(135deg, #a78bfa, #c084fc);
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    background: linear-gradient(135deg, #c084fc, #e879f9);
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    background: linear-gradient(135deg, #e879f9, #f0abfc);
    animation-delay: 0.4s;
}

@keyframes typingWave {

    0%,
    60%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px) scale(1.2);
        opacity: 1;
    }
}

/* Icon variant (brain thinking) */
.typing-icon {
    font-size: 14px;
    color: #a78bfa;
    animation: typingIconPulse 1.5s ease-in-out infinite;
}

@keyframes typingIconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

/* ============================================================================
   MODALS (shared styles from old design - kept compatible)
   ============================================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content h3 {
    color: #555;
    font-size: 18px;
    margin-bottom: 5px;
}

.modal-content textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-content textarea:focus {
    border-color: var(--c-mint);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-buttons button {
    width: 120px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-left: 5px;
}

.readonly-box {
    width: 100%;
    min-height: 60px;
    max-height: 100px;
    padding: 12px;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    color: #64748b;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Legacy button styles for modals */
.btn {
    border: none;
    font-family: inherit;
    font-weight: bold;
    color: var(--c-text-grey);
    transition: all 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.pill {
    border-radius: 20px;
    height: 40px;
    width: 100%;
}

.mint {
    background-color: var(--c-mint);
}

.cream {
    background-color: var(--c-cream);
}

.lavender {
    background-color: var(--c-lavender);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h2 {
    font-size: 18px;
    color: #444;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal-btn {
    width: 32px;
    height: 32px;
    border: none;
    background-color: var(--c-lavender);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
}

.close-modal-btn:hover {
    background-color: var(--c-heart-red);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 5px 10px rgba(255, 144, 164, 0.4);
}

.pointer {
    cursor: pointer;
}

/* Boss Auth */
#boss-password-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake-animation {
    animation: shake 0.3s ease-in-out;
}

/* ============================================================================
   DAILY CARD (Chat bubble cards - shared)
   ============================================================================ */
.daily-card {
    background-color: #ffffff;
    border-radius: 16px;
    max-width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 10px 0;
    font-family: inherit;
    text-align: left;
}

.user-section {
    padding: 24px;
}

.card-title {
    margin: 0 0 20px 0;
    font-size: 1.1rem;
    color: #333;
    border-bottom: 2px solid #7960e7;
    padding-bottom: 12px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.icon {
    font-size: 1.4rem;
    margin-right: 12px;
    min-width: 24px;
}

.text-group {
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 0.75rem;
    color: #888;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.value {
    font-size: 0.95rem;
    color: #222;
    margin: 0;
    line-height: 1.6;
}

/* Boss / AI / Advice sections */
.boss-section,
.ai-section,
.advice-section {
    background-color: #f0f7ff;
    padding: 20px 24px;
    border-top: 1px solid #e1ecf4;
    position: relative;
}

.boss-section::before,
.ai-section::before,
.advice-section::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background-color: #4a90e2;
}

.boss-header,
.ai-header,
.advice-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.boss-icon,
.ai-icon,
.advice-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.boss-title,
.ai-title,
.advice-title {
    font-size: 0.85rem;
    font-weight: bold;
    color: #0056b3;
}

.boss-content,
.ai-content,
.advice-content {
    margin: 0;
    font-size: 0.95rem;
    color: #334e68;
    line-height: 1.6;
}

/* Boss Card Container (chat) */
.boss-card-container {
    background-color: #fff;
    border: 1px solid #e0f2fe;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    min-width: 280px;
}

.bc-header {
    background-color: #f0f9ff;
    padding: 15px 20px;
    border-bottom: 1px solid #e0f2fe;
}

.bc-title {
    font-size: 14px;
    font-weight: 800;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.bc-subject {
    font-size: 16px;
    color: #334155;
    font-weight: bold;
}

.bc-body {
    padding: 20px;
    background-color: #fff;
    position: relative;
}

.bc-body::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #0ea5e9;
}

.bc-grade-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.bc-badge {
    background-color: #e0f2fe;
    color: #0284c7;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    margin-right: 10px;
}

.bc-comment {
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ============================================================================
   DIARY ACCORDION (kept from old design)
   ============================================================================ */
.diary-scroll-area {
    padding: 10px 15px 20px 15px;
    max-height: 60vh;
    overflow-y: auto;
    background-color: #f8f9fa;
    border-radius: 0 0 20px 20px;
}

.diary-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.diary-scroll-area::-webkit-scrollbar-thumb {
    background-color: var(--c-lavender);
    border-radius: 10px;
}

.diary-scroll-area::-webkit-scrollbar-track {
    background-color: transparent;
}

.accordion-item {
    background-color: #fff;
    border-radius: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    overflow: hidden;
}

.accordion-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.accordion-item.active {
    border-color: var(--c-mint);
    box-shadow: 0 4px 15px rgba(167, 243, 208, 0.4);
}

.accordion-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    user-select: none;
}

.accordion-date {
    font-size: 16px;
    font-weight: 800;
    color: #555;
    display: flex;
    align-items: center;
    gap: 10px;
}

.accordion-date i {
    color: var(--c-lavender);
    font-size: 18px;
}

.accordion-icon {
    color: #ccc;
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
    color: var(--c-mint);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.accordion-item.active .accordion-body {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.accordion-content-box {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-label {
    font-size: 12px;
    font-weight: bold;
    color: var(--c-text-grey);
    text-transform: uppercase;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    background: #fff;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.boss-feedback-highlight {
    background-color: #e0f2fe;
    border: 1px solid var(--c-knob-blue);
    padding: 12px;
    border-radius: 10px;
}

.boss-feedback-highlight .info-text {
    background: transparent;
    border: none;
    padding: 0;
    color: #4a90e2;
}

.ai-feedback-highlight {
    background-color: #f0fdf4;
    border: 1px solid var(--c-mint);
    padding: 12px;
    border-radius: 10px;
}

.ai-feedback-highlight .info-text {
    background: transparent;
    border: none;
    padding: 0;
    color: #065f46;
}

/* legacy synth-input-bar for modals */
.synth-input-bar {
    width: 100%;
    height: 40px;
    background-color: var(--c-input-bg);
    border: 2px solid var(--c-border);
    border-radius: 12px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 15px;
    color: #555;
    outline: none;
    transition: all 0.2s;
}

.synth-input-bar:focus {
    border-color: var(--c-mint);
    box-shadow: 0 0 0 3px rgba(167, 243, 208, 0.2);
}

/* Legacy interactable class - needed for keyboard.js handleClick */
.interactable {
    cursor: pointer;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
/* Wide Screen: Display bar also centered */
.display-bar {
    width: 100%;
    max-width: 860px;
    align-self: center;
}

/* ============================================================================
   PASSAGE PANEL (Center-Stage for MBTI / SPI / IT Tests)
   ============================================================================ */
.passage-panel {
    flex: 0 0 0%;
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14), 0 6px 16px rgba(0, 0, 0, 0.08);
    margin: 10px 20px;
    transition: flex 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        max-width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(-80px);
    pointer-events: none;
    max-width: 0;
}

.passage-panel.active {
    flex: 1;
    max-width: none;
    width: 100%;
    height: calc(100vh - 60px);
    min-height: 0;
    max-height: calc(100vh - 60px);
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    align-self: center;
    margin-bottom: 10px;
    overflow: visible;
}

/* When panel is active (DIAGNOSTIC mode) → hide chat, center the panel */
.split-view-container.active {
    flex-direction: column;
    align-items: center;
}

.split-view-container.active .chat-column {
    display: none;
}

/* ★ Active 모드에서 채팅 바 래퍼: 기본 wrapper 스타일 유지 */
.split-view-container.active:not(.split-mode)>.chat-input-bar-wrapper {
    /* 860px max-width가 유지됨 */
}

/* ★ 패널 모드에서 가이드: 중앙 860px 영역 밖 우측에 고정 */
.split-view-container.active .chat-btn-guide {
    position: absolute;
    left: calc(50% + 440px);
    bottom: 8px;
    width: max-content;
    max-width: 260px;
}

/* When panel is active (CURRICULUM / SPLIT mode) → show chat + panel side by side */
.split-view-container.split-mode {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}

.split-view-container.split-mode .chat-column {
    display: flex;
    flex: 0 0 40%;
    min-width: 280px;
    max-width: none;
    padding-right: 0;
    /* no guide zone in split mode */
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    order: 1;
}

/* hide guide in split-mode (no space) */
.split-view-container.split-mode .chat-btn-guide {
    display: none !important;
}

/* reduce bar margin in split-mode to fit the 40% column */
.split-view-container.split-mode .chat-input-bar {
    margin: 0 8px;
}

.split-view-container.split-mode .passage-panel.active {
    flex: 0 0 60%;
    max-width: none;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    border-radius: 16px;
    margin: 10px 10px 10px 0;
    align-self: stretch;
    overflow: hidden;
    order: 2;
}

/* 커리큘럼 전용 채팅 영역 */
#curriculum-chat-screen {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    min-height: 0;
    scrollbar-width: thin;
}

#curriculum-chat-screen::-webkit-scrollbar {
    width: 5px;
}

#curriculum-chat-screen::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

/* 커리큘럼 모드일 때 기존 전체 체인 히스트리 숨김 */
.split-mode #chat-screen {
    display: none;
}

/* ---- Bookmark Tab Bar ---- */
.passage-tab-bar {
    display: flex;
    align-items: center;
    justify-content: end;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(233, 213, 255, 0.2), rgba(186, 230, 253, 0.15));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    gap: 8px;
}

.passage-tab-list {
    display: flex;
    gap: 4px;
}

.passage-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    background: rgba(241, 245, 249, 0.6);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-grey);
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.passage-tab i {
    font-size: 14px;
}

.passage-tab:hover {
    background: rgba(233, 213, 255, 0.3);
    color: var(--c-text-dark);
    border-color: rgba(196, 181, 253, 0.4);
}

.passage-tab.active {
    background: linear-gradient(135deg, var(--c-lavender), rgba(196, 181, 253, 0.5));
    color: #5b21b6;
    border-color: #c4b5fd;
    box-shadow: 0 2px 8px rgba(196, 181, 253, 0.35);
}

/* ★ テーマ別のアクティブタブカラー */
.passage-tab[data-theme="spi"].active {
    background: linear-gradient(135deg, rgba(219, 234, 254, 1), rgba(147, 197, 253, 0.5));
    color: #1e40af;
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(147, 197, 253, 0.35);
}

.passage-tab[data-theme="it"].active {
    background: linear-gradient(135deg, rgba(254, 243, 199, 1), rgba(252, 211, 77, 0.5));
    color: #92400e;
    border-color: #fcd34d;
    box-shadow: 0 2px 8px rgba(252, 211, 77, 0.35);
}

.passage-tab.completed {
    color: #22c55e;
}

.passage-tab.completed::after {
    content: '✓';
    font-size: 10px;
    margin-left: 4px;
    color: #22c55e;
}

.passage-tab-close {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-grey);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.passage-tab-close:hover {
    background: rgba(255, 144, 164, 0.12);
    color: var(--c-heart-red);
}

/* ---- AI Message Display Area (오른쪽 사이드바) ---- */
.passage-ai-display {
    flex-shrink: 0;
    width: 390px;
    min-width: 200px;
    overflow: visible;
    padding: 16px 12px;
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.95), rgba(233, 213, 255, 0.15));
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.passage-ai-display::-webkit-scrollbar {
    width: 3px;
}

.passage-ai-display::-webkit-scrollbar-thumb {
    background: var(--c-lavender);
    border-radius: 10px;
}

/* ★ 아바타 컨테이너 */
.passage-ai-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    width: 68px;
}

.avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(167, 139, 250, 0.4);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: border-color 0.4s ease;
}

.avatar-img.avatar-enter {
    animation: avatarPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes avatarPop {
    0% {
        transform: scale(0.7) translateY(6px);
        opacity: 0;
    }

    60% {
        transform: scale(1.08) translateY(-2px);
        opacity: 1;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.avatar-name {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: color 0.3s;
}

/* ★ 아바타 리액션 말풍선 */
.passage-ai-avatar {
    position: relative;
    /* 위로 뜨는 말풍선이 윗단에 짤리지 않도록 최소한의 상단 여백 확보 */
    margin-top: 15px;
}

.avatar-speech-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: white;
    border: 1.5px solid rgba(167, 139, 250, 0.4);
    border-radius: 12px 12px 12px 4px;
    padding: 8px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #4c1d95;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.18);
    z-index: 100;
    pointer-events: none;
    animation: speechBubbleInUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* SPI: 파란 계열 */
.avatar-speech-bubble.spi {
    border-color: rgba(96, 165, 250, 0.4);
    color: #1e3a8a;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.18);
}

/* IT: 오렌지 계열 */
.avatar-speech-bubble.it {
    border-color: rgba(251, 191, 36, 0.4);
    color: #92400e;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.18);
}

/* 말풍선 꼬리 (아래를 향하도록) */
.avatar-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 14px;
    top: auto;
    right: auto;
    transform: none;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid white;
    border-bottom: none;
}

.avatar-speech-bubble.fade-out {
    animation: speechBubbleOutUp 0.4s ease forwards;
}

@keyframes speechBubbleInUp {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(8px) scale(0.88);
    }

    60% {
        opacity: 1;
        transform: translateX(-50%) translateY(-2px) scale(1.03);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes speechBubbleOutUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-6px) scale(0.9);
    }
}

/* 말풍선 영역 (세로 사이드바) */
.passage-ai-display-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1;
    overflow-y: auto;
}

/* AI message in display */
.passage-display-msg {
    font-size: 14px;
    line-height: 1.6;
    color: var(--c-text-dark);
    animation: panelMsgFadeIn 0.4s ease;
    word-break: break-word;
}

.passage-display-msg.bot {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(233, 213, 255, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ★ テーマ別botメッセージボーダー */
.passage-panel[data-theme="spi"] .passage-display-msg.bot {
    border-color: rgba(147, 197, 253, 0.4);
}

.passage-panel[data-theme="it"] .passage-display-msg.bot {
    border-color: rgba(252, 211, 77, 0.4);
}

.passage-display-msg.bot .display-msg-icon {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 5px;
}

/* ★ AI 이름 뱃지 */
.ai-name-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 8px;
    border-radius: 20px;
    background: linear-gradient(90deg, #a78bfa, #818cf8);
    color: white;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ★ テーマ別AI名バッジカラー */
.passage-panel[data-theme="spi"] .ai-name-badge {
    background: linear-gradient(90deg, #3b82f6, #0ea5e9);
}

.passage-panel[data-theme="it"] .ai-name-badge {
    background: linear-gradient(90deg, #f59e0b, #ea580c);
}

/* User message in display — fade-out effect */
.passage-display-msg.user {
    padding: 8px 14px;
    background: rgba(255, 251, 235, 0.8);
    border-radius: 12px 12px 4px 12px;
    border: 1px solid rgba(253, 230, 138, 0.3);
    text-align: right;
    color: #78716c;
    font-weight: 500;
    animation: userMsgAppearThenFade 4s ease forwards;
    align-self: flex-end;
}

@keyframes panelMsgFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes userMsgAppearThenFade {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        max-height: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
}

/* ★ Rive 전환 버블 스타일 */
.rive-transition-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    /* Default: MBTI (Purple) */
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), rgba(196, 181, 253, 0.12));
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    width: fit-content;
    margin: 0 auto;
}

/* SPI Theme (Blue) */
.rive-transition-bubble.spi {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(59, 130, 246, 0.12));
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* IT/Python Theme (Orange) */
.rive-transition-bubble.it,
.rive-transition-bubble.python {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(245, 158, 11, 0.12));
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.rive-canvas {
    border-radius: 8px;
}

.rive-transition-label {
    color: #8b5cf6;
    /* Default/MBTI: Purple */
    font-weight: 700;
    font-size: 1.05em;
    letter-spacing: 0.3px;
    animation: labelPulse 1.2s ease-in-out infinite;
}

.rive-transition-label.spi {
    color: #3b82f6;
    /* SPI: Blue */
}

.rive-transition-label.it,
.rive-transition-label.python {
    color: #f59e0b;
    /* IT/Python: Orange */
}

@keyframes labelPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.transition-bubble-wrapper {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.fade-out-bubble {
    animation: bubbleFadeOut 0.4s ease forwards;
}

@keyframes bubbleFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.92);
    }
}

/* Panel Header (Clipboard style) */
.passage-panel-header {
    padding: clamp(12px, 2vw, 20px);
    border-bottom: 2px solid rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(233, 213, 255, 0.15), rgba(186, 230, 253, 0.1));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ★ テーマ別ヘッダー背景 */
.passage-panel[data-theme="spi"] .passage-panel-header {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.25), rgba(186, 230, 253, 0.15));
}

.passage-panel[data-theme="it"] .passage-panel-header {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.25), rgba(254, 215, 170, 0.15));
}

/* Top row: title + progress */
.passage-panel-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.passage-panel-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--c-text-grey);
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.passage-panel-close-btn:hover {
    background: rgba(255, 144, 164, 0.15);
    color: var(--c-heart-red);
}

.passage-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(14px, 1.2vw, 16px);
    font-weight: 800;
    color: var(--c-text-dark);
}

.passage-panel-title i {
    font-size: clamp(14px, 1.2vw, 18px);
    color: var(--c-lavender-dark);
    width: clamp(26px, 2.5vw, 32px);
    height: clamp(26px, 2.5vw, 32px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--c-lavender), rgba(196, 181, 253, 0.5));
    border-radius: 8px;
}

/* ★ テーマ別のタイトルアイコンカラー */
.passage-panel[data-theme="spi"] .passage-panel-title i {
    color: #1e3a8a;
    background: linear-gradient(135deg, rgba(219, 234, 254, 1), rgba(147, 197, 253, 0.5));
}

.passage-panel[data-theme="it"] .passage-panel-title i {
    color: #92400e;
    background: linear-gradient(135deg, rgba(254, 243, 199, 1), rgba(252, 211, 77, 0.5));
}

/* ★ 패널 헤더 타이틀 옆 다시 시작 버튼 */
.panel-header-restart-btn {
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(233, 213, 255, 0.3);
    border: 1.5px solid rgba(167, 139, 250, 0.4);
    border-radius: 20px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-lavender-dark);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ★ テーマ別の再挑戦ボタンカラー */
.passage-panel[data-theme="spi"] .panel-header-restart-btn {
    background: rgba(219, 234, 254, 0.5);
    border-color: rgba(147, 197, 253, 0.8);
    color: #1e40af;
}

.passage-panel[data-theme="it"] .panel-header-restart-btn {
    background: rgba(254, 243, 199, 0.6);
    border-color: rgba(252, 211, 77, 0.8);
    color: #b45309;
}

.panel-header-restart-btn:hover {
    background: rgba(167, 139, 250, 0.25);
    border-color: #a855f7;
    transform: scale(1.04);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.panel-header-restart-btn:active {
    transform: scale(0.97);
}

/* Progress Bar - inline next to title */
.passage-panel-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    margin-left: 30px;
}

.passage-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.passage-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--c-lavender-dark), var(--c-heart-red));
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ★ テーマ別プログレスバー */
.passage-panel[data-theme="spi"] .passage-progress-fill {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.passage-panel[data-theme="it"] .passage-progress-fill {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.passage-progress-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-grey);
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

/* ★ Content Row: 문제(왼쪽) + AI Display(오른쪽)를 가로로 배치 */
.passage-panel-content-row {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-height: 0;
    overflow: visible;
}

/* Panel Body - 남는 공간 모두 주고 스크롤 */
.passage-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(10px, 1.5vw, 20px) clamp(10px, 1.5vw, 20px);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 14px);
}

/* 커리큘럼 split-mode: 패널 body는 padding 없이 콘텐츠가 꽉 채움 */
.split-mode .passage-panel-body {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

/* 커리큘럼 split-mode: 패널 body 직접 자식 div가 100% 높이 차지 */
.split-mode .passage-panel-body>div {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 커리큘럼(split-mode)에서는 AI display 숨김 (별도 채팅이 있으므로) */
.split-mode .passage-ai-display {
    display: none;
}

.passage-panel-body::-webkit-scrollbar {
    width: 4px;
}

.passage-panel-body::-webkit-scrollbar-thumb {
    background: var(--c-lavender);
    border-radius: 10px;
}

.passage-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

/* Passage Question Card */
.passage-question-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(233, 213, 255, 0.4);
    border-radius: var(--radius-md);
    padding: clamp(12px, 1.5vw, 16px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    animation: passageCardSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes passageCardSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.passage-question-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(11px, 1vw, 12px);
    font-weight: 700;
    color: var(--c-lavender-dark);
    background: rgba(233, 213, 255, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: clamp(6px, 1vw, 10px);
    letter-spacing: 0.3px;
}

.passage-question-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #6d28d9;
    background: rgba(196, 181, 253, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 8px;
}

/* ★ テーマ別の問題バッジカラー */
.passage-panel[data-theme="spi"] .passage-question-type {
    color: #1e3a8a;
    background: rgba(147, 197, 253, 0.25);
}

.passage-panel[data-theme="it"] .passage-question-type {
    color: #92400e;
    background: rgba(252, 211, 77, 0.3);
}

.passage-question-text {
    font-size: clamp(13px, 1.2vw, 15px);
    line-height: 1.5;
    color: var(--c-text-dark);
    font-weight: 600;
    white-space: pre-line;
}

.passage-code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    border: 1px solid rgba(196, 181, 253, 0.2);
}

.passage-scale-guide {
    margin-top: clamp(12px, 1.5vw, 20px);
    padding: clamp(10px, 1.2vw, 14px) clamp(10px, 1.2vw, 16px);
    background: rgba(241, 245, 249, 0.6);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--c-lavender-dark);
}

.passage-scale-guide-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-grey);
    margin-bottom: 8px;
}

.passage-scale-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(12px, 1vw, 13px);
    color: var(--c-text-dark);
    padding: 3px 0;
}

.passage-scale-num {
    width: clamp(20px, 1.8vw, 24px);
    height: clamp(20px, 1.8vw, 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-lavender);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #6d28d9;
    flex-shrink: 0;
}

/* Options list in passage panel (for SPI/IT) - clickable */
.passage-options-list {
    margin-top: clamp(10px, 1.2vw, 14px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(6px, 0.8vw, 8px);
}

.passage-option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: clamp(6px, 0.8vw, 10px) clamp(10px, 1.2vw, 14px);
    background: rgba(241, 245, 249, 0.5);
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-sm);
    font-size: clamp(12px, 1vw, 14px);
    color: var(--c-text-dark);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.passage-option-item:hover {
    background: rgba(233, 213, 255, 0.3);
    border-color: var(--c-lavender-dark);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(196, 181, 253, 0.25);
}

.passage-option-item:active {
    transform: translateX(2px) scale(0.98);
}

.passage-option-item.active {
    background: rgba(233, 213, 255, 0.4);
    border-color: #a855f7;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
    transform: translateX(4px);
}

.passage-option-item.active .passage-option-letter {
    background: #9333ea;
    color: #ffffff;
}

.passage-option-letter {
    width: clamp(22px, 2vw, 28px);
    height: clamp(22px, 2vw, 28px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-lavender);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #6d28d9;
    flex-shrink: 0;
}

.passage-option-text {
    flex: 1;
    line-height: 1.5;
}

/* ★ テーマ別の選択肢・文字カラー */
/* SPI (Blue) */
.passage-panel[data-theme="spi"] .passage-option-item:hover {
    background: rgba(219, 234, 254, 0.4);
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(147, 197, 253, 0.25);
}

.passage-panel[data-theme="spi"] .passage-option-item.active {
    background: rgba(219, 234, 254, 0.7);
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.passage-panel[data-theme="spi"] .passage-option-item.active .passage-option-letter {
    background: #2563eb;
    color: #ffffff;
}

.passage-panel[data-theme="spi"] .passage-option-letter {
    background: #dbeafe;
    color: #1e40af;
}

/* IT (Orange) */
.passage-panel[data-theme="it"] .passage-option-item:hover {
    background: rgba(254, 243, 199, 0.4);
    border-color: #fcd34d;
    box-shadow: 0 2px 8px rgba(252, 211, 77, 0.25);
}

.passage-panel[data-theme="it"] .passage-option-item.active {
    background: rgba(254, 243, 199, 0.8);
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.passage-panel[data-theme="it"] .passage-option-item.active .passage-option-letter {
    background: #d97706;
    color: #ffffff;
}

.passage-panel[data-theme="it"] .passage-option-letter {
    background: #fef3c7;
    color: #92400e;
}

/* Score buttons in passage panel (for MBTI) */
.passage-score-buttons {
    margin-top: clamp(10px, 1.2vw, 16px);
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 0.8vw, 8px);
}

.passage-score-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: clamp(8px, 1vw, 12px) clamp(10px, 1.2vw, 14px);
    background: rgba(233, 213, 255, 0.15);
    border: 1.5px solid rgba(233, 213, 255, 0.4);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: clamp(12px, 1vw, 14px);
    font-weight: 600;
    color: var(--c-text-dark);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.passage-score-btn:hover {
    background: rgba(233, 213, 255, 0.4);
    border-color: var(--c-lavender-dark);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(196, 181, 253, 0.25);
}

.passage-score-btn:active {
    transform: translateX(2px) scale(0.98);
}

.passage-score-btn.active {
    background: #e9d5ff;
    border-color: #a855f7;
    color: #4c1d95;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

.passage-score-btn.active .score-num {
    background: #9333ea;
    color: #fff;
}

.passage-score-btn .score-num {
    width: clamp(24px, 2vw, 30px);
    height: clamp(24px, 2vw, 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-lavender);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    color: #6d28d9;
    flex-shrink: 0;
}

/* --- Passage Pagination --- */
.passage-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.passage-page-btn {
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.passage-page-btn:hover:not(:disabled) {
    background: var(--c-lavender);
    color: var(--c-lavender-dark);
    border-color: #c4b5fd;
}

/* ★ テーマ別ページネーションボタン hover */
.passage-panel[data-theme="spi"] .passage-page-btn:hover:not(:disabled) {
    background: rgba(219, 234, 254, 0.8);
    color: #1e40af;
    border-color: #93c5fd;
}

.passage-panel[data-theme="it"] .passage-page-btn:hover:not(:disabled) {
    background: rgba(254, 243, 199, 0.8);
    color: #92400e;
    border-color: #fcd34d;
}

.passage-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   DIAGNOSTIC LOADING SPINNER
   ============================================================================ */
.diagnostic-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 92, 246, 0.15);
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: diagnosticSpin 0.8s linear infinite;
}

/* ★ テーマ別ローディングスピナー */
.passage-panel[data-theme="spi"] .diagnostic-loading-spinner {
    border-color: rgba(59, 130, 246, 0.15);
    border-top-color: #3b82f6;
}

.passage-panel[data-theme="it"] .diagnostic-loading-spinner {
    border-color: rgba(245, 158, 11, 0.15);
    border-top-color: #f59e0b;
}

@keyframes diagnosticSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   DIAGNOSTIC SELECTION SCREEN (Character Selection UI)
   ============================================================================ */
.diagnostic-select-container {
    display: flex;
    gap: 20px;
    padding: 30px 24px;
    justify-content: center;
    align-items: stretch;
    height: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.diagnostic-select-card {
    flex: 1;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 22px 28px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Shimmer background overlay */
.diagnostic-select-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.diagnostic-select-card:hover::before {
    left: 100%;
}

.diagnostic-select-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* ---- MBTI 카드 테마 ---- */
.diagnostic-select-card.card-mbti {
    border-color: rgba(167, 139, 250, 0.35);
    background: linear-gradient(180deg, rgba(245, 240, 255, 0.85) 0%, rgba(255, 255, 255, 0.8) 100%);
}

.diagnostic-select-card.card-mbti:hover {
    border-color: rgba(167, 139, 250, 0.7);
    box-shadow: 0 16px 40px rgba(139, 92, 246, 0.18), 0 0 0 2px rgba(167, 139, 250, 0.2);
}

.diagnostic-select-card.card-mbti .card-select-avatar-ring {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.15);
}

.diagnostic-select-card.card-mbti:hover .card-select-avatar-ring {
    border-color: rgba(139, 92, 246, 0.7);
    box-shadow: 0 0 32px rgba(139, 92, 246, 0.25);
}

.diagnostic-select-card.card-mbti .card-select-name {
    color: #7c3aed;
}

.diagnostic-select-card.card-mbti .card-select-start-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.diagnostic-select-card.card-mbti .card-select-start-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

/* ---- SPI 카드 테마 ---- */
.diagnostic-select-card.card-spi {
    border-color: rgba(96, 165, 250, 0.35);
    background: linear-gradient(180deg, rgba(235, 245, 255, 0.85) 0%, rgba(255, 255, 255, 0.8) 100%);
}

.diagnostic-select-card.card-spi:hover {
    border-color: rgba(96, 165, 250, 0.7);
    box-shadow: 0 16px 40px rgba(59, 130, 246, 0.18), 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.diagnostic-select-card.card-spi .card-select-avatar-ring {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.15);
}

.diagnostic-select-card.card-spi:hover .card-select-avatar-ring {
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 32px rgba(59, 130, 246, 0.25);
}

.diagnostic-select-card.card-spi .card-select-name {
    color: #1d4ed8;
}

.diagnostic-select-card.card-spi .card-select-start-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.diagnostic-select-card.card-spi .card-select-start-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.35);
}

/* ---- IT(Python) 카드 테마 ---- */
.diagnostic-select-card.card-it {
    border-color: rgba(251, 191, 36, 0.35);
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.85) 0%, rgba(255, 255, 255, 0.8) 100%);
}

.diagnostic-select-card.card-it:hover {
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 16px 40px rgba(217, 119, 6, 0.18), 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.diagnostic-select-card.card-it .card-select-avatar-ring {
    border-color: rgba(217, 119, 6, 0.4);
    box-shadow: 0 0 24px rgba(217, 119, 6, 0.15);
}

.diagnostic-select-card.card-it:hover .card-select-avatar-ring {
    border-color: rgba(217, 119, 6, 0.7);
    box-shadow: 0 0 32px rgba(217, 119, 6, 0.25);
}

.diagnostic-select-card.card-it .card-select-name {
    color: #b45309;
}

.diagnostic-select-card.card-it .card-select-start-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.diagnostic-select-card.card-it .card-select-start-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.35);
}

/* ---- 카드 내부 요소 ---- */
.card-select-avatar-ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 16px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-select-avatar-ring img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
}

.card-select-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.card-select-ai-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-grey);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0.7;
}

.card-select-desc {
    font-size: 12.5px;
    line-height: 1.7;
    color: #64748b;
    text-align: center;
    margin-bottom: 16px;
    flex: 1;
    min-height: 60px;
}

.card-select-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--c-text-grey);
    margin-bottom: 20px;
    padding: 6px 14px;
    background: rgba(241, 245, 249, 0.7);
    border-radius: 20px;
    font-weight: 600;
}

.card-select-meta i {
    font-size: 12px;
    opacity: 0.7;
}

.card-select-start-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 14px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.card-select-start-btn:hover {
    transform: translateY(-2px);
}

.card-select-start-btn:active {
    transform: translateY(0);
}

/* ---- 완료 상태 카드 ---- */
.diagnostic-select-card.completed {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

.diagnostic-select-card.completed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    pointer-events: none;
    z-index: 1;
}

.card-select-completed-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    z-index: 2;
    animation: completeBadgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes completeBadgePop {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

/* ---- 선택 화면 타이틀 ---- */
.diagnostic-select-header {
    text-align: center;
    padding: 24px 24px 0;
}

.diagnostic-select-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--c-text-dark);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.diagnostic-select-subtitle {
    font-size: 13px;
    color: var(--c-text-grey);
    line-height: 1.6;
}

/* ---- 카드 등장 애니메이션 ---- */
.diagnostic-select-card {
    animation: cardSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.diagnostic-select-card:nth-child(1) {
    animation-delay: 0.1s;
}

.diagnostic-select-card:nth-child(2) {
    animation-delay: 0.25s;
}

.diagnostic-select-card:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes cardSlideUp {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.92);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- Responsive: 모바일에서 세로 스택 ---- */
@media (max-width: 768px) {
    .diagnostic-select-container {
        flex-direction: column;
        align-items: center;
        padding: 20px 16px;
        gap: 14px;
    }

    .diagnostic-select-card {
        max-width: 100%;
        width: 100%;
        padding: 24px 18px 22px;
        flex-direction: row;
        gap: 16px;
        border-radius: 18px;
    }

    .card-select-avatar-ring {
        width: 64px;
        height: 64px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .card-select-avatar-ring img {
        width: 54px;
        height: 54px;
    }

    .card-select-desc {
        min-height: unset;
        text-align: left;
    }

    .diagnostic-select-header {
        padding: 16px 16px 0;
    }

    .diagnostic-select-title {
        font-size: 18px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .diagnostic-select-container {
        gap: 14px;
        padding: 24px 16px;
    }

    .diagnostic-select-card {
        padding: 24px 16px 22px;
        max-width: 240px;
    }
}

/* Tablet responsive */
@media (max-width: 1024px) {
    .passage-panel.active {
        max-width: 100%;
        margin: 6px 10px;
        border-radius: 12px;
    }

    .passage-question-text {
        font-size: 14px;
    }

    /* 작은 화면에서 split-mode는 세로 스택으로 전환 */
    .split-view-container.split-mode {
        flex-direction: column;
    }

    .split-view-container.split-mode .chat-column {
        flex: 0 0 auto;
        max-width: none;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        max-height: 45vh;
        order: 1;
    }

    .split-view-container.split-mode .passage-panel.active {
        margin: 0 10px 10px;
        flex: 1;
    }

    /* 태블릿에서 AI display 사이드바 숨김 (공간 부족) */
    .passage-ai-display {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        z-index: 100;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar-collapsed {
        display: none !important;
    }

    .keyboard-panel {
        z-index: 300;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .keyboard-panel.mobile-open {
        right: 0;
    }

    .chat-area,
    .chat-input-bar,
    .display-bar {
        max-width: 100%;
    }

    .chat-input-bar {
        margin: 0 12px 12px;
    }
}

/* 完了 (Finish) button — Default (SPI) is Blue */
.passage-page-btn.btn-finish {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    animation: finishBtnPulse 2s ease-in-out infinite;
}

.passage-page-btn.btn-finish:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    border-color: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
}

.passage-page-btn.btn-finish:disabled {
    background: linear-gradient(135deg, #93c5fd, #bfdbfe);
    border-color: #bfdbfe;
    color: rgba(255, 255, 255, 0.7);
    box-shadow: none;
    animation: none;
}

/* =========================================
   完了 버튼 테마별 컬러 분리
   ========================================= */

/* MBTI: Purple */
.passage-panel[data-theme="mbti"] .passage-page-btn.btn-finish {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border-color: #7c3aed;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.passage-panel[data-theme="mbti"] .passage-page-btn.btn-finish:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9, #9333ea);
    border-color: #6d28d9;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

/* IT Test: Orange */
.passage-panel[data-theme="it"] .passage-page-btn.btn-finish {
    background: linear-gradient(135deg, #f97316, #fb923c);
    border-color: #f97316;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.passage-panel[data-theme="it"] .passage-page-btn.btn-finish:hover:not(:disabled) {
    background: linear-gradient(135deg, #ea580c, #f97316);
    border-color: #ea580c;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

/* ★ Default (SPI Blue) pulse */
@keyframes finishBtnPulse {

    0%,
    100% {
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    }

    50% {
        box-shadow: 0 4px 22px rgba(37, 99, 235, 0.6);
    }
}

/* MBTI Purple pulse */
@keyframes finishBtnPulsePurple {

    0%,
    100% {
        box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
    }

    50% {
        box-shadow: 0 4px 22px rgba(124, 58, 237, 0.6);
    }
}

.passage-panel[data-theme="mbti"] .passage-page-btn.btn-finish {
    animation: finishBtnPulsePurple 2s ease-in-out infinite;
}

/* IT Orange pulse */
@keyframes finishBtnPulseOrange {

    0%,
    100% {
        box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
    }

    50% {
        box-shadow: 0 4px 22px rgba(249, 115, 22, 0.6);
    }
}

.passage-panel[data-theme="it"] .passage-page-btn.btn-finish {
    animation: finishBtnPulseOrange 2s ease-in-out infinite;
}

/* =========================================
   診断結果表示用パネル (Result Panel)
   ========================================= */
.result-panel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(10px, 1.5vw, 16px);
    height: 100%;
    /* 대시보드 컨텐츠가 영역을 넘어갈 경우 스크롤 허용 */
    overflow-y: auto;
}

/* ★ 대시보드 레이아웃 스타일 */
.result-dashboard-wrapper {
    display: grid;
    /* 패널 공간이 좁아도 가급적 2단(좌우) 배치를 강제 (최소폭 200px) */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    width: 100%;
    align-items: start;
}

/* 대시보드 내부의 개별 위젯 패널 */
.dashboard-widget {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: clamp(12px, 1.5vw, 16px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    /* 애니메이션 전 숨김 */
}

/* ★ 순차적 Fade-in 애니메이션 */
.fade-in-up {
    animation: dashboardFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dashboardFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 12px;
    gap: 12px;
}

.result-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-celebration {
    font-size: clamp(24px, 2.5vw, 28px);
    margin: 0;
    animation: resultPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-title {
    font-size: clamp(16px, 1.8vw, 18px);
    font-weight: 800;
    color: var(--c-text-dark);
    margin: 0;
    text-align: left;
}

.result-highlight-box {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(168, 85, 247, 0.05));
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    padding: 6px 14px;
    width: auto;
    text-align: right;
    margin: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-highlight-box .passage-question-type {
    margin: 0 !important;
    padding: 0;
    background: transparent;
}

.result-highlight-value {
    font-size: clamp(18px, 2vw, 20px);
    font-weight: 800;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
    line-height: 1;
}

.result-description-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: clamp(12px, 1.5vw, 16px);
    width: 100%;
    margin-bottom: auto;
    /* Pushes the button to the bottom */
}

.result-description-text {
    font-size: clamp(13px, 1.2vw, 14px);
    line-height: 1.6;
    color: var(--c-text-light);
    white-space: pre-line;
}

/* 診断のサマリーなどがリストになっている場合のスタイル */
.result-description-text ul {
    margin-top: 10px;
    padding-left: 20px;
}

.result-description-text li {
    margin-bottom: 5px;
}

/* Complete Button inside panel */
.btn-panel-next {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
    margin-top: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-panel-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

/* =========================================
   Diagnostic Action Buttons
   ========================================= */
.restart-test-btn {
    width: 100%;
    max-width: 300px;
    padding: 14px 24px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.restart-test-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.passage-return-btn {
    width: 100%;
    padding: 16px;
    background: #e2e8f0;
    color: #475569;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.passage-return-btn:hover {
    background: #cbd5e1;
    color: #334155;
    transform: translateY(-2px);
}

@keyframes resultPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================================
   MBTI グラフ用スタイル
   ========================================= */
.mbti-chart-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.mbti-chart-row {
    display: flex;
    flex-direction: column;
}

.mbti-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.mbti-letter {
    font-size: 16px;
    font-weight: 800;
    color: #94a3b8;
    /* gray-400 */
}

.mbti-letter.dominant {
    font-weight: 900;
}

.mbti-letter.dominant-left {
    color: #e11d48;
    /* rose-600 — matches fill-left bar */
}

.mbti-letter.dominant-right {
    color: #6366f1;
    /* indigo-500 — matches fill-right bar */
}

.mbti-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    /* slate-500 */
}

.mbti-bar-bg {
    width: 100%;
    height: 24px;
    background: #f1f5f9;
    /* slate-100 */
    border-radius: 12px;
    position: relative;
    margin-top: 6px;
}

.mbti-bar-fill {
    position: absolute;
    height: 100%;
    background: #fb7185;
    /* rose-400 */
    border-radius: 12px;
    display: flex;
    align-items: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.mbti-bar-fill.fill-left {
    left: 0;
    right: auto;
    justify-content: center;
}

.mbti-bar-fill.fill-right {
    left: auto;
    right: 0;
    margin-left: auto;
    justify-content: center;
    background: #818cf8;
    /* indigo-400 — visually distinguish right-side dominance */
}

/* =========================================
   MBTI 学習ヒント用スタイル
   ========================================= */
.mbti-tips-container {
    background: #f0fdf4;
    /* green-50 */
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    margin-bottom: 24px;
}

.mbti-tips-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mbti-tips-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mbti-tips-item {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.mbti-tips-item i {
    color: #22c55e;
    margin-top: 3px;
}

/* =========================================
   Door Animation (Theme Transitions)
   ========================================= */
.css-door-container {
    display: inline-block;
    width: 20px;
    height: 28px;
    border: 3px solid #667eea;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    position: relative;
    perspective: 400px;
    vertical-align: middle;
    background-color: transparent;
}

.css-door {
    width: 100%;
    height: 100%;
    background-color: #667eea;
    transform-origin: left;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 1px 1px 0 0;
    animation: swingOpenInside 2s infinite ease-in-out alternate;
}

.css-door-knob {
    width: 3px;
    height: 3px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes swingOpenInside {

    0%,
    15% {
        transform: rotateY(0deg);
    }

    85%,
    100% {
        transform: rotateY(-80deg);
    }
}

/* =========================================
   Voice Mode UI Styles
   ========================================= */

/* Voice Mode Modal */
.voice-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.voice-modal {
    background: white;
    width: 90%;
    max-width: 340px;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.voice-modal-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 24px;
}

.voice-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--c-text-dark);
    margin-bottom: 10px;
}

.voice-modal-desc {
    font-size: 14px;
    color: var(--c-text-grey);
    margin-bottom: 25px;
    line-height: 1.5;
}

.voice-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.voice-modal-btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.voice-modal-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.voice-modal-cancel:hover {
    background: #e2e8f0;
}

.voice-modal-confirm {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    color: white;
}

.voice-modal-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 114, 182, 0.4);
}

/* Voice Mode Overlay (replaces chat bottom) */
.voice-mode-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* background: rgba(255, 255, 255, 0.95); */
    backdrop-filter: blur(10px);
    padding: 10px 0 15px 0;
    /* border-radius: 20px 20px 0 0; */
    /* box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05); */
    position: relative;
    /* Remove large min-height so it wraps its contents tightly */
    min-height: auto;
}

/* .voice-mode-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8b5cf6;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 20px;
} */

.voice-wave-area {
    position: relative;
    /* Make the layout box much smaller than the actual canvas so it shrinks the bottom bar */
    width: 70px;
    height: 70px;
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#voice-wave-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    max-width: 800px;
    /* 훨씬 길게 스펙트럼 확장 */
    height: 180px;
    pointer-events: none;
    /* Let clicks pass through to button */
}

/* Base button */
.voice-wave-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.4);
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-wave-btn.recording {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 0 25px rgba(225, 29, 72, 0.6);
    animation: pulseMic 2s infinite;
}

@keyframes pulseMic {
    0% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(225, 29, 72, 0.6);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 35px rgba(225, 29, 72, 0.8);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(225, 29, 72, 0.6);
    }
}

.voice-mode-exit-btn {
    margin-top: 10px;
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.voice-mode-exit-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

/* =========================================
   SPI Graphical Results
   ========================================= */
.spi-result-container {
    padding: 20px;
    background: linear-gradient(135deg, #ffffff, #fdfbfb);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.spi-results-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 15px;
}

.spi-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.spi-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.spi-section-title i {
    color: #6366f1;
}

/* Abilities Row */
.spi-ability-row {
    margin-bottom: 15px;
}

.spi-ability-row:last-child {
    margin-bottom: 0;
}

.spi-ability-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grade-badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
}

.grade-badge.A {
    background: #dcfce7;
    color: #166534;
}

.grade-badge.B {
    background: #dbeafe;
    color: #1e40af;
}

.grade-badge.C {
    background: #fef9c3;
    color: #854d0e;
}

.grade-badge.D {
    background: #fee2e2;
    color: #991b1b;
}

.spi-progress-bg {
    width: 100%;
    height: 10px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.spi-progress-fill {
    height: 100%;
    border-radius: 10px;
    /* transition is applied via JS */
}

/* Personality Graphs */
.spi-graph-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spi-personality-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spi-personality-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}

.trait-name {
    color: #334155;
}

.trait-level {
    font-weight: 700;
}

.spi-graph-bg {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
}

.spi-graph-fill {
    height: 100%;
    border-radius: 8px;
    /* transition is applied via JS */
}

/* AI Comment Card */
.spi-ai-comment-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 20px;
    border-radius: 12px;
    position: relative;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
    border-left: 4px solid #6366f1;
}

.spi-ai-comment-card p {
    margin: 0;
    position: relative;
    z-index: 2;
}

.quote-icon {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 40px;
    color: rgba(99, 102, 241, 0.05);
    z-index: 1;
}

/* ========================================= */
/* Highlight Text Utilities                  */
/* ========================================= */
.highlight-text {
    background: linear-gradient(transparent 55%, #ffe066 55%);
    font-weight: 700;
    padding: 0 4px;
    border-radius: 2px;
}

/* ========================================= */
/* Responsive Zoom for Laptops               */
/* 전체 해상도 조절용 (노트북 등 작은 화면 최적화)  */
/* 이 속성은 가로 1025px 이상의 데스크탑/노트북에만 적용하여 모바일 환경을 보호합니다. */
/* ========================================= */
@media screen and (min-width: 1025px) and (max-height: 850px) {
    :root {
        --app-zoom: 0.9;
    }
}

@media screen and (min-width: 1025px) and (max-height: 750px) {
    :root {
        --app-zoom: 0.82;
    }
}

@media screen and (min-width: 1025px) and (max-height: 650px) {
    :root {
        --app-zoom: 0.75;
    }
}

@media screen and (min-width: 1025px) and (max-width: 1400px) and (min-height: 851px) {
    :root {
        --app-zoom: 0.9;
    }
}

/* ============================================================================
   STUDY NOTE – Sidebar List
   ============================================================================ */
.sidebar-study-notes {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 8px;
}

.sidebar-study-notes .sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.sidebar-note-add-btn {
    margin-left: auto;
    background: none;
    border: 1.5px dashed rgba(124, 58, 237, 0.4);
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c3aed;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
}

.sidebar-note-add-btn:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: #7c3aed;
    transform: scale(1.1);
}

.study-note-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
    scrollbar-width: thin;
}

.study-note-list::-webkit-scrollbar {
    width: 4px;
}

.study-note-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.study-note-loading,
.study-note-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 0;
    font-size: 12px;
    color: #94a3b8;
}

.study-note-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.study-note-item:hover {
    background: rgba(124, 58, 237, 0.06);
}

.study-note-item.active {
    background: rgba(124, 58, 237, 0.1);
    box-shadow: inset 3px 0 0 #7c3aed;
}

.study-note-item-icon {
    font-size: 14px;
    color: #a78bfa;
    flex-shrink: 0;
}

.study-note-item-body {
    flex: 1;
    min-width: 0;
}

.study-note-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.study-note-item-meta {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

.study-note-item-delete {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 2px;
    font-size: 11px;
    opacity: 0;
    transition: all 0.15s;
}

.study-note-item:hover .study-note-item-delete {
    opacity: 1;
}

.study-note-item-delete:hover {
    color: #ef4444;
}

.study-note-day-label {
    font-size: 11px;
    font-weight: 600;
    color: #7c3aed;
    padding: 6px 4px 2px;
    letter-spacing: 0.5px;
}


/* ============================================================================
   STUDY NOTE – Notion-Style Editor Modal
   ============================================================================ */
.note-editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.note-editor-modal {
    width: 96vw;
    max-width: 96vw;
    max-height: 95vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.note-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.note-editor-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-editor-icon {
    color: #7c3aed;
    font-size: 16px;
}

.note-editor-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.3px;
}

.note-editor-header-actions {
    display: flex;
    gap: 4px;
}

.note-editor-action-btn {
    background: none;
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 14px;
}

.note-editor-action-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.note-editor-action-btn#note-delete-btn:hover {
    background: #fef2f2;
    color: #ef4444;
}

.note-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 24px;
    overflow-y: auto;
}

.note-editor-title {
    border: none;
    outline: none;
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    padding: 20px 0 8px;
    font-family: inherit;
    letter-spacing: -0.5px;
    background: transparent;
    width: 100%;
}

.note-editor-title::placeholder {
    color: #cbd5e1;
}

.note-editor-divider {
    height: 1px;
    background: linear-gradient(90deg, #e2e8f0 0%, transparent 100%);
    margin: 4px 0 12px;
}

.note-editor-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px 0 12px;
    border-bottom: 1px solid #f8fafc;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.note-toolbar-btn {
    background: none;
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 13px;
}

.note-toolbar-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.note-toolbar-btn.active {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.note-editor-content {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    line-height: 1.8;
    color: #334155;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    resize: none;
    min-height: 280px;
    padding: 0 0 20px;
    background: transparent;
    width: 100%;
    tab-size: 4;
}

.note-editor-content::placeholder {
    color: #cbd5e1;
    line-height: 1.8;
}

.note-editor-preview {
    display: none;
    flex: 1;
    min-height: 280px;
    padding: 0 0 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #334155;
    overflow-y: auto;
}

.note-editor-preview.active {
    display: block;
}

.note-editor-preview h1 {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0.6em 0 0.3em;
    color: #1e293b;
}

.note-editor-preview h2 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0.5em 0 0.3em;
    color: #334155;
}

.note-editor-preview h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0.4em 0 0.2em;
    color: #475569;
}

.note-editor-preview p {
    margin: 0.4em 0;
}

.note-editor-preview ul,
.note-editor-preview ol {
    padding-left: 1.5em;
    margin: 0.4em 0;
}

.note-editor-preview blockquote {
    border-left: 3px solid #a78bfa;
    background: #faf5ff;
    padding: 8px 14px;
    margin: 8px 0;
    border-radius: 0 8px 8px 0;
    color: #6b21a8;
}

.note-editor-preview code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #7c3aed;
}

.note-editor-preview pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 14px 16px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    margin: 8px 0;
}

.note-editor-preview pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.note-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.note-editor-status {
    font-size: 12px;
    color: #94a3b8;
}

.note-editor-footer-actions {
    display: flex;
    gap: 8px;
}

.note-editor-preview-btn {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.note-editor-preview-btn:hover {
    background: #e2e8f0;
}

.note-editor-preview-btn.active {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.note-editor-save-btn {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.note-editor-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

/* ---- Bot bubble "save to note" button ---- */
.bubble-note-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #7c3aed;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    margin-top: 6px;
    transition: all 0.15s;
}

.bubble-note-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: #7c3aed;
    transform: translateY(-1px);
}

.bubble-note-btn i {
    font-size: 10px;
}

/* ============================================================================
   DIAGNOSTIC SELECTION - RETRY BUTTON (MBTI 재시작)
   ============================================================================ */
.card-retry-btn {
    background: transparent !important;
    border: 2px solid currentColor !important;
    opacity: 0.85;
}

.card-retry-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* ============================================================================
   デイリーチェック パネルフォーム
   ============================================================================ */
.dc-panel {
    background: linear-gradient(135deg, #1e1b4b 0%, #1e293b 100%);
    border-radius: 20px;
    padding: 0;
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: dcPanelFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes dcPanelFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dc-panel-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(139, 92, 246, 0.4) 100%);
    padding: 20px 24px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.dc-panel-icon-wrap {
    font-size: 28px;
    margin-bottom: 6px;
    display: block;
}

.dc-panel-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}

.dc-panel-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 4px;
}

.dc-form {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dc-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dc-field-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.dc-field-icon {
    font-size: 15px;
}

.dc-field-sublabel {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
    padding-left: 2px;
}

.dc-yesterday-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 10px;
    padding: 8px 12px;
    flex-wrap: wrap;
}

.dc-day-tag {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.dc-item-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.dc-textarea {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    color: #e2e8f0;
    font-size: 13.5px;
    font-family: inherit;
    line-height: 1.6;
    resize: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
    min-height: 90px;
}

.dc-textarea::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.dc-textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.7);
    background: rgba(255, 255, 255, 0.09);
}

.dc-submit-area {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dc-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dc-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.55);
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.dc-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.dc-submit-icon {
    font-size: 16px;
}

.dc-submit-error {
    font-size: 12px;
    color: #f87171;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 100%;
    text-align: center;
}

/* ============================================================================
   デイリーチェック 昨日のカード
   ============================================================================ */
.dc-yesterday-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: dcPanelFadeIn 0.4s ease both;
}

.dc-yc-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.35));
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.dc-yc-icon {
    font-size: 18px;
}

.dc-yc-date {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3px;
}

.dc-yc-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dc-yc-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dc-yc-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dc-yc-value {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.dc-yesterday-feedback {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dc-fb-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.dc-fb-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.dc-fb-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

.dc-fb-text.dc-pending {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.dc-boss-row {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
    align-items: flex-start;
}

.dc-fb-boss-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.dc-boss-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(99, 102, 241, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   DAILY CHECK TABS
   ============================================================================ */
.dc-dashboard-container {
    width: 100%;
}

.dc-tabs-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #334155;
}

.dc-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.dc-tab-btn:hover {
    color: var(--c-lavender);
}

.dc-tab-btn.active {
    color: var(--c-lavender);
    border-bottom-color: var(--c-lavender);
}

@keyframes activePulse {
    0% {
        box-shadow: inset 0 -4px 10px rgba(99, 102, 241, 0.0);
        color: #94a3b8;
    }

    50% {
        box-shadow: inset 0 -6px 15px rgba(99, 102, 241, 0.3);
        color: var(--c-primary);
    }

    100% {
        box-shadow: inset 0 -4px 10px rgba(99, 102, 241, 0.0);
        color: #94a3b8;
    }
}

.dc-glow-tab {
    animation: activePulse 2s infinite ease-in-out;
    border-radius: 8px 8px 0 0;
}

.dc-tab-content {
    display: none;
}

.dc-tab-content.active {
    display: block;
    animation: fadeInTab 0.3s ease;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   PROGRESS MODAL - 進捗度 카드 + 도넛 + 막대 그래프
   ============================================================================ */

/* 진입 애니메이션 */
@keyframes progressCardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes progressSlideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes progressSlideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes donutSpin {
    from {
        stroke-dashoffset: 283;
    }
}

@keyframes barGrow {
    from {
        width: 0% !important;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* 진행도 모달 래퍼 */
.progress-modal-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

/* 개요 카드 그리드 */
.progress-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 4px 2px 8px;
}

/* 개별 Progress 카드 */
.progress-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    border: 1.5px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    animation: progressCardIn 0.4s ease backwards;
}

.progress-card:nth-child(1) {
    animation-delay: 0.05s;
}

.progress-card:nth-child(2) {
    animation-delay: 0.12s;
}

.progress-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.progress-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.progress-card:hover::before {
    opacity: 1;
}

.progress-card:active {
    transform: translateY(-2px) scale(1.01);
}

/* 카드 타이틀 */
.progress-card-title {
    font-size: 0.82em;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 도넛 그래프 컨테이너 */
.progress-donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.progress-donut-svg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
}

.progress-donut-track {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 18;
}

.progress-donut-fill {
    fill: none;
    stroke-width: 18;
    stroke-linecap: round;
    transform-origin: center;
    transform: rotate(-90deg);
    transition: stroke-dashoffset 0s;
    /* JS로 제어 */
}

.progress-donut-center-text {
    font-size: 22px;
    font-weight: 900;
    text-anchor: middle;
    dominant-baseline: middle;
}

.progress-donut-sub-text {
    font-size: 9px;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: middle;
    fill: #94a3b8;
    letter-spacing: 0.5px;
}

/* 카드 하단 클릭 유도 문구 */
.progress-card-hint {
    text-align: center;
    font-size: 0.73em;
    color: #94a3b8;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: color 0.2s;
}

.progress-card:hover .progress-card-hint {
    color: #6366f1;
}

/* ── 상세 뷰 (Bar Chart) ── */
.progress-detail-view {
    animation: progressSlideLeft 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.progress-back-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.progress-back-btn:hover {
    background: #f1f5f9;
    border-color: #6366f1;
    color: #6366f1;
    transform: scale(1.1);
}

.progress-detail-title {
    font-size: 1em;
    font-weight: 800;
    color: #1e293b;
}

/* 막대 그래프 행 */
.progress-bar-row {
    margin-bottom: 18px;
    animation: progressCardIn 0.4s ease backwards;
}

.progress-bar-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}

.progress-bar-label {
    font-weight: 700;
    color: #334155;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-bar-pct {
    font-weight: 800;
    font-size: 0.9em;
    color: #475569;
    min-width: 36px;
    text-align: right;
}

/* ============================================================================
   KEYBOARD PANEL — Extended Layout (Profile + Shortcuts)
   ============================================================================ */

/* Make keyboard panel use full-height flex column */
.keyboard-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.keyboard-panel>#component-keyboard {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

/* Shortcut area in keyboard panel */
.keyboard-shortcut-area {
    flex-shrink: 0;
    padding: 0 12px 8px;
}

.keyboard-shortcut-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 4px 0;
}

/* Profile area in keyboard panel */
.keyboard-profile-area {
    flex-shrink: 0;
    padding: 0 12px 12px;
    margin-top: auto;
}

/* Profile dropdown position fix for keyboard panel */
.keyboard-profile-area .sidebar-profile-dropdown {
    position: absolute;
    bottom: 60px;
    left: 12px;
    right: 12px;
}


.progress-bar-track {
    width: 100%;
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 5px;
    animation: barGrow 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* 쉬머 (shimmer) 로딩 스켈레톤 */
.progress-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

/* 인터뷰 일지 전용 말풍선 스타일 (오른쪽 메인 채팅 영역의 질문에 적용) */
.interview-bubble {
    background: linear-gradient(135deg, #FFF8E1, #FFECB3) !important;
    border: 2px solid #FFD54F !important;
    border-radius: 16px !important;
    animation: interviewPulse 2s ease-in-out infinite;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
    position: relative;
    color: #4E342E;
}

@keyframes interviewPulse {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
    }

    50% {
        box-shadow: 0 4px 24px rgba(255, 193, 7, 0.5);
    }
}

/* 인터뷰 예시 패널 상단 강조 (왼쪽 리소스 영역) */
.interview-example-header {
    background: linear-gradient(180deg, #FFF3E0, #FFE0B2);
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 6px solid #FF9800;
    margin-bottom: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* 커리큘럼 점프 버튼 */
.curriculum-jump-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 12px 0;
    flex-wrap: wrap;
}

.jump-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.jump-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.jump-btn:active {
    transform: translateY(0);
}

.jump-curriculum {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: white;
    border: none;
}

.jump-normal {
    background: white;
    color: #374151;
    border: 1px solid #e2e8f0;
}

.jump-normal:hover {
    background: #f8fafc;
}