/* 웹폰트 (로컬 폰트 우선, 없으면 웹폰트 사용) */
@font-face {
    font-family: 'HCRBatang';
    src: local('함초롬바탕'), local('함초롬바탕 LVT'), local('HCR Batang LVT'), local('HCRBatang'),
         url('https://webcdn.mediclassics.kr/fonts/HCRBatang/HCRBatang.woff2') format('woff2'),
         url('https://webcdn.mediclassics.kr/fonts/HCRBatang/HCRBatang.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HCRDotum';
    src: local('함초롬돋움'), local('함초롬돋움 LVT'), local('HCR Dotum LVT'), local('HCRDotum'),
         url('https://webcdn.mediclassics.kr/fonts/HCRDotum/HCRDotum.woff2') format('woff2'),
         url('https://webcdn.mediclassics.kr/fonts/HCRDotum/HCRDotum.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HanaMin';
    src: local('HanaMinA'), local('花園明朝A'),
         url('https://webcdn.mediclassics.kr/fonts/HanaMin/HanaMinA.woff2') format('woff2'),
         url('https://webcdn.mediclassics.kr/fonts/HanaMin/HanaMinA.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HanaMin';
    src: local('HanaMinB'), local('花園明朝B'),
         url('https://webcdn.mediclassics.kr/fonts/HanaMin/HanaMinB.woff2') format('woff2'),
         url('https://webcdn.mediclassics.kr/fonts/HanaMin/HanaMinB.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    unicode-range: U+20000-2FFFF;
}

:root {
    --font-size: 22px;
    --font-family-myungjo: 'HCRBatang', 'HanaMin', serif;
    --font-family-gothic: 'HCRDotum', 'HanaMin', sans-serif;
    --font-family: var(--font-family-gothic);
    /* 라이트 테마 (기본) */
    --bg-color: #f5f5f5;
    --panel-bg: #fff;
    --text-color: #333;
    --text-secondary: #666;
    --text-muted: #888;
    --text-placeholder: #999;
    --border-color: #ddd;
    --input-border: #ccc;
    --accent-color: #4a90d9;
    --accent-hover: #3a7bc8;
    --accent-gradient: linear-gradient(135deg, #4a90d9 0%, #3a7bc8 100%);
    --candidate-bg: #f8f8f8;
    --candidate-hover: #e8f0fe;
    --kbd-bg: #f7f7f7;
    --error-color: #d32f2f;
    --error-bg: #ffebee;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --panel-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --text-secondary: #aaa;
    --text-muted: #888;
    --text-placeholder: #666;
    --border-color: #444;
    --input-border: #555;
    --accent-color: #5a9fe9;
    --accent-hover: #4a8fd9;
    --accent-gradient: linear-gradient(135deg, #5a9fe9 0%, #4a8fd9 100%);
    --candidate-bg: #383838;
    --candidate-hover: #3a4a5a;
    --kbd-bg: #383838;
    --error-color: #ef5350;
    --error-bg: #3d2020;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 10px 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 0;
    position: relative;
}

h1 {
    color: var(--text-color);
    margin: 0;
    font-size: 1.5em;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 8px;
    background-color: var(--text-secondary);
    color: var(--panel-bg);
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.help-icon:hover {
    background-color: var(--accent-color);
}

.title-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 0;
}

.font-switch {
    position: relative;
    display: inline-block;
    width: 84px;
    height: 36px;
    margin-right: 12px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 66px;
    height: 36px;
    margin-right: 12px;
}

.font-switch input,
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.font-switch .slider,
.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 36px;
    transition: 0.3s;
}

.font-switch .slider::before,
.theme-switch .slider::before {
    position: absolute;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: 28px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

/* 폰트 스위치 */
.font-switch .slider::before {
    content: "고딕";
    width: 38px;
    height: 28px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: bold;
}

.font-switch input:checked + .slider {
    background-color: #888;
}

.font-switch input:checked + .slider::before {
    content: "명조";
    transform: translateX(38px);
}

/* 테마 스위치 */
.theme-switch .slider::before {
    content: "☀";
}

.theme-switch input:checked + .slider {
    background-color: #555;
}

.theme-switch input:checked + .slider::before {
    content: "☾";
    transform: translateX(30px);
    background-color: #222;
    color: #fff;
}

/* 다크 테마 스위치 스타일 */
[data-theme="dark"] .font-switch .slider,
[data-theme="dark"] .theme-switch .slider {
    background-color: #555;
}

[data-theme="dark"] .font-switch .slider::before,
[data-theme="dark"] .theme-switch .slider::before {
    background-color: #e0e0e0;
    color: #222;
}

[data-theme="dark"] .font-switch input:checked + .slider {
    background-color: #777;
}

[data-theme="dark"] .theme-switch input:checked + .slider::before {
    background-color: #444;
    color: #fff;
}

.container {
    display: flex;
    gap: 15px;
    height: calc(100vh - 150px);
    max-width: 1200px;
    margin: 0 auto;
}

/* 왼쪽: 텍스트박스 */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 70px;
    box-sizing: border-box;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 80px;
    height: 40px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.toolbar-btn:hover {
    filter: brightness(0.95);
}

.toolbar-spacer {
    flex: 1;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save {
    background-color: #4caf50;
    border-color: #43a047;
    color: #fff;
}

.doc-stats {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 12px;
    white-space: nowrap;
}

#editor {
    flex: 1;
    padding: 15px;
    font-size: var(--font-size);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    line-height: 1.8;
    background-color: var(--panel-bg);
    color: var(--text-color);
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    transition: background-color 0.3s, border-color 0.3s;
}

#editor:focus {
    outline: none;
    border-color: var(--accent-color);
}

#editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-placeholder);
}

/* 가짜 커서 (에디터에 포커스가 없을 때 표시) */
.fake-cursor {
    display: inline;
    width: 0;
    border-left: 2px solid var(--accent-color);
    margin-left: -1px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 에디터에 포커스가 있으면 가짜 커서 숨김 */
#editor:focus .fake-cursor {
    display: none;
}

/* 오른쪽: 재춘법 입력 */
.right-panel {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-section {
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--panel-bg);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
    box-sizing: border-box;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.input-label {
    font-size: 11px;
    color: var(--accent-color);
    font-weight: bold;
}

.word-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
}

.word-toggle input {
    cursor: pointer;
}

#hangul-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 18px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    text-align: center;
    background-color: var(--panel-bg);
    color: var(--text-color);
    transition: background-color 0.3s, border-color 0.3s;
}

#hangul-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.candidates-section {
    flex: 1;
    min-height: 0;
    background-color: var(--panel-bg);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-y: auto;
    transition: background-color 0.3s, border-color 0.3s;
}

.candidates-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-align: center;
}

.candidates-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.no-candidates {
    color: var(--text-placeholder);
    font-size: 16px;
    line-height: 170%;
    padding: 15px;
}

.no-candidates .help-title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 15px;
}

.no-candidates .help-section {
    margin-bottom: 12px;
}

.no-candidates hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}

.no-candidates .help-section strong {
    display: block;
    text-align: center;
    margin-bottom: 5px;
}

.no-candidates ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.no-candidates li {
    margin-bottom: 3px;
}

.no-candidates kbd {
    display: inline;
    padding: 0 5px;
    font-size: 14px;
    font-family: inherit;
    background-color: var(--kbd-bg);
    border: 1px solid var(--input-border);
    border-radius: 3px;
    color: var(--text-color);
    vertical-align: baseline;
}

.candidate {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background-color: var(--candidate-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.candidate:hover {
    background-color: var(--candidate-hover);
    border-color: var(--accent-color);
}

.candidate.selected {
    border-color: var(--accent-color);
}

.candidate-number {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-secondary);
    margin-right: 12px;
    min-width: 24px;
}

.candidate-char {
    font-size: var(--font-size);
    line-height: 1;
    min-width: 1.5em;
    text-align: center;
}

/* 확장영역 뱃지 */
.ext-badge {
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: bold;
    vertical-align: middle;
}

.ext-badge.ext-ce {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.ext-badge.ext-fj {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

[data-theme="dark"] .ext-badge.ext-ce {
    background-color: #1e3a5f;
    color: #90caf9;
    border-color: #1565c0;
}

[data-theme="dark"] .ext-badge.ext-fj {
    background-color: #4a1c1c;
    color: #ef9a9a;
    border-color: #c62828;
}

.candidate-key {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 10px;
}

.candidate-meaning {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: auto;
    text-align: right;
}

.font-size-control {
    display: inline-flex;
    align-items: center;
    height: 36px;
    background-color: #ccc;
    border-radius: 18px;
    padding: 0 3px;
    gap: 3px;
}

.font-size-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: white;
    color: #333;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.font-size-btn:hover {
    background-color: #f0f0f0;
}

.font-size-display {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    min-width: 44px;
    text-align: center;
}

[data-theme="dark"] .font-size-control {
    background-color: #555;
}

[data-theme="dark"] .font-size-btn {
    background-color: #e0e0e0;
    color: #222;
}

[data-theme="dark"] .font-size-btn:hover {
    background-color: #ccc;
}

[data-theme="dark"] .font-size-display {
    color: #ddd;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--text-secondary);
}

.error {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--error-color);
    background-color: var(--error-bg);
    border-radius: 8px;
}

/* 푸터 */
.footer {
    text-align: center;
    padding: 15px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    background-color: var(--bg-color);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.footer-separator {
    margin: 0 10px;
    color: var(--border-color);
}

/* 도움말 모달 */
.help-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.help-modal-overlay.show {
    display: flex;
}

.help-modal {
    background: var(--panel-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--accent-gradient);
    border-radius: 16px 16px 0 0;
}

.help-modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
}

.help-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.help-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
}

.help-modal-body h1 {
    display: none;
}

.help-modal-body h2 {
    color: var(--accent-color);
    margin-top: 32px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.help-modal-body h2:first-of-type {
    margin-top: 0;
}

.help-modal-body h3 {
    color: var(--text-color);
    margin-top: 24px;
    margin-bottom: 12px;
}

.help-modal-body p {
    margin-bottom: 12px;
}

.help-modal-body ul, .help-modal-body ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

.help-modal-body li {
    margin-bottom: 6px;
}

.help-modal-body code {
    background: var(--kbd-bg);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.9em;
    color: var(--accent-color);
}

.help-modal-body pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.help-modal-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.help-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
}

.help-modal-body th {
    background: var(--candidate-bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
}

.help-modal-body td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.help-modal-body tbody tr:hover {
    background: var(--candidate-bg);
}

.help-modal-body blockquote {
    border-left: 4px solid var(--accent-color);
    padding: 12px 16px;
    margin: 16px 0;
    background: var(--candidate-bg);
    border-radius: 0 8px 8px 0;
}

.help-modal-body blockquote p {
    margin: 0;
}

.help-modal-body a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

.help-modal-body a:hover {
    text-decoration: underline;
}

[data-theme="dark"] .help-modal-body a {
    color: #7bb8f5;
}

.help-modal-body hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 32px 0;
}

@media (max-width: 768px) {
    .help-modal {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .help-modal-header {
        padding: 12px 16px;
        border-radius: 12px 12px 0 0;
    }

    .help-modal-body {
        padding: 16px;
    }

    /* 모바일 레이아웃 */
    body {
        padding: 8px;
        height: auto;
        overflow: auto;
    }

    .header {
        padding: 10px 0;
        position: relative;
    }

    h1 {
        font-size: 1.2em;
    }

    /* 햄버거 버튼 */
    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: var(--panel-bg);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        font-size: 20px;
        cursor: pointer;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }

    /* 메뉴 오버레이 */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 50;
    }

    .menu-overlay.show {
        display: block;
    }

    /* 설정 메뉴 (기본 숨김) */
    .title-controls {
        display: none;
        position: absolute;
        right: 0;
        top: 100%;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 10px;
        background: var(--panel-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 100;
    }

    .title-controls.show {
        display: flex;
    }

    .title-controls .font-switch,
    .title-controls .theme-switch,
    .title-controls .font-size-control {
        margin: 0 auto;
    }

    /* 컨테이너 세로 배치 */
    .container {
        flex-direction: column;
        height: auto;
    }

    /* 에디터 1줄 높이 */
    .left-panel {
        flex: none;
    }

    #editor {
        flex: none;
        height: calc(var(--font-size) * 2.4 + 30px);
        min-height: unset;
        overflow-y: auto;
        line-height: 1.2;
        -webkit-user-select: text;
        user-select: text;
        touch-action: auto;
    }

    /* 입력 영역 */
    .right-panel {
        width: 100%;
    }

    .input-section {
        height: auto;
        padding: 8px;
    }

    /* 후보 영역 */
    .candidates-section {
        min-height: 200px;
        padding: 8px;
    }

    /* 페이지 라벨 숨김 */
    .candidates-label {
        display: none;
    }

    /* 후보 그리드 (2열 x 5행 세로 배치) */
    .candidates-grid-wrapper {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-nav-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 100%;
        min-height: 180px;
        background: var(--candidate-bg);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        font-size: 20px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .mobile-nav-btn:hover {
        background: var(--candidate-hover);
    }

    .mobile-nav-btn:disabled {
        opacity: 0.3;
        cursor: default;
    }

    .candidates-list {
        flex: 1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(5, 1fr);
        grid-auto-flow: column;
        gap: 4px;
    }

    .candidate {
        padding: 8px;
        justify-content: flex-start;
    }

    .candidate-number {
        font-size: 14px;
        margin-right: 8px;
        min-width: 18px;
    }

    .candidate-char {
        font-size: var(--font-size);
    }

    .candidate-key,
    .candidate-meaning {
        display: none;
    }

    /* 확장영역 뱃지 숨김 */
    .ext-badge {
        display: none;
    }

    /* 안내문 너비 90% - 그리드/래퍼 무시하고 전체 너비 사용 */
    .candidates-grid-wrapper:has(.no-candidates) {
        display: block;
    }

    .candidates-grid-wrapper:has(.no-candidates) .mobile-nav-btn {
        display: none;
    }

    .candidates-list:has(.no-candidates) {
        display: block;
    }

    .no-candidates {
        width: 90%;
        max-width: none;
        margin: 0 auto;
        font-size: 14px;
        padding: 10px;
        box-sizing: border-box;
    }

    /* 툴바 레이아웃 */
    .editor-toolbar {
        flex-wrap: wrap;
        height: auto;
        gap: 6px;
    }

    .toolbar-left {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .toolbar-right {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
    }

    /* 복사/저장 버튼 아이콘만 */
    .toolbar-btn {
        width: 40px;
        height: 36px;
        font-size: 16px;
    }

    .toolbar-btn .btn-label {
        display: none;
    }

    /* 통계 2줄 배치 */
    .doc-stats {
        display: flex;
        flex-direction: column;
        font-size: 11px;
        margin-left: 6px;
        line-height: 1.4;
    }

    .toolbar-spacer {
        display: none;
    }

    /* 푸터 */
    .footer {
        padding: 10px;
        font-size: 12px;
    }

    .footer-separator {
        margin: 0 6px;
    }

}

/* 데스크톱에서 햄버거 숨김 */
@media (min-width: 769px) {
    .hamburger-btn {
        display: none;
    }

    .mobile-nav-btn {
        display: none;
    }

    .candidates-grid-wrapper {
        display: contents;
    }
}

/* 모바일이지만 세로가 충분할 때: 데스크톱처럼 10개 세로 표시 */
@media (max-width: 768px) and (min-height: 800px) {
    .candidates-section {
        min-height: 300px;
        flex: 1;
    }

    .candidates-label {
        display: block;
    }

    .candidates-grid-wrapper {
        display: contents;
    }

    .mobile-nav-btn {
        display: none;
    }

    .candidates-list {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .candidate-key {
        display: inline;
    }

    .candidate-meaning {
        display: inline;
    }

    .ext-badge {
        display: inline;
    }
}
