/* ============================================================
   COMPONENTS — share dropdown, mobile hamburger, bottom sheet,
                toast, image modal
   ============================================================ */

/* ===== SHARE DROPDOWN ===== */
.share-wrap {
    position: relative;
}
.share-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    z-index: 300;
}
.share-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.share-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s ease;
}
.share-item:hover { background: var(--hover); }
.share-item i {
    width: 20px;
    font-size: 17px;
    text-align: center;
    flex-shrink: 0;
}
.share-item[data-channel="facebook"] i { color: #1877f2; }
.share-item[data-channel="twitter"] i  { color: var(--text); }
.share-item[data-channel="line"] i     { color: #06c755; }
.share-item[data-channel="copy"] i     { color: var(--text-muted); }

.share-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.share-icon-kakao {
    background: #fee500;
    color: #3c1e1e;
}

.share-divider {
    height: 1px;
    background: var(--border);
    margin: 5px 4px;
}

/* ===== MOBILE HAMBURGER FAB ===== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--text);
    color: var(--bg);
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    z-index: 900;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.mobile-menu-btn:hover { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35); }
.mobile-menu-btn:active { transform: translateX(-50%) scale(0.94); }
.bottom-sheet.active ~ .mobile-menu-btn,
.mobile-menu-btn.hidden { opacity: 0; pointer-events: none; }

/* ===== BOTTOM SHEET ===== */
.bottom-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1300;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.bottom-sheet.active { visibility: visible; opacity: 1; }

.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sheet-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
    border-top: 1px solid var(--border);
}
.bottom-sheet.active .sheet-panel { transform: translateY(0); }

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 6px auto 18px;
    cursor: pointer;
}

.sheet-section { margin-bottom: 22px; }
.sheet-section:last-child { margin-bottom: 4px; }

.sheet-label {
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-left: 2px;
}

.sheet-buttons {
    display: grid;
    gap: 8px;
}
.sheet-cats { grid-template-columns: repeat(3, 1fr); }
.sheet-cols { grid-template-columns: repeat(4, 1fr); }

.sheet-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    min-height: 64px;
}
.sheet-btn:hover { background: var(--hover); }
.sheet-btn.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}
.sheet-btn i,
.sheet-btn svg {
    font-size: 16px;
    display: block;
}

.sheet-theme {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.18s ease;
}
.sheet-theme:hover { background: var(--hover); }
.sheet-theme i { font-size: 15px; }

/* theme label swap */
.label-toggle-to-light { display: inline; }
.label-toggle-to-dark  { display: none; }
[data-theme="light"] .label-toggle-to-light { display: none; }
[data-theme="light"] .label-toggle-to-dark  { display: inline; }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: var(--bg);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 9px;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast i { font-size: 14px; }


/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal.active { opacity: 1; visibility: visible; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: zoom-out;
}

.modal-img-wrap {
    position: relative;
    max-width: 85vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transform: scale(0.96);
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.modal.active .modal-img-wrap { transform: scale(1); }

.modal-img {
    max-width: 100%;
    max-height: 85vh;
    display: block;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transition: opacity 0.25s ease;
}

.modal-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2;
}
.modal-btn:hover { background: rgba(255, 255, 255, 0.2); }
.modal-close { top: 24px; right: 24px; }
.modal-close:hover { transform: scale(1.05); }
.modal-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.modal-next { right: 24px; top: 50%; transform: translateY(-50%); }
.modal-prev:hover { transform: translateY(-50%) scale(1.05); }
.modal-next:hover { transform: translateY(-50%) scale(1.05); }

.modal-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    letter-spacing: 0.15em;
    z-index: 2;
    background: rgba(0, 0, 0, 0.45);
    padding: 7px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-loader {
    position: absolute;
    color: rgba(255,255,255,0.5);
    font-size: 22px;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ═══════════════════════════════════════════════
   Page Templates: write / mypage (in-layout)
   - .header(layout.css) 와 동일 컨테이너 룰: max-width 1492px, 좌우 40px gutter
   - 색상은 base.css 토큰만 사용
   ═══════════════════════════════════════════════ */
.sp-page {
    max-width: 1492px;
    margin: 0 auto;
    padding: 32px 40px 96px;
}
.sp-page-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 36px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.sp-page-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color .15s ease;
}
.sp-page-back:hover { color: var(--text); }
.sp-page-back i { font-size: 12px; }
.sp-page-title {

    font-size: clamp(28px, 3.4vw, 44px);
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0;
    flex: 1;
}

/* ─────────────────────────────
   Write form — 2-column at ≥1100px
   Title is full width on top; below: editor (left) + side card (right)
   ───────────────────────────── */
.sp-write-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    grid-template-areas:
        'title   title'
        'content side'
        'thumbs  thumbs'
        'meta    meta'
        'actions actions';
    gap: 28px 40px;
    align-items: start;
}
.sp-write-form > .sp-write-title   { grid-area: title; }
.sp-write-form > .sp-write-content { grid-area: content; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.sp-write-form > .sp-write-side    { grid-area: side;    display: flex; flex-direction: column; gap: 24px; }
.sp-write-form > .sp-write-thumbs  { grid-area: thumbs; min-width: 0; }
.sp-write-form > .sp-write-meta    { grid-area: meta;   display: flex; flex-direction: column; gap: 24px; }
.sp-write-form > .sp-write-actions { grid-area: actions; }
@media (max-width: 1100px) {
    .sp-write-form {
        grid-template-columns: 1fr;
        grid-template-areas:
            'title'
            'content'
            'thumbs'
            'meta'
            'side'
            'actions';
        gap: 24px;
    }
}

/* Full-width thumbnail grid (multi-image management) */
.sp-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.sp-thumb-card {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--hover);
    border: 1px solid var(--border);
}
.sp-thumb-card.is-cover { outline: 2px solid var(--text); outline-offset: -2px; }
.sp-thumb-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-thumb-card .sp-thumb-cover-badge {
    position: absolute;
    top: 6px; left: 6px;
    background: var(--text);
    color: var(--bg);
    font-size: 9.5px;
    letter-spacing: 0.12em;
    padding: 3px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}
.sp-thumb-card .sp-thumb-card-remove {
    position: absolute;
    top: 6px; right: 6px;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background .15s ease;
}
.sp-thumb-card .sp-thumb-card-remove:hover { background: rgba(0, 0, 0, 0.85); }
.sp-thumb-card.is-removed { opacity: .35; }
.sp-thumb-card.is-removed::after {
    content: '제거됨';
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 11px;
    letter-spacing: 0.1em;
}

/* Field labels */
.sp-write-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 500;
    display: block;
    margin: 4px 0 10px;
}

/* Title (헤어라인 스타일) */
.sp-write-title {
    width: 100%;
    box-sizing: border-box;

    font-size: clamp(30px, 4.2vw, 56px);
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.15;
    padding: 18px 4px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    transition: border-color .15s ease;
}
.sp-write-title:focus { outline: none; border-bottom-color: var(--text); }
.sp-write-title::placeholder { color: var(--text-dim); font-style: italic; }

/* Generic inputs / textarea / select */
.sp-write-form input[type="text"]:not(.sp-write-title),
.sp-write-form input[type="email"],
.sp-write-form input[type="url"],
.sp-write-form input[type="tel"],
.sp-write-form input[type="number"],
.sp-write-form select,
.sp-write-form textarea,
.sp-write-tags {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sp-write-form input:focus,
.sp-write-form select:focus,
.sp-write-form textarea:focus,
.sp-write-tags:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px var(--hover);
}
.sp-write-hint {
    display: block;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.5;
}

/* Category chips */
.sp-write-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    color: var(--text);
    background: transparent;
    user-select: none;
    transition: all .15s ease;
}
.sp-cat-chip:hover { border-color: var(--text-muted); }
.sp-cat-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Editor wrap (wp_editor / TinyMCE) */
.sp-write-editor-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg);
}
.sp-write-editor-wrap textarea.wp-editor-area {
    padding: 16px;
    background: var(--bg);
    color: var(--text);
    border: 0;
    min-height: 360px;
    line-height: 1.7;
}

/* Thumbnail dropzone */
.sp-thumb-zone {
    position: relative;
    min-height: 200px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    padding: 28px 20px;
    text-align: center;
    background: var(--hover);
    transition: border-color .15s ease, background .15s ease;
}
.sp-thumb-zone:hover { border-color: var(--text-muted); background: transparent; }
.sp-thumb-zone > i { font-size: 26px; color: var(--text-dim); }
.sp-thumb-zone > span { font-size: 13px; color: var(--text); letter-spacing: 0.02em; }
.sp-thumb-zone > small {
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.sp-thumb-preview {
    display: block;
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 6px;
}
.sp-thumb-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.sp-thumb-remove:hover { background: rgba(0, 0, 0, .85); }

/* 다중 이미지 미리보기 리스트 (글쓰기) */
.sp-thumb-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 6px;
    margin-top: 10px;
}
.sp-thumb-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: var(--hover);
}
.sp-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sp-thumb-item.is-cover { outline: 2px solid var(--text); outline-offset: -2px; }
.sp-thumb-cover-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    background: var(--text);
    color: var(--bg);
    font-size: 9px;
    letter-spacing: .12em;
    border-radius: 999px;
    text-transform: uppercase;
}

/* Single 갤러리 hero / Swiper */
.sp-single-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: -10px 0 22px;
    color: var(--text-muted);
    font-size: 13px;
}
.sp-single-meta a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.sp-single-meta a:hover { border-bottom-color: var(--text); }
.sp-single-hero {
    margin: 0 0 28px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--hover);
}
.sp-single-hero img,
.sp-swiper .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 78vh;
    object-fit: contain;
    background: #000;
}
.sp-swiper {
    position: relative;
    margin: 0 0 28px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.sp-swiper .swiper-button-prev,
.sp-swiper .swiper-button-next {
    color: #fff;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,.4);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.sp-swiper .swiper-button-prev:after,
.sp-swiper .swiper-button-next:after { font-size: 14px; font-weight: 700; }
.sp-swiper .swiper-pagination-bullet { background: #fff; opacity: .5; }
.sp-swiper .swiper-pagination-bullet-active { opacity: 1; }

.sp-single-content {
    margin: 0 0 36px;
    line-height: 1.8;
    font-size: 16px;
}
.sp-single-content p { margin: 0 0 1em; }
.sp-single-content img { max-width: 100%; height: auto; border-radius: 8px; }
.sp-single-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.sp-single-nav { display: flex; gap: 14px; }
.sp-single-nav a { color: var(--text-muted); font-size: 13px; text-decoration: none; }
.sp-single-nav a:hover { color: var(--text); }

/* 404 */
.sp-404 { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.sp-404-inner { text-align: center; max-width: 420px; }
.sp-404-eyebrow {

    font-size: 110px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-dim);
    margin: 0 0 8px;
}
.sp-404 h1 { font-size: 28px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 12px; }
.sp-404 p { color: var(--text-muted); margin: 0 0 24px; }

/* Options (checkbox row) */
.sp-write-options { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.sp-write-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}
.sp-write-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--text);
}

/* Actions bar */
.sp-write-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.sp-write-actions .btn-primary { padding: 12px 28px; font-size: 14px; letter-spacing: 0.04em; }
.sp-write-msg { margin: 0; font-size: 13px; color: var(--text-muted); }
.sp-write-msg.is-error   { color: #d0463b; }
.sp-write-msg.is-success { color: #2c9b6a; }

/* ─────────────────────────────
   Profile edit (in-layout)
   ───────────────────────────── */
.sp-profile-edit {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
    padding: 28px 32px;
    margin-bottom: 36px;
}
.sp-profile-edit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
}
.sp-profile-edit-head h3 {
    margin: 0;

    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.sp-profile-close {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background .15s ease, color .15s ease;
}
.sp-profile-close:hover { background: var(--hover); color: var(--text); }

.sp-profile-form { display: flex; flex-direction: column; gap: 24px; }
.sp-profile-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 760px) {
    .sp-profile-grid { grid-template-columns: 1fr; gap: 20px; }
}
.sp-profile-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 760px) {
    .sp-profile-fields { grid-template-columns: 1fr; }
}

.sp-profile-form input[type="text"],
.sp-profile-form input[type="email"],
.sp-profile-form input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sp-profile-form input:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px var(--hover);
}

/* Avatar dropzone (정사각형) */
.sp-avatar-zone {
    width: 200px;
    height: 200px;
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--hover);
}
.sp-avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* Actions (저장 / 메시지 / 탈퇴) */
.sp-profile-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.sp-profile-actions .sp-btn-danger {
    margin-left: auto;
    color: #d0463b;
    border-color: rgba(208, 70, 59, .35);
}
.sp-profile-actions .sp-btn-danger:hover {
    background: rgba(208, 70, 59, .08);
    border-color: #d0463b;
}

/* ─────────────────────────────
   My Page
   ───────────────────────────── */
.sp-mypage-card {
    display: flex;
    gap: 22px;
    align-items: center;
    padding: 24px 28px;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 36px;
    flex-wrap: wrap;
    background: var(--bg);
}
.sp-mypage-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}
.sp-mypage-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 200px;
}
.sp-mypage-meta strong { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.sp-mypage-meta span { color: var(--text-muted); font-size: 13px; }
.sp-mypage-roles {
    font-size: 11px !important;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim) !important;
}
.sp-mypage-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-mypage-section-title {

    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 8px 0 18px;
}
.sp-mypage-empty {
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 14px;
}
.sp-mypage-empty p { margin: 0 0 18px; }

/* Gallery empty state */
.gallery-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 96px 24px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: var(--hover);
    text-align: center;
}
.gallery-empty::before {
    content: "";
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2'/><circle cx='9' cy='11' r='1.6'/><path d='M3 16l5-5 4 4 3-3 6 6'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px 32px;
}
.gallery-empty p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 0.02em;
}
.gallery-empty p:first-of-type {
    color: var(--text);
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 500;
    letter-spacing: -0.01em;
}
.gallery-empty a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 1px solid var(--text);
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.04em;
    transition: opacity .15s ease, transform .12s ease;
}
.gallery-empty a:hover {
    opacity: .88;
    transform: translateY(-1px);
}

/* Load more button + sentinel */
.gallery-loadmore-wrap {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 36px;
    padding-bottom: 12px;
}
.btn-loadmore {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: border-color .15s ease, background .15s ease;
}
.btn-loadmore:hover { border-color: var(--text); background: var(--hover); }
.btn-loadmore i { animation: none; }
.btn-loadmore.is-loading { pointer-events: none; opacity: .7; }
.btn-loadmore.is-loading i { animation: sp-spin 1s linear infinite; }
.gallery-sentinel { height: 1px; }
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* Tile hover controls (수정/삭제) — render_tile() 출력 */
.tile { position: relative; }
.tile-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease;
    z-index: 3;
    pointer-events: none;
}
.tile:hover .tile-controls,
.tile:focus-within .tile-controls {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.tile-ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background .15s ease, transform .12s ease;
}
.tile-ctrl:hover { background: rgba(0, 0, 0, .9); transform: scale(1.06); }
.tile-ctrl-delete:hover { background: #d0463b; }
.tile-ctrl[disabled] { opacity: .5; cursor: not-allowed; }

/* 모바일/터치: 항상 보이게 */
@media (hover: none) {
    .tile-controls { opacity: 1; transform: none; pointer-events: auto; }
    .tile-ctrl { background: rgba(0, 0, 0, .55); }
}

/* Tile niceties (mypage) */
.tile-noimage {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 4;
    background: var(--hover);
    color: var(--text-dim);
    font-size: 32px;
}
.tile-status { font-style: italic; opacity: .85; }
.tile-actions { display: flex; gap: 6px; margin-top: 8px; }
.tile-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    transition: background .15s ease;
}
.tile-action:hover { background: rgba(255, 255, 255, .3); }

/* Pagination */
.sp-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 36px 0 0;
    flex-wrap: wrap;
}
.sp-pagination a,
.sp-pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    line-height: 1;
    transition: all .15s ease;
}
.sp-pagination a:hover { border-color: var(--text); }
.sp-pagination .current {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* Mobile gutter */
@media (max-width: 720px) {
    .sp-page { padding: 24px 20px 80px; }
    .sp-page-bar { gap: 12px; margin-bottom: 24px; }
    .sp-mypage-card { padding: 18px; gap: 16px; }
    .sp-mypage-avatar img { width: 64px; height: 64px; }
}

/* ─────────────────────────────
   Login page
   ───────────────────────────── */
.sp-page-login .sp-login-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}
.sp-login-form {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 40px 36px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
}
.sp-login-tagline {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 6px;
    font-size: 10.5px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 500;
    align-self: center;
}
.sp-login-tagline .hero-line {
    display: inline-block;
    width: 36px;
    height: 1px;
    background: var(--text-dim);
}
.sp-login-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sp-login-row > span {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 500;
}
.sp-login-form input[type="text"],
.sp-login-form input[type="password"],
.sp-login-form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sp-login-form input:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px var(--hover);
}
.sp-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}
.sp-login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: pointer;
}
.sp-login-remember input { accent-color: var(--text); }
.sp-login-lost {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .15s, border-color .15s;
}
.sp-login-lost:hover { color: var(--text); border-bottom-color: var(--text); }
.sp-login-submit {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}
.sp-login-foot {
    margin: 6px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.sp-login-foot a { color: var(--text); margin-left: 4px; border-bottom: 1px solid var(--text); text-decoration: none; }
.sp-login-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(208, 70, 59, .35);
    border-radius: 8px;
    background: rgba(208, 70, 59, .08);
    color: #d0463b;
    font-size: 13px;
    line-height: 1.5;
}
