:root {
    --present-bg: #f4efe6;
    --present-panel: rgba(255, 252, 247, 0.92);
    --present-border: rgba(44, 36, 24, 0.1);
    --present-text: #201a13;
    --present-muted: #5a534a;
    --present-accent: #8c4b2f;
    --present-accent-soft: rgba(140, 75, 47, 0.12);
    --present-body-bg: #fff;
    --present-input-bg: #fff;
    --present-card-bg: var(--present-card-bg);
    --present-modal-bg: #fff;
    --present-slide-default-bg: #fff;
    --present-primary-btn-bg: #17120d;
    --present-primary-btn-color: #fff;
}

body.present-body.dark {
    --present-bg: #0d0d0d;
    --present-panel: rgba(22, 22, 22, 0.92);
    --present-border: rgba(255, 255, 255, 0.12);
    --present-text: #ffffff;
    --present-muted: #b0a89e;
    --present-accent: #c17352;
    --present-accent-soft: rgba(193, 115, 82, 0.18);
    --present-body-bg: #000;
    --present-input-bg: #1a1a1a;
    --present-card-bg: rgba(26, 26, 26, 0.82);
    --present-modal-bg: #171717;
    --present-slide-default-bg: #000;
    --present-primary-btn-bg: #ffffff;
    --present-primary-btn-color: #0a0a0a;
}

body.present-body {
    overflow: hidden;
    background: var(--present-body-bg);
    color: var(--present-text);
    height: 100vh;
}

.present-shell {
    display: flex;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.present-sidebar {
    width: 320px;
    min-width: 320px;
    padding: 28px 22px;
    border-right: 1px solid var(--present-border);
    background: rgba(251, 246, 239, 0.88);
    backdrop-filter: blur(12px);
    overflow-y: auto;
    transform: translateX(0);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
                margin-left 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.present-shell.sidebar-collapsed .present-sidebar {
    transform: translateX(-100%);
    margin-left: -320px;
}

.present-brand h1 {
    font-size: 28px;
    line-height: 1.1;
    margin-bottom: 10px;
}

.present-eyebrow {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--present-accent);
    margin-bottom: 12px;
}

.present-panel {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--present-border);
    border-radius: 18px;
    background: var(--present-panel);
    box-shadow: 0 12px 30px rgba(77, 55, 27, 0.06);
}

.present-panel-title {
    font-size: 14px;
    color: var(--present-muted);
    margin-bottom: 10px;
}

.present-row {
    display: flex;
    gap: 8px;
}

.present-row input,
.present-row button {
    font: inherit;
    border-radius: 999px;
}

.present-row input {
    min-width: 0;
    flex: 1;
    border: 1px solid var(--present-border);
    background: var(--present-input-bg);
    color: var(--present-text);
    padding: 10px 14px;
}

.present-row button {
    border: none;
    background: var(--present-primary-btn-bg);
    color: var(--present-primary-btn-color);
    padding: 10px 14px;
    cursor: pointer;
}

.present-search-input {
    width: 100%;
    font: inherit;
    border: 1px solid var(--present-border);
    border-radius: 14px;
    background: var(--present-input-bg);
    color: var(--present-text);
    padding: 10px 14px;
}

.present-search-results {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    max-height: 280px;
    overflow-y: auto;
}

.present-search-card {
    padding: 12px 14px;
    border: 1px solid var(--present-border);
    border-radius: 14px;
    background: var(--present-card-bg);
}

.present-search-title {
    display: block;
    font-size: 15px;
    color: var(--present-text);
}

.present-search-card.is-image-folder {
    border-style: dashed;
}

.present-search-folder-icon {
    display: inline-block;
    margin-right: 4px;
    font-size: 14px;
}

.present-search-meta {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--present-muted);
}

.present-search-snippet {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    color: var(--present-muted);
    margin-top: 4px;
}

.present-search-add {
    width: 100%;
    margin-top: 8px;
    font: inherit;
    border: 1px solid var(--present-border);
    border-radius: 999px;
    background: var(--present-input-bg);
    color: var(--present-text);
    padding: 8px 10px;
    cursor: pointer;
}

.present-search-add:hover {
    background: var(--present-accent-soft);
}

/* 곡 순서 */
.present-setlist {
    display: grid;
    gap: 8px;
    min-height: 40px;
}

.present-setlist-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--present-border);
    border-radius: 14px;
    background: var(--present-card-bg);
    cursor: grab;
    user-select: none;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.present-setlist-card:active {
    cursor: grabbing;
}

.present-setlist-card.is-active {
    border-color: rgba(140, 75, 47, 0.32);
    background: var(--present-accent-soft);
}

.present-setlist-card.is-dragging {
    opacity: 0.5;
}

.present-setlist-card.drag-over {
    border-color: var(--present-accent);
    transform: translateY(-2px);
}

.present-setlist-info {
    flex: 1;
    min-width: 0;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    padding-right: 4px;
}

.present-setlist-title {
    display: block;
    font-size: 15px;
    color: var(--present-text);
    white-space: nowrap;
    overflow: hidden;
}

.present-setlist-title-inner {
    display: inline-block;
    white-space: nowrap;
}

.present-setlist-title.is-overflow .present-setlist-title-inner {
    animation: present-marquee var(--marquee-duration, 8s) linear infinite;
}

@keyframes present-marquee {
    0%, 8% { transform: translateX(0); }
    50%, 58% { transform: translateX(var(--marquee-distance, 0)); }
    100% { transform: translateX(0); }
}

.present-setlist-meta {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--present-muted);
    white-space: nowrap;
    overflow: hidden;
}

.present-setlist-order {
    font-size: 13px;
    color: var(--present-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 1.6em;
    text-align: right;
}

.present-setlist-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: linear-gradient(to right, transparent, var(--present-card-bg) 22%);
    padding-left: 18px;
    border-radius: 999px;
}

.present-setlist-card:hover .present-setlist-actions,
.present-setlist-card.is-active .present-setlist-actions {
    background: linear-gradient(to right, transparent, var(--present-accent-soft, rgba(140, 75, 47, 0.12)) 22%);
}

.present-setlist-more {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--present-border);
    border-radius: 999px;
    background: var(--present-input-bg);
    color: var(--present-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 120ms ease, border-color 120ms ease;
}

.present-setlist-more:hover,
.present-setlist-more.is-active {
    color: var(--present-accent);
    border-color: var(--present-accent);
}


.present-setlist-empty {
    font-size: 13px;
    color: var(--present-muted);
    text-align: center;
    padding: 12px 0;
}

/* 사이드바 토글 */
.present-toggle-sidebar {
    position: fixed;
    top: 12px;
    left: 328px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--present-border);
    border-radius: 999px;
    background: var(--present-panel);
    color: var(--present-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: rotate(0deg);
    transition: left 300ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.present-toggle-sidebar::before {
    content: "";
    display: block;
    width: 7px;
    height: 7px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 2px;
}

.present-shell.sidebar-collapsed .present-toggle-sidebar {
    left: 8px;
    transform: rotate(180deg);
}

/* 메인 영역 */
.present-main {
    position: relative;
    overflow: hidden;
    height: 100vh;
    flex: 1;
    min-width: 0;
}

.present-main .presentation {
    width: 100%;
    height: 100%;
    position: relative;
}

/* presentation.css의 100vw 기본 크기 덮어쓰기 */
.present-body .presentation {
    width: 100% !important;
    height: 100vh !important;
}

/* 프레젠테이션 슬라이드가 부모 크기에 맞추도록 */
.present-body .slide {
    padding: 6% 1.5% 4% 1.5%;
}

/* 가사(찬송가) 슬라이드의 상단 제목 높이를 이미지 슬라이드(.slide-media, top 3%)와
 * 동일하게 맞춘다. 기본 .slide의 top 6%를 3%로 낮춰 제목 y 위치를 위로 올림. */
.present-body .slide.slide-lyrics {
    padding-top: 3%;
}

/* 메인 슬라이드 콘텐츠의 너비 제한을 풀어 더 긴 악보가 가득 차도록 한다. */
.present-body .slide:not(.slide-text) .slide-content {
    max-width: none;
}

.present-status {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 20;
    max-width: min(640px, calc(100vw - 40px));
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--present-modal-bg);
    color: var(--present-text);
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--present-border);
}

.present-status.warning {
    border: 1px solid rgba(255, 107, 53, 0.35);
}

/* 슬라이드 카운터 */
.present-slide-counter {
    position: absolute;
    right: 24px;
    bottom: 24px;
    z-index: 10;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--present-text);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* presentation.css의 hymn-picker와 app-status 숨기기 */
.present-body .hymn-picker,
.present-body .app-status {
    display: none;
}

/* 셋 제목 행 */
.present-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.present-setlist-name {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid var(--present-border);
    border-radius: 12px;
    background: var(--present-input-bg);
    padding: 10px 14px;
    color: var(--present-text);
}

.present-setlist-name:focus {
    outline: none;
    border-color: var(--present-accent);
}

.present-dirty-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--present-accent);
    box-shadow: 0 0 0 3px var(--present-accent-soft);
    flex-shrink: 0;
}

/* 액션 바 (저장/불러오기/새로만들기/undo/redo/테마) */
.present-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--present-border);
    border-radius: 999px;
    background: var(--present-panel);
}

.present-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--present-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.present-icon-btn:hover {
    background: var(--present-accent-soft);
    border-color: rgba(140, 75, 47, 0.25);
    color: var(--present-accent);
}

.present-icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 패널 헤더 (곡 순서 + 추가 버튼) */
.present-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
}

.present-panel-header .present-panel-title {
    margin-bottom: 0;
}

/* 액션바 드롭다운 (저장/불러오기) */
.present-action-menu-wrap {
    position: relative;
}

.present-action-dropdown {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 10px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    min-width: 120px;
    padding: 6px;
    border: 1px solid var(--present-border);
    border-radius: 12px;
    background: var(--present-modal-bg);
    color: var(--present-text);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.present-action-dropdown[hidden] { display: none; }

.present-action-dropdown button {
    font: inherit;
    font-size: 13px;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.present-action-dropdown button:hover {
    background: var(--present-accent-soft);
    color: var(--present-accent);
}

.present-add-menu-wrap {
    position: relative;
}

.present-add-btn {
    font: inherit;
    font-size: 13px;
    border: 1px solid var(--present-border);
    border-radius: 999px;
    background: var(--present-input-bg);
    color: var(--present-text);
    padding: 6px 12px;
    cursor: pointer;
}

.present-add-btn:hover {
    background: var(--present-accent-soft);
    border-color: var(--present-accent);
    color: var(--present-accent);
}

.present-add-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    min-width: 140px;
    padding: 6px;
    border: 1px solid var(--present-border);
    border-radius: 12px;
    background: var(--present-modal-bg);
    color: var(--present-text);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.present-add-menu[hidden] { display: none; }

.present-add-menu button {
    font: inherit;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.present-add-menu button:hover {
    background: var(--present-accent-soft);
    color: var(--present-accent);
}

/* 타입별 아이템 카드 */
.present-setlist-card[data-item-type="blank"] .present-setlist-type-icon,
.present-setlist-card[data-item-type="text"] .present-setlist-type-icon,
.present-setlist-card[data-item-type="media"] .present-setlist-type-icon,
.present-setlist-card[data-item-type="order"] .present-setlist-type-icon,
.present-setlist-card[data-item-type="score"] .present-setlist-type-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    color: #fff;
}

.present-setlist-card[data-item-type="score"] .present-setlist-type-icon { background: #8c4b2f; }
.present-setlist-card[data-item-type="blank"] .present-setlist-type-icon { background: #7a7569; }
.present-setlist-card[data-item-type="text"] .present-setlist-type-icon { background: #2f5d8c; }
.present-setlist-card[data-item-type="media"] .present-setlist-type-icon { background: #2f8c55; }
.present-setlist-card[data-item-type="order"] .present-setlist-type-icon { background: #6e4aa0; }

.present-modal-hint {
    font-size: 12px;
    color: var(--present-muted);
    margin: 4px 0 0 0;
}

/* 순서 페이지 슬라이드 */
.present-body .slide.slide-order {
    padding-top: 3%;
}

.present-body .slide.slide-order .slide-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(16px * var(--present-scale, 1));
    padding: 0 5%;
    text-align: center;
    width: 100%;
}

.present-body .slide.slide-order .slide-order-title {
    font-size: calc(48px * var(--present-scale, 1));
    font-weight: 700;
    color: var(--present-text);
    letter-spacing: -0.02em;
}

.present-body .slide.slide-order .slide-order-body {
    font-size: calc(22px * var(--present-scale, 1));
    color: var(--present-text);
    line-height: 1.5;
    max-width: 80%;
}

body.present-body.dark .slide.slide-order .slide-order-title,
body.present-body.dark .slide.slide-order .slide-order-body {
    color: #fff;
}

.present-body .slide.slide-order .slide-order-list {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: calc(10px * var(--present-scale, 1));
    margin-top: calc(12px * var(--present-scale, 1));
}

.present-body .slide.slide-order .slide-order-entry {
    display: flex;
    align-items: center;
    gap: calc(14px * var(--present-scale, 1));
    padding: calc(10px * var(--present-scale, 1)) calc(16px * var(--present-scale, 1));
    border-radius: 12px;
    background: rgba(127, 127, 127, 0.08);
    text-align: left;
}

.present-body .slide.slide-order .slide-order-entry-icon {
    width: calc(32px * var(--present-scale, 1));
    height: calc(32px * var(--present-scale, 1));
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: calc(16px * var(--present-scale, 1));
    color: #fff;
    flex-shrink: 0;
    background: #7a7569;
}
.present-body .slide.slide-order .slide-order-entry[data-type="score"] .slide-order-entry-icon { background: #8c4b2f; }
.present-body .slide.slide-order .slide-order-entry[data-type="text"] .slide-order-entry-icon { background: #2f5d8c; }
.present-body .slide.slide-order .slide-order-entry[data-type="media"] .slide-order-entry-icon { background: #2f8c55; }

.present-body .slide.slide-order .slide-order-entry-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.present-body .slide.slide-order .slide-order-entry-title {
    font-size: calc(24px * var(--present-scale, 1));
    color: var(--present-text);
    font-weight: 500;
}

.present-body .slide.slide-order .slide-order-entry-subtitle {
    font-size: calc(14px * var(--present-scale, 1));
    color: var(--present-muted);
    margin-top: 2px;
}

body.present-body.dark .slide.slide-order .slide-order-entry {
    background: rgba(255, 255, 255, 0.08);
}


/* 아이템 인라인 메뉴 */
.present-item-menu {
    position: fixed;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--present-border);
    border-radius: 14px;
    background: var(--present-modal-bg);
    color: var(--present-text);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}

.present-item-menu[hidden] { display: none; }

#present-image-item-menu { z-index: 400; }

.present-image-title-label {
    margin: 14px 22px 0;
}

.present-image-list-item[draggable="true"] { cursor: grab; }
.present-image-list-item.is-dragging { opacity: 0.4; }
.present-image-list-item.drag-over { border-color: var(--present-accent); }

.present-item-menu-action {
    font: inherit;
    font-size: 13px;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--present-text);
}

.present-item-menu-action:hover {
    background: var(--present-accent-soft);
    color: var(--present-accent);
}

.present-item-menu-action.is-danger { color: #c0392b; }
.present-item-menu-action.is-danger:hover { background: rgba(192, 57, 43, 0.1); color: #a93223; }

.present-item-menu-divider {
    height: 1px;
    background: var(--present-border);
    margin: 4px 0;
}

.present-item-menu-group-title {
    font-size: 11px;
    color: var(--present-muted);
    padding: 2px 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.present-item-menu-row {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 2px 6px;
    flex-wrap: wrap;
}

.present-item-menu-row button {
    font: inherit;
    font-size: 12px;
    border: 1px solid var(--present-border);
    border-radius: 999px;
    background: var(--present-input-bg);
    padding: 5px 10px;
    cursor: pointer;
    color: var(--present-text);
}

.present-item-menu-row button:hover {
    background: var(--present-accent-soft);
    color: var(--present-accent);
    border-color: var(--present-accent);
}

.present-item-menu-row label {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--present-muted);
}

.present-item-menu-row input[type="number"] {
    width: 56px;
    font: inherit;
    font-size: 13px;
    border: 1px solid var(--present-border);
    border-radius: 8px;
    padding: 4px 6px;
    background: var(--present-input-bg);
    color: var(--present-text);
}

/* 모달 */
.present-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.present-modal[hidden] {
    display: none;
}

.present-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
}

.present-modal-panel {
    position: relative;
    width: min(920px, calc(100vw - 40px));
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    background: var(--present-modal-bg);
    color: var(--present-text);
    border-radius: 18px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.present-modal-panel-narrow {
    width: min(560px, calc(100vw - 40px));
}

.present-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--present-border);
}

.present-modal-header h2 {
    font-size: 18px;
    margin: 0;
}

.present-modal-close {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: var(--present-muted);
    border-radius: 999px;
}

.present-modal-close:hover {
    background: var(--present-accent-soft);
    color: var(--present-accent);
}

.present-modal-body {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.present-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--present-border);
    background: var(--present-panel);
}

.present-modal-action-btn {
    padding: 6px 14px;
    border: 1px solid var(--present-border);
    border-radius: 6px;
    background: var(--present-panel);
    color: var(--present-text);
    cursor: pointer;
    font-size: 13px;
}
.present-modal-action-btn:hover {
    background: var(--present-hover);
}

.present-modal-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--present-muted);
}

.present-modal-label input,
.present-modal-label textarea {
    font: inherit;
    font-size: 14px;
    color: var(--present-text);
    border: 1px solid var(--present-border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--present-input-bg);
    resize: vertical;
}

.present-modal-label textarea {
    min-height: 260px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.present-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}

.present-text-preview {
    border: 1px solid var(--present-border);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--present-panel);
    min-height: 260px;
    max-height: 420px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    color: var(--present-text);
}

.present-text-preview h1, .present-text-preview h2, .present-text-preview h3 {
    margin: 0.6em 0 0.4em;
}

.present-text-preview p { margin: 0.4em 0; }

.present-text-preview code {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 4px;
    border-radius: 4px;
}

.present-text-preview pre {
    background: rgba(0, 0, 0, 0.06);
    padding: 10px 12px;
    border-radius: 8px;
    overflow-x: auto;
}

/* ── 악보 생성 모달 메타 행 ── */

.present-score-meta-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.present-score-meta-title {
    flex: 3;
    min-width: 0;
}

.present-score-meta-small {
    flex: 1;
    min-width: 0;
}

/* ── 악보 생성 모달 프리뷰 ── */

.present-score-preview {
    border: 1px solid var(--present-border);
    border-radius: 10px;
    background: var(--present-slide-default-bg);
    min-height: 260px;
    max-height: 420px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Freesentation", sans-serif;
}

.present-score-preview .score-preview-slide {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px 24px;
    text-align: center;
    box-sizing: border-box;
}

.present-score-preview .score-preview-slide .slide-title {
    font-size: 11px;
    color: var(--present-muted);
    margin-bottom: 8px;
}

.present-score-preview .score-preview-slide .verse-badge,
.present-score-preview .score-preview-slide .chorus-badge {
    font-size: 10px;
    color: var(--present-muted);
    margin-bottom: 4px;
}

.present-score-preview .score-preview-slide .verse-badge .current,
.present-score-preview .score-preview-slide .chorus-badge .current {
    color: #FF6B35;
}

.present-score-preview .score-preview-slide .lyrics-korean {
    font-size: 15px;
    line-height: 1.7;
    font-weight: 500;
    color: var(--present-text);
}

.present-score-preview .score-preview-slide .lyrics-english {
    font-size: 10px;
    color: var(--present-muted);
    line-height: 1.5;
    margin-top: 4px;
}

.present-score-preview .score-preview-slide .hymn-number {
    font-size: 36px;
    color: var(--present-text);
    font-weight: 400;
    margin-bottom: 6px;
}

.present-score-preview .score-preview-slide .hymn-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--present-text);
}

.present-score-preview .score-preview-slide .hymn-subtitle {
    font-size: 11px;
    color: var(--present-muted);
    margin-top: 4px;
}

.present-score-preview .score-preview-slide .hymn-meta {
    font-size: 10px;
    color: var(--present-muted);
    margin-top: 8px;
}

.present-score-preview .score-preview-counter {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 11px;
    color: var(--present-muted);
    pointer-events: none;
}

.present-score-preview .score-preview-empty {
    color: var(--present-muted);
    font-size: 13px;
}

.present-image-editor {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
    align-items: start;
}

.present-image-list-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.present-image-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: var(--present-muted);
}

.present-image-add-btn {
    cursor: pointer;
}

.present-image-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 340px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--present-border);
    border-radius: 10px;
    background: var(--present-panel);
}

.present-image-list-empty {
    padding: 20px 8px;
    text-align: center;
    color: var(--present-muted);
    font-size: 13px;
}

.present-image-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.present-image-list-item:hover {
    background: rgba(127, 127, 127, 0.12);
}

.present-image-list-item.is-active {
    border-color: var(--present-accent);
    background: rgba(127, 127, 127, 0.12);
}

.present-image-list-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #ddd center/cover no-repeat;
    flex-shrink: 0;
}

.present-image-list-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--present-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.present-image-list-order {
    font-size: 11px;
    color: var(--present-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.present-image-list-hint {
    margin: 0;
    font-size: 11px;
    color: var(--present-muted);
}

.present-image-edit-panel {
    min-width: 0;
}

@media (max-width: 720px) {
    .present-image-editor {
        grid-template-columns: 1fr;
    }
    .present-image-list {
        max-height: 180px;
    }
}

.present-image-preview {
    width: 100%;
    height: 320px;
    border: 1px dashed var(--present-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--present-panel);
    margin-bottom: 14px;
    overflow: hidden;
}

.present-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.present-image-placeholder {
    color: var(--present-muted);
    font-size: 14px;
}

.present-image-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.present-fit-toggle {
    display: inline-flex;
    gap: 0;
    border: 1px solid var(--present-border);
    border-radius: 999px;
    overflow: hidden;
}

.present-fit-toggle button {
    font: inherit;
    font-size: 13px;
    border: 0;
    background: var(--present-input-bg);
    padding: 8px 14px;
    cursor: pointer;
    color: var(--present-text);
}

.present-fit-toggle button.is-active {
    background: var(--present-accent);
    color: #fff;
}

.present-btn-primary {
    font: inherit;
    border: 0;
    background: var(--present-primary-btn-bg);
    color: var(--present-primary-btn-color);
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
}

.present-btn-primary:hover { filter: brightness(1.15); }

.present-btn-ghost {
    font: inherit;
    border: 1px solid var(--present-border);
    background: var(--present-input-bg);
    color: var(--present-text);
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.present-btn-ghost:hover { background: var(--present-accent-soft); }

/* 불러오기 리스트 */
.present-load-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.present-load-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--present-border);
    border-radius: 12px;
    background: var(--present-input-bg);
}

.present-load-row-main {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.present-load-row-name {
    display: block;
    font-weight: 600;
    color: var(--present-text);
}

.present-load-row-meta {
    display: block;
    font-size: 12px;
    color: var(--present-muted);
    margin-top: 2px;
}

.present-load-row button {
    font: inherit;
    font-size: 12px;
    border: 1px solid var(--present-border);
    border-radius: 999px;
    background: var(--present-input-bg);
    padding: 4px 10px;
    cursor: pointer;
    color: var(--present-muted);
}

.present-load-row button:hover {
    color: #c0392b;
    border-color: #c0392b;
}

.present-load-empty {
    font-size: 13px;
    color: var(--present-muted);
    text-align: center;
    padding: 20px 0;
}

/* 슬라이드: 빈/텍스트/미디어 */
.present-body .slide.slide-blank {
    background: var(--present-slide-default-bg);
}

.present-body .slide.slide-text {
    padding-top: 3%;
}

.present-body .slide.slide-text .slide-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    padding: 0 8%;
    text-align: left;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.present-body .slide.slide-text .slide-text-title {
    font-size: calc(clamp(32px, 3.8vw, 54px) * var(--present-scale, 1));
    font-weight: 700;
    text-align: center;
    color: var(--present-text);
}

.present-body .slide.slide-text .slide-text-body {
    font-size: calc(clamp(20px, 2.2vw, 32px) * var(--present-scale, 1));
    line-height: 1.55;
    color: var(--present-text);
    width: 100%;
}

.present-body .slide.slide-text .slide-text-body h1 { font-size: 1.6em; margin: 0.5em 0; }
.present-body .slide.slide-text .slide-text-body h2 { font-size: 1.4em; margin: 0.5em 0; }
.present-body .slide.slide-text .slide-text-body h3 { font-size: 1.2em; margin: 0.5em 0; }
.present-body .slide.slide-text .slide-text-body p { margin: 0.5em 0; }
.present-body .slide.slide-text .slide-text-body ul,
.present-body .slide.slide-text .slide-text-body ol { padding-left: 1.4em; }
.present-body .slide.slide-text .slide-text-body blockquote {
    border-left: 4px solid var(--present-accent);
    padding-left: 14px;
    color: var(--present-muted);
    margin: 0.6em 0;
}
.present-body .slide.slide-text .slide-text-body code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.present-body .slide.slide-media {
    position: relative;
    background: var(--present-slide-default-bg);
    padding-top: 3%;
}

.present-body .slide.slide-media .slide-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-height: 0;
}

.present-body .slide.slide-media .slide-media-title {
    flex-shrink: 0;
}

.present-body .slide.slide-media img {
    display: block;
    flex: 1;
    min-height: 0;
    max-width: 100%;
}

.present-body .slide.slide-media[data-fit="contain"] img {
    width: 100%;
    object-fit: contain;
    object-position: center top;
}

.present-body .slide.slide-media[data-fit="cover"] {
    padding: 0;
}

.present-body .slide.slide-media[data-fit="cover"] img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.present-body .slide.slide-media[data-fit="none"] img {
    max-width: 100%;
    width: auto;
    object-fit: scale-down;
}

.present-body .slide.slide-media .slide-media-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 24px;
    text-align: center;
    color: var(--present-text);
    font-size: calc(18px * var(--present-scale, 1));
    text-shadow: 0 1px 6px var(--present-body-bg);
    pointer-events: none;
}

/* 배경 이미지 패널 */
.present-bg-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.present-bg-upload-btn,
.present-bg-clear-btn {
    font: inherit;
    font-size: 12px;
    border: 1px solid var(--present-border);
    border-radius: 999px;
    background: var(--present-input-bg);
    color: var(--present-text);
    padding: 5px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.present-bg-upload-btn:hover,
.present-bg-clear-btn:hover {
    background: var(--present-accent-soft);
    color: var(--present-accent);
    border-color: var(--present-accent);
}

.present-bg-preview {
    width: 100%;
    height: 100px;
    border: 1px dashed var(--present-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--present-panel);
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.present-bg-preview.has-image {
    border-style: solid;
}

.present-bg-placeholder {
    font-size: 12px;
    color: var(--present-muted);
}

/* 슬라이드 배경 이미지 */
body.present-body {
    --present-bg-image: none;
    --present-overlay: rgba(255, 255, 255, 0.7);
}

body.present-body.dark {
    --present-overlay: rgba(0, 0, 0, 0.7);
}

body.present-body.has-bg-image .slide:not(.slide-blank) {
    background-image: var(--present-bg-image) !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    position: relative;
}

/* 빈 페이지를 제외한 모든 슬라이드에 풀 슬라이드 오버레이를 깐다. */
body.present-body.has-bg-image .slide:not(.slide-blank)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--present-overlay);
    pointer-events: none;
    z-index: 0;
}

body.present-body.has-bg-image .slide:not(.slide-blank) > * {
    position: relative;
    z-index: 1;
}

body.present-body.has-bg-image .slide.slide-media {
    background-color: transparent !important;
}

body.present-body.has-bg-image .slide.slide-blank {
    background-image: var(--present-bg-image) !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: transparent !important;
}

/* 테마 토글 아이콘 */
body.present-body .present-theme-icon-dark { display: none; }
body.present-body.dark .present-theme-icon-light { display: none; }
body.present-body.dark .present-theme-icon-dark { display: inline-block; }

/* 사이드바는 다크모드에서도 라이트 톤 유지 */
body.present-body.dark .present-sidebar {
    --present-panel: rgba(255, 252, 247, 0.92);
    --present-border: rgba(44, 36, 24, 0.1);
    --present-text: #201a13;
    --present-muted: #5a534a;
    --present-accent: #8c4b2f;
    --present-accent-soft: rgba(140, 75, 47, 0.12);
    --present-input-bg: #fff;
    --present-card-bg: rgba(255, 255, 255, 0.82);
    --present-modal-bg: #fff;
    --present-primary-btn-bg: #17120d;
    --present-primary-btn-color: #fff;
    background: rgba(251, 246, 239, 0.88);
    color: var(--present-text);
}

/* 다크모드: 메인 슬라이드 배경과 텍스트 반전 */
body.present-body.dark .slide { background: #000; color: #fff; }
body.present-body.dark .slide .slide-title,
body.present-body.dark .slide .hymn-subtitle,
body.present-body.dark .slide .hymn-meta,
body.present-body.dark .slide .lyrics-english,
body.present-body.dark .slide .verse-badge,
body.present-body.dark .slide .chorus-badge { color: #bbb; }
body.present-body.dark .slide .hymn-title,
body.present-body.dark .slide .lyrics-korean { color: #fff; }
body.present-body.dark .slide .verse-badge .current,
body.present-body.dark .slide .chorus-badge .current { color: var(--present-accent); }
body.present-body.dark .present-slide-counter { background: rgba(0, 0, 0, 0.7); }

/* 자동 업데이트 진행 패널 */
#update-progress-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2000;
    min-width: 280px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--present-modal-bg, #fff);
    color: var(--present-text, #201a13);
    border: 1px solid var(--present-border, rgba(44, 36, 24, 0.1));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    font-size: 13px;
    pointer-events: none;
}

#update-progress-panel[hidden] { display: none; }

#update-progress-panel .update-progress-label {
    font-weight: 600;
    margin-bottom: 8px;
}

#update-progress-panel .update-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(127, 127, 127, 0.18);
    overflow: hidden;
}

#update-progress-panel .update-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--present-accent, #8c4b2f);
    transition: width 200ms ease;
}

#update-progress-panel.is-indeterminate .update-progress-bar-fill {
    width: 40% !important;
    animation: update-progress-indet 1200ms linear infinite;
}

@keyframes update-progress-indet {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

#update-progress-panel .update-progress-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--present-muted);
}

@media (max-width: 900px) {
    .present-shell {
        flex-direction: column;
    }

    .present-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--present-border);
        max-height: 40vh;
        transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
                    margin-top 300ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .present-shell.sidebar-collapsed .present-sidebar {
        transform: translateY(-100%);
        margin-left: 0;
        margin-top: -40vh;
    }

    .present-toggle-sidebar {
        position: fixed;
        top: calc(40vh + 8px);
        right: 12px;
        left: auto;
        margin: 0;
        z-index: 30;
        transform: rotate(90deg);
    }

    .present-shell.sidebar-collapsed .present-toggle-sidebar {
        top: 8px;
        left: auto;
        transform: rotate(-90deg);
    }
}
