html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background-color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-wrapper {
    width: 100%;
    max-width: 430px;
    height: 100%;
    height: 100dvh;
    max-height: 880px;
    background-color: #f8fafc;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    html, body {
        background-color: #f8fafc;
        display: block;
    }
    .phone-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
}

.header {
    background-color: #0f172a;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    box-sizing: border-box;
    flex-shrink: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-btn {
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    background-color: rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    text-align: center;
}

.header-btn:active {
    transform: scale(0.95);
    background-color: rgba(255, 255, 255, 0.2);
}

#header-center-title {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.body-container {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-sizing: border-box;
    background-color: #f8fafc;
}

/* 출강EO 스타일 모바일 피드 카드 레이아웃 */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 20px;
}

.feed-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feed-card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.feed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.feed-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 6px;
    background-color: #fee2e2;
    color: #ef4444;
}

.feed-badge.blue {
    background-color: #e0f2fe;
    color: #0284c7;
}

.feed-badge.green {
    background-color: #dcfce7;
    color: #16a34a;
}

.feed-status-tag {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
}

.feed-card-main {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.feed-thumb {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    background: #f1f5f9;
}

.feed-thumb.written {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
}

.feed-thumb.practical {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #16a34a;
}

.feed-info {
    flex: 1;
    min-width: 0;
}

.feed-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 3px 0;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-desc {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-spec-box {
    background-color: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 11.5px;
}

.feed-spec-item {
    display: flex;
    align-items: center;
    color: #475569;
}

.feed-spec-label {
    color: #94a3b8;
    margin-right: 6px;
    font-weight: 600;
}

.feed-spec-val {
    font-weight: 700;
    color: #1e293b;
}

/* 코랄 레드 액션 버튼 (출강EO 스타일) */
.card-action-btn {
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(135deg, #ff4d4d 0%, #ff6b6b 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.22);
    transition: all 0.2s ease;
}

.card-action-btn-green {
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(135deg, #05c863 0%, #05c863 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.22);
    transition: all 0.2s ease;
}

.card-action-btn:hover {
    background: linear-gradient(135deg, #ea3838 0%, #ff5252 100%);
}

.card-action-btn:active {
    transform: scale(0.98);
}

.card-action-btn.secondary {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.18);
}

/* 상단 유틸 툴바 (검색 및 데이터 백업/복원) */
.dashboard-util-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.search-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.search-select {
    width: 78px;
    height: 42px;
    padding: 0 6px;
    font-size: 12.5px;
    font-weight: bold;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    background-color: #f8fafc;
}

.search-input {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    font-size: 13.5px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
}

.search-btn {
    height: 42px;
    padding: 0 14px;
    background-color: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.backup-btn-group {
    display: flex;
    gap: 8px;
}

.util-sub-btn {
    flex: 1;
    padding: 8px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.util-sub-btn:active {
    background-color: #edf2f7;
}

/* 질문 및 풀이 화면 공통 스타일 */
.step-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.step-label {
    font-size: 13px;
    color: #64748b;
}

.step-label.clickable {
    cursor: pointer;
    color: #0284c7;
    font-weight: bold;
    padding: 4px 10px;
    border: 1px solid #bae6fd;
    border-radius: 16px;
    background: #f0f9ff;
}

.timer-display {
    font-size: 12.5px;
    font-weight: bold;
    color: #dc2626;
    background: #fee2e2;
    padding: 4px 10px;
    border-radius: 12px;
    margin-right: auto;
    margin-left: 10px;
}

.bookmark-toggle-btn {
    font-size: 20px;
    cursor: pointer;
    user-select: none;
    color: #f59e0b;
}

.source-tag {
    font-size: 12px;
    color: #0284c7;
    font-weight: bold;
    margin-bottom: 8px;
}

.q-title-instruction {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.5;
    margin-bottom: 12px;
}

.q-desc-card-box {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0284c7;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
    color: #334155;
    line-height: 1.65;
}

.q-blank {
    display: inline-block;
    min-width: 32px;
    padding: 1px 6px;
    margin: 0 3px;
    background-color: #fef08a;
    border: 1px dashed #ca8a04;
    border-radius: 4px;
    color: #854d0e;
    font-weight: 700;
    text-align: center;
    font-size: 13px;
}

.box-view {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
    white-space: pre-line;
    margin-bottom: 16px;
}

.input-block-wrapper { margin-bottom: 16px; }
.input-label-text {
    font-size: 12.5px;
    color: #64748b;
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.input-answer {
    width: 100%;
    padding: 12px 14px;
    font-size: 14.5px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    background: #ffffff;
}

.input-answer:focus { border-color: #0284c7; }

.action-toggle-card {
    background-color: #0f172a;
    color: #ffffff;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    margin: 12px 0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.instant-feedback-panel {
    margin: 12px 0 16px 0;
    padding: 14px 16px;
    border-radius: 10px;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 5px solid #16a34a;
}

.nav-btn-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-bottom: 10px;
}

.nav-control-btn {
    flex: 1;
    background-color: #0f172a;
    color: #ffffff;
    border: none;
    padding: 13px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
}

.nav-control-btn:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

.tab-fixed-bar {
    width: 100%;
    height: 58px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-sizing: border-box;
    z-index: 100;
    flex-shrink: 0;
}

.tab-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
}

.tab-unit.active { color: #0284c7; font-weight: bold; }
.tab-icon-img { font-size: 18px; margin-bottom: 2px; }

.cbt-choices-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.cbt-choice-btn {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13.5px;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    outline: none;
    width: 100%;
}

.cbt-choice-btn.selected {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    font-weight: bold;
}

.cbt-choice-num {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #cbd5e1;
    color: #ffffff;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
    font-size: 12px;
}

.cbt-choice-btn.selected .cbt-choice-num {
    background-color: #3b82f6;
}

.log-box-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-top: 4px solid #0f172a;
    position: relative;
}

.history-wrong-item {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 10px;
    margin-top: 10px;
    font-size: 12.5px;
    border-radius: 4px;
}

.q-nav-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.q-nav-modal-content {
    background: #ffffff;
    width: 90%;
    max-height: 70%;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.q-nav-modal-header {
    padding: 14px;
    background: #0f172a;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    font-size: 15px;
    position: relative;
}

.q-nav-modal-close {
    position: absolute;
    right: 14px;
    top: 14px;
    cursor: pointer;
    font-size: 16px;
}

.q-nav-modal-body {
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.q-nav-list-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
}

.q-nav-list-btn.current {
    border: 2px solid #ef4444;
    background-color: #fef2f2;
    font-weight: bold;
}

.q-nav-status {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 10px;
    background-color: #cbd5e1;
    color: #ffffff;
}

.q-nav-status.answered { background-color: #0284c7; }

/* 합격 축하 전용 카드 */
.pass-celebration-card {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    padding: 26px 18px;
    border-radius: 14px;
    margin-bottom: 16px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.cute-mascot {
    width: 70px;
    height: 70px;
    margin: 0 auto 8px auto;
}

/* 초기 모드 선택 화면 스타일 */
.mode-select-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 30px 16px 20px 16px;
    min-height: 100%;
    box-sizing: border-box;
}

.hero-badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    color: #0284c7;
    background-color: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 16px;
    margin-bottom: 14px;
}

.hero-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin: 0 0 8px 0;
    text-align: center;
}

.hero-sub {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 28px 0;
    text-align: center;
}

.mode-card-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modern-mode-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modern-mode-card:active { transform: scale(0.98); }
.modern-mode-card.written { border-left: 5px solid #2563eb; }
.modern-mode-card.practical { border-left: 5px solid #16a34a; }

.card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
}

.written-bg { background-color: #eff6ff; color: #2563eb; }
.practical-bg { background-color: #f0fdf4; color: #16a34a; }

.card-content { flex: 1; text-align: left; }
.card-tag { font-size: 11px; font-weight: 700; margin-bottom: 2px; }
.written-tag { color: #2563eb; }
.practical-tag { color: #16a34a; }
.card-title { font-size: 17px; font-weight: 800; color: #1e293b; margin-bottom: 3px; }
.card-desc { font-size: 12px; color: #64748b; line-height: 1.4; }
.card-arrow { font-size: 16px; color: #cbd5e1; margin-left: 8px; }

/* 표 및 칩 */
.quiz-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 8px 0 10px 0;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
}

.quiz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    color: #334155;
}

.quiz-table th {
    background-color: #f1f5f9;
    color: #0f172a;
    font-weight: bold;
    padding: 8px 10px;
    border-bottom: 2px solid #cbd5e1;
    border-right: 1px solid #e2e8f0;
    text-align: center;
}

.quiz-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    line-height: 1.45;
}

.view-bogi-container {
    display: inline-block;
    width: 100%;
    margin: 6px 0 10px 0;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    box-sizing: border-box;
}

.view-bogi-title {
    font-size: 11.5px;
    font-weight: bold;
    color: #475569;
    margin-bottom: 6px;
}

.view-bogi-chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.view-bogi-chip {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: #334155;
}

.code-flow-box {
    background-color: #0f172a;
    color: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 8px 0 12px 0;
    font-family: Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.55;
    white-space: pre-wrap; /* 줄 바꿈 및 공백 들여쓰기 유지 */
    overflow-x: auto;
}

.app-footer {
    width: 100%;
    padding: 20px 10px 14px 10px;
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    box-sizing: border-box;
}

.brand-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #475569;
    margin: 0 0 4px 0;
}

.disclaimer-text {
    font-size: 11px;
    line-height: 1.5;
    color: #94a3b8;
    word-break: keep-all;
    margin: 0 0 6px 0;
}

.copyright-text {
    font-size: 10px;
    color: #cbd5e1;
    margin: 0;
}
/* 회차 선택 드롭다운 스타일 */
.feed-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    background-color: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    margin-bottom: 12px;
    box-sizing: border-box;
    cursor: pointer;
}

.feed-select:focus {
    border-color: #0284c7;
    background-color: #ffffff;
}