.admin-body {
    background-color: var(--bg-main, #FCFBF7);
    min-height: 100vh;
    color: var(--text-main, #2B2620);
    font-family: var(--font-sans, 'Pretendard', sans-serif);
}

.admin-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* =========================================
   상단 메인 헤더
========================================= */
.admin-header-box {
    text-align: center;
    margin-bottom: 28px;
}

.header-tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 2.5px;
    color: var(--accent-brown, #B89065);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
}

.admin-main-title {
    font-family: var(--font-serif-kr, serif);
    font-size: 25px;
    font-weight: 500;
    color: var(--text-main, #2B2620);
    margin-bottom: 8px;
    line-height: 1.4;
    letter-spacing: -0.3px;
}

.admin-main-desc {
    font-size: 13.5px;
    color: var(--text-sub, #7A7269);
    line-height: 1.6;
    word-break: keep-all;
    margin: 0;
}

/* =========================================
   5단 대분류 탭 네비게이션
========================================= */
.admin-main-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    background: #EAE6DF;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.main-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 2px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sub, #7A7269);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.main-tab-btn:hover {
    color: var(--text-main, #2B2620);
}

.main-tab-btn.active {
    background: #FFFFFF;
    color: var(--text-main, #2B2620);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-tab-badge {
    background: rgba(43, 38, 32, 0.08);
    color: var(--text-sub, #7A7269);
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.main-tab-btn.active .main-tab-badge {
    background: #F0ECE6;
    color: var(--text-main, #2B2620);
}

/* 검수 대기 항목이 1개 이상 있을 때 강조색 표시 */
.main-tab-badge.has-items {
    background: var(--accent-brown, #B89065) !important;
    color: #FFFFFF !important;
}

/* =========================================
   패널 전환 (선택된 탭만 노출)
========================================= */
.admin-tab-panel {
    display: none;
    animation: fadeIn 0.25s ease forwards;
}

.admin-tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-desc-box {
    text-align: center;
    margin-bottom: 20px;
}

.panel-sub-desc {
    font-size: 13px;
    color: var(--text-sub, #7A7269);
    line-height: 1.5;
    margin: 0;
    word-break: keep-all;
}

/* =========================================
   1. 검수 탭: 상태 서브 필터 & 카드 목록
========================================= */
.filter-tabs {
    display: flex;
    gap: 8px;
    background: #F2EFE9;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.filter-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-sub, #7A7269);
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.filter-tab.active {
    background: #FFFFFF;
    color: var(--text-main, #2B2620);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.badge {
    background: rgba(0, 0, 0, 0.06);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
}

.filter-tab.active .badge {
    background: var(--accent-brown, #B89065);
    color: #FFFFFF;
}

.memory-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.archive-card {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(43, 38, 32, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.card-top-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #F0EEE9;
    padding-bottom: 10px;
    gap: 12px;
}

.sender-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sender-name {
    font-size: 14.5px;
    font-weight: 600;
}

.sender-relation {
    font-size: 11.5px;
    background: #F4EFEA;
    color: var(--accent-brown, #B89065);
    padding: 2px 7px;
    border-radius: 8px;
}

.submit-date {
    font-size: 11.5px;
    color: #A0988F;
    margin-left: 2px;
}

.media-preview-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.media-thumbnail {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #EAE7E1;
    cursor: pointer;
    user-select: none;
}

.media-thumbnail img,
.media-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.25s ease, opacity 0.25s ease;
}

.media-thumbnail.excluded img,
.media-thumbnail.excluded video {
    filter: grayscale(100%);
    opacity: 0.35;
}

.btn-toggle-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.btn-toggle-check.checked {
    background: #A0703B;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-toggle-check.checked svg {
    display: block;
    width: 13px;
    height: 13px;
    stroke: #FFFFFF;
    stroke-width: 2.2;
}

.btn-toggle-check.unchecked {
    background: rgba(43, 38, 32, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(2px);
}

.btn-toggle-check.unchecked svg {
    display: none;
}

.card-story-text {
    font-family: var(--font-serif-kr, serif);
    font-size: 13.5px;
    line-height: 1.6;
    color: #4A443E;
    background: #FAF9F7;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-break: keep-all;
}

.card-action-bar {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 8px;
}

.btn-status {
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-toggle-all {
    background: #F0ECE6;
    color: #554D43;
}

.btn-toggle-all:hover {
    background: #E5E0D8;
}

.btn-approve-submit {
    background: var(--text-main, #2B2620);
    color: #FFFFFF;
}

.btn-approve-submit:hover {
    background: var(--accent-brown, #B89065);
}

.btn-approve-submit.mode-reject {
    background: #6E6861;
    color: #FFFFFF;
}

.btn-approve-submit.mode-reject:hover {
    background: #57514B;
}

.btn-revert-mini {
    background: transparent;
    border: 1px solid rgba(43, 38, 32, 0.18);
    color: var(--text-sub, #7A7269);
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-revert-mini:hover {
    background: #FFFFFF;
    color: var(--text-main, #2B2620);
    border-color: var(--accent-brown, #B89065);
}

/* =========================================
   2. 관리자 업로드 탭
========================================= */
.direct-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.direct-media-card {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.direct-media-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: #EAE7E1;
    overflow: hidden;
    position: relative;
}

.direct-media-thumb img,
.direct-media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.direct-media-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.direct-media-tag {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--accent-brown, #B89065);
}

.direct-media-desc {
    font-size: 11.5px;
    color: var(--text-sub, #7A7269);
    line-height: 1.4;
    word-break: keep-all;
    margin: 0;
}

.btn-direct-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(43, 38, 32, 0.7);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-direct-delete:hover {
    background: #D9534F;
}

/* =========================================
   3. 발자취 타임라인 탭
========================================= */
.timeline-form {
    background: #FFFFFF;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(43, 38, 32, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    margin-bottom: 16px;
}

.timeline-input-row {
    display: flex;
    gap: 8px;
}

.timeline-input {
    border: 1px solid rgba(43, 38, 32, 0.12);
    background: #FCFAF7;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.timeline-input:focus {
    border-color: var(--accent-brown, #B89065);
}

.timeline-input.date-picker-input {
    width: 155px;
    flex-shrink: 0;
    cursor: pointer;
    color: var(--text-main, #2B2620);
}

.timeline-input.text-input {
    flex: 1;
}

.btn-timeline-add {
    background: var(--text-main, #2B2620);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-timeline-add:hover {
    background: var(--accent-brown, #B89065);
}

.admin-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-timeline-item {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-tl-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-tl-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-brown, #B89065);
}

.admin-tl-text {
    font-size: 13.5px;
    color: var(--text-main, #2B2620);
}

.admin-tl-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-tl-edit,
.btn-tl-delete {
    background: transparent;
    border: 1px solid rgba(43, 38, 32, 0.15);
    border-radius: 5px;
    font-size: 11.5px;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tl-edit {
    color: var(--text-sub, #7A7269);
}

.btn-tl-edit:hover {
    color: var(--accent-brown, #B89065);
    border-color: var(--accent-brown, #B89065);
    background: #FFFDF9;
}

.btn-tl-delete {
    color: #A0988F;
}

.btn-tl-delete:hover {
    color: #D9534F;
    border-color: #D9534F;
    background: #FFF5F5;
}

/* 인라인 수정 폼 */
.edit-mode-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.edit-input-date {
    width: 140px;
    flex-shrink: 0;
    padding: 6px 8px;
    font-size: 12.5px;
    border: 1px solid rgba(43, 38, 32, 0.15);
    border-radius: 6px;
    background: #FFFFFF;
    outline: none;
    font-family: inherit;
}

.edit-input-story {
    flex: 1;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid rgba(43, 38, 32, 0.15);
    border-radius: 6px;
    background: #FFFFFF;
    outline: none;
    font-family: inherit;
}

.edit-action-row {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-edit-save {
    background: var(--text-main, #2B2620);
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
    cursor: pointer;
}

.btn-edit-cancel {
    background: transparent;
    border: 1px solid rgba(43, 38, 32, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
    color: #A0988F;
    cursor: pointer;
}

/* =========================================
   4. 무지개 우체통 탭
========================================= */
.postbox-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.postbox-total-text {
    font-size: 13px;
    color: var(--text-sub, #7A7269);
}

.postbox-total-text strong {
    color: var(--accent-brown, #B89065);
}

.postbox-admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-postbox-card {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.postbox-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.postbox-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.postbox-author-tag {
    font-size: 11px;
    background: #F4EFEA;
    color: var(--accent-brown, #B89065);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 500;
}

.postbox-author-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main, #2B2620);
}

.postbox-date {
    font-size: 11.5px;
    color: #A0988F;
}

.btn-postbox-delete {
    background: transparent;
    border: 1px solid rgba(43, 38, 32, 0.15);
    color: #A0988F;
    font-size: 11.5px;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-postbox-delete:hover {
    color: #D9534F;
    border-color: #D9534F;
    background: #FFF5F5;
}

.postbox-msg-content {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-main, #2B2620);
    white-space: pre-wrap;
    word-break: keep-all;
    margin: 0;
}

/* =========================================
   공통 공통 요소 (비어있음 / 푸터 / 토스트)
========================================= */
.empty-state {
    text-align: center;
    padding: 50px 0;
    color: var(--text-sub, #7A7269);
    font-size: 13.5px;
}

.admin-footer-links {
    text-align: center;
    margin-top: 40px;
}

.link-btn {
    font-size: 13px;
    color: var(--text-sub, #7A7269);
    text-decoration: underline;
}

.toast-popup {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(43, 38, 32, 0.9);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 13.5px;
    letter-spacing: -0.2px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.toast-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 업로드 드롭존 및 프리뷰 */
.direct-upload-box {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.upload-dropzone {
    border: 1.5px dashed rgba(212, 163, 115, 0.5);
    border-radius: 10px;
    background: #FCFAF7;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-dropzone:hover {
    background: #F7F2EA;
    border-color: var(--accent-brown, #B89065);
}

.dropzone-icon {
    font-size: 26px;
    margin-bottom: 6px;
}

.dropzone-text {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main, #2B2620);
}

.dropzone-sub {
    font-size: 11.5px;
    color: var(--text-sub, #7A7269);
    margin-top: 3px;
}

/* 선택 파일 썸네일 스트립 */
.selected-preview-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0 4px;
    margin-top: 8px;
}

.preview-thumb-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(43, 38, 32, 0.12);
}

.preview-thumb-wrap img,
.preview-thumb-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-preview {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.65);
    color: #FFF;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.direct-input-bar {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

/* 전시 카드 내부 인라인 수정 폼 */
.direct-edit-box {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.direct-edit-input {
    flex: 1;
    font-size: 11.5px;
    padding: 4px 6px;
    border: 1px solid var(--accent-brown, #B89065);
    border-radius: 4px;
    outline: none;
    font-family: inherit;
}

.btn-story-action {
    background: transparent;
    border: none;
    color: #A0988F;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    text-decoration: underline;
    align-self: flex-start;
}

.btn-story-action:hover {
    color: var(--accent-brown, #B89065);
}

/* 좁은 화면에서는 탭 글자를 살짝 줄여 다섯 칸이 들어가게 */
@media (max-width: 480px) {
    .main-tab-btn {
        font-size: 11px;
        padding: 9px 1px;
    }
}


/* =========================================
   5. 추모관 정보 수정 탭
========================================= */
.info-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-card {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    position: relative;
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main, #2B2620);
}

/* 기존 .timeline-input 스타일을 이어받고 폭만 보정 */
.info-input {
    width: 100%;
    box-sizing: border-box;
    color: var(--text-main, #2B2620);
}

.info-textarea {
    height: 76px;
    resize: vertical;
    line-height: 1.55;
    font-family: var(--font-serif-kr, serif);
}

.info-hint {
    font-size: 11.5px;
    color: var(--text-sub, #7A7269);
    margin: 0;
    line-height: 1.5;
    word-break: keep-all;
}

.info-count {
    align-self: flex-end;
    font-size: 11px;
    color: #A0988F;
}

/* 대표 사진 + 이름 */
.info-profile-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.info-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: #F3EDE2;
    border: 3px solid #FFFFFF;
    box-shadow: 0 0 0 1px rgba(212, 163, 115, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-avatar-empty {
    font-size: 11px;
    color: #A0988F;
}

.info-profile-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.info-photo-btn {
    align-self: flex-start;
    background: transparent;
    border: none;
    padding: 2px 0;
    font-size: 12px;
    color: var(--accent-brown, #B89065);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-family: inherit;
}

.info-photo-btn:hover {
    color: var(--text-main, #2B2620);
}

/* 아이 종류 선택 (index.html 빌더와 같은 3분할 구성) */
.info-type-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.info-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px;
    background: #FCFAF7;
    border: 1px solid rgba(43, 38, 32, 0.12);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-sub, #7A7269);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.info-type-btn iconify-icon {
    font-size: 18px;
}

.info-type-btn:hover {
    border-color: var(--accent-brown, #B89065);
}

.info-type-btn.active {
    background: #FAF3E8;
    border-color: var(--accent-brown, #B89065);
    color: var(--text-main, #2B2620);
    font-weight: 600;
}

/* 날짜 / 선물 2단 배치 */
.info-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.info-days {
    margin: -6px 0 0;
    font-family: var(--font-serif-kr, serif);
    font-size: 13px;
    color: var(--accent-brown, #B89065);
    text-align: center;
}

.info-days:empty {
    display: none;
}

/* 헤리티지 명판 안내 */
.info-heritage-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #FAF5EE;
    border: 1px solid rgba(212, 163, 115, 0.3);
    border-radius: 10px;
    padding: 12px 14px;
}

.info-heritage-notice[hidden] {
    display: none;
}

.info-heritage-notice p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-sub, #7A7269);
    word-break: keep-all;
}

.info-heritage-notice strong {
    color: var(--text-main, #2B2620);
    font-weight: 600;
}

.info-notice-icon {
    font-size: 15px;
    line-height: 1.4;
    flex-shrink: 0;
}

/* 하단 고정 저장 바 */
.info-save-bar {
    position: sticky;
    bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 12px;
    padding: 10px 10px 10px 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    margin-top: 4px;
}

.info-save-status {
    font-size: 12.5px;
    color: var(--text-sub, #7A7269);
}

.info-save-status.is-dirty {
    color: var(--accent-brown, #B89065);
    font-weight: 600;
}

.info-save-btn {
    padding: 11px 18px;
}

.info-save-btn:disabled {
    background: #D9D3CA;
    cursor: default;
}

/* 키보드 이동 시 포커스 표시 */
.info-type-btn:focus-visible,
.info-photo-btn:focus-visible,
.info-save-btn:focus-visible {
    outline: 2px solid var(--accent-brown, #B89065);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .info-profile-row {
        gap: 14px;
    }

    .info-avatar {
        width: 76px;
        height: 76px;
    }

    .info-type-btn {
        font-size: 12px;
        gap: 4px;
    }
}

/* =========================================
   관리자 확인 중 / 잠김 화면
========================================= */
.admin-container.is-verifying {
    visibility: hidden;
}

.admin-locked {
    text-align: center;
    padding: 120px 20px;
}

.admin-locked .admin-main-desc {
    line-height: 1.7;
    word-break: keep-all;
}

.admin-locked-btn {
    display: inline-block;
    margin-top: 28px;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.link-btn-muted {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-sub, #7A7269);
    opacity: 0.8;
    display: block;
    margin: 28px auto 0;
    font-size: 12px;
}

/* =========================================
   메인 탭: 아이콘 위 + 짧은 이름 아래 (모바일에서도 잘리지 않게)
========================================= */
.main-tab-btn {
    position: relative;
    flex-direction: column;
    gap: 4px;
    padding: 10px 2px 8px;
    white-space: normal;
}

.main-tab-btn .tab-icon {
    font-size: 19px;
    line-height: 1;
}

.main-tab-btn .tab-label {
    font-size: 11.5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.main-tab-btn .main-tab-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 16px;
    text-align: center;
    padding: 1px 4px;
    font-size: 9.5px;
}

@media (max-width: 480px) {
    .main-tab-btn {
        padding: 9px 1px 7px;
    }

    .main-tab-btn .tab-label {
        font-size: 10.5px;
        letter-spacing: -0.3px;
    }

    .main-tab-btn .main-tab-badge {
        right: 3px;
    }
}

/* =========================================
   디자인 통일 (메인 페이지 기준)
========================================= */
.header-tag {
    font-family: var(--font-serif-en);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2.5px;
}

.admin-main-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.admin-main-desc {
    line-height: 1.6;
}

/* 바로 업로드 입력줄: 좁은 화면에서 버튼이 밀려나지 않게 */
.direct-input-bar .text-input {
    flex: 1;
    min-width: 0;
}

.direct-input-bar .btn-timeline-add {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 추모 기록집 버튼 */
.btn-book-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 9px 16px;
    border: 1px solid var(--accent-brown, #D4A373);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, #2B2620);
    text-decoration: none;
    background: #FFFFFF;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-book-link:hover {
    background: var(--accent-brown, #D4A373);
    color: #FFFFFF;
}

/* 바로 업로드: 올리는 분 이름 */
.direct-sender-input {
    width: 100%;
    margin-top: 14px;
    box-sizing: border-box;
}

.dropzone-sub+.dropzone-sub {
    margin-top: 2px;
}

/* 갤러리 카드 수정: 입력칸은 위아래로, 버튼은 아래 줄에 (잘리지 않게) */
.direct-edit-box {
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.direct-edit-box .direct-edit-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 12.5px;
    padding: 7px 8px;
}

.direct-edit-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.direct-edit-actions .btn-edit-save {
    padding: 6px 14px;
    font-size: 12px;
}

.story-display-box:has(.direct-edit-box) {
    display: block;
}

/* 수정 버튼이 세로로 꺾이지 않게 */
.direct-edit-actions .btn-edit-save,
.direct-edit-actions .btn-story-action {
    white-space: nowrap;
    flex-shrink: 0;
}

/* 휴대폰에서는 갤러리 카드를 두 줄로 넓게 */
@media (max-width: 480px) {
    .direct-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* 수정 중 입력칸 왼쪽 이름표 (이름 / 이야기 구분) */
.direct-edit-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.direct-edit-label {
    flex-shrink: 0;
    width: 34px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-sub, #7A7269);
}

.direct-edit-row .direct-edit-input {
    flex: 1;
}

/* =========================================
   처리 중 표시 (밝은 버튼용 진한 빙글빙글)
========================================= */
.btn-spinner.is-dark {
    border-color: rgba(43, 38, 32, 0.2);
    border-top-color: #2B2620;
}

button:disabled .btn-spinner {
    margin-right: 6px;
}

/* =========================================
   발자취: 휴대폰에서 버튼 때문에 늘어지지 않게
   - 첫 줄: 날짜 + 등록 버튼 / 둘째 줄: 이야기
========================================= */
.btn-timeline-add {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .timeline-input-row {
        flex-wrap: wrap;
    }

    .timeline-input-row .date-picker-input {
        flex: 1 1 0;
        min-width: 0;
    }

    .timeline-input-row .text-input {
        order: 3;
        flex: 1 1 100%;
    }

    .edit-mode-form {
        flex-wrap: wrap;
    }

    .edit-mode-form .edit-input-date {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    .edit-mode-form .edit-input-story {
        order: 3;
        flex: 1 1 100%;
    }

    .edit-action-row .btn-edit-save,
    .edit-action-row .btn-edit-cancel {
        white-space: nowrap;
    }
}

/* =========================================
   백업 버튼 (기록집 PDF, 원본 내려받기)
========================================= */
.admin-backup-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.admin-backup-links .btn-book-link {
    margin-top: 0;
    font-family: inherit;
    cursor: pointer;
}

/* =========================================
   원본 내려받기 창
========================================= */
.download-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(18, 16, 14, 0.45);
    padding: 12px;
}

.download-modal-backdrop.active {
    display: flex;
}

.download-modal {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    max-height: 85dvh;
    background: #FFFFFF;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.download-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(43, 38, 32, 0.08);
}

.download-title {
    font-family: var(--font-serif-kr);
    font-size: 17px;
    font-weight: 600;
}

.btn-download-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-sub, #7A7269);
    cursor: pointer;
    display: flex;
}

.download-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.download-loading,
.download-empty {
    text-align: center;
    padding: 30px 0;
    font-size: 13.5px;
    color: var(--text-sub, #7A7269);
}

.download-summary {
    font-size: 13px;
    color: var(--text-sub, #7A7269);
    text-align: center;
    margin-bottom: 12px;
}

.download-summary .nb:first-child {
    font-weight: 700;
    color: var(--text-main, #2B2620);
}

.btn-download-all {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--text-main, #2B2620);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-download-all:disabled {
    opacity: 0.85;
    cursor: default;
}

.download-tip {
    margin: 10px 0 14px;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-muted, #A39B8F);
    text-align: center;
}

.download-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px solid rgba(43, 38, 32, 0.08);
    border-radius: 10px;
}

.download-item.done {
    background: #FAF7F2;
}

.download-thumb {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    background: #F3EDE2;
}

.download-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.download-video-label {
    position: absolute;
    right: 3px;
    bottom: 3px;
    background: rgba(0, 0, 0, 0.6);
    color: #FFFFFF;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
}

.download-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.download-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, #2B2620);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-meta {
    font-size: 11.5px;
    color: var(--text-muted, #A39B8F);
}

.btn-download-one {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 7px 12px;
    border: 1px solid var(--accent-brown, #D4A373);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main, #2B2620);
    text-decoration: none;
}

.download-item.done .btn-download-one {
    border-color: rgba(43, 38, 32, 0.12);
    color: var(--text-muted, #A39B8F);
}

@media (min-width: 600px) {
    .download-modal-backdrop {
        align-items: center;
    }
}

/* =========================================
   수정 화면 버튼: 저장·취소를 같은 크기로
========================================= */
.btn-edit-save,
.btn-edit-cancel {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 6px;
    white-space: nowrap;
    font-family: inherit;
}

.btn-edit-save {
    border: 1px solid var(--text-main, #2B2620);
}

.btn-edit-cancel {
    background: #FFFFFF;
    border: 1px solid rgba(43, 38, 32, 0.2);
    color: var(--text-sub, #7A7269);
}

.btn-edit-cancel:hover {
    background: #F3EDE2;
}

/* =========================================
   관리자 달력: 빌더 달력과 같은 모양
========================================= */
.admin-datepicker-wrap input {
    width: 100%;
    padding-right: 34px;
    cursor: pointer;
    box-sizing: border-box;
}

.admin-datepicker-wrap .datepicker-icon {
    top: 50%;
}

/* 좁은 칸에 들어가도 달력은 넉넉한 크기로 */
.admin-datepicker-wrap .flatpickr-calendar {
    width: 300px;
    max-width: calc(100vw - 32px);
    z-index: 60;
}

.timeline-input-row .admin-datepicker-wrap {
    flex: 0 0 170px;
    width: auto;
}

.edit-mode-form .admin-datepicker-wrap {
    flex: 0 0 150px;
    width: auto;
}

@media (max-width: 480px) {

    .timeline-input-row .admin-datepicker-wrap,
    .edit-mode-form .admin-datepicker-wrap {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* 달력 도구가 날짜 칸을 한 번 더 감싸는 상자(flatpickr-wrapper)도 칸 전체 너비로
   → 날짜 칸이 상자를 꽉 채우고, 달력 아이콘이 칸 안쪽 오른쪽에 오도록 */
.admin-datepicker-wrap .flatpickr-wrapper {
    display: block;
    width: 100%;
}

.admin-datepicker-wrap input:not([type="hidden"]) {
    display: block;
    width: 100% !important;
    min-width: 0;
    max-width: none;
}

.btn-download-all.is-running {
    background: #FFFFFF;
    color: var(--text-main, #2B2620);
    border: 1px solid var(--text-main, #2B2620);
}