/* 해빛스쿨 - 스타일시트
 * 
 * 목차:
 * 1. CSS 변수 (Colors, Spacing, Typography, Effects)
 * 2. 기본 레이아웃 (Body, Container)
 * 3. 로그인 & 인증
 * 4. 헤더 & 네비게이션
 * 5. 탭 & 콘텐츠 섹션
 * 6. 카드 & 입력 폼
 * 7. 업로드 영역
 * 8. 운동 블록 & 리스트
 * 9. 주간 그래프 & 미션
 * 10. 퀘스트 보드
 * 11. 공유 카드
 * 12. 갤러리 (필터, 카드, 액션)
 * 13. 채팅 배너
 * 14. 저장 버튼 & 하단바
 * 15. 토스트 & 모달
 * 16. 라이트박스
 * 17. 마일스톤 & 배지
 * 18. 로딩 & 애니메이션
 * 19. 유틸리티 클래스
 * 20. 접근성
 * 21. 반응형 디자인
 * 22. 인쇄 스타일
 */

:root { 
    /* 기본 색상 */
    --primary-color: #FF8C00; 
    --secondary-color: #4CAF50; 
    --bg-color: #F8F9FA; 
    --text-color: #333; 
    --border-color: #E0E0E0; 
    --point-color: #1E88E5; 
    
    /* 상태 색상 */
    --success-color: #4CAF50;
    --success-light: #E8F5E9;
    --success-dark: #2E7D32;
    --error-color: #F44336;
    --error-light: #FFEBEE;
    --error-border: #FFCDD2;
    --error-dark: #D32F2F;
    --warning-color: #FF9800;
    --warning-light: #FFF3E0;
    --warning-border: #FFCC80;
    --info-color: #2196F3;
    --info-light: #E3F2FD;
    --info-border: #90CAF9;
    --info-dark: #1565C0;
    
    /* 그레이스케일 */
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --text-secondary: #888;
    --text-tertiary: #999;
    --text-disabled: #BDBDBD;
    
    /* 특수 색상 */
    --purple: #9C27B0;
    --pink-light: #F8BBD0;
    --blue-light: #E1F5FE;
    --green-tint: #C8E6C9;
    
    /* 그림자 */
    --shadow-light: 0 2px 5px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 10px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 20px rgba(0,0,0,0.2);
    --shadow-primary: 0 2px 5px rgba(255,140,0,0.3);
    --shadow-primary-hover: 0 4px 10px rgba(255,140,0,0.4);
    
    /* 간격 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    
    /* 폰트 크기 */
    --font-xs: 11px;
    --font-sm: 12px;
    --font-base: 14px;
    --font-md: 15px;
    --font-lg: 16px;
    --font-xl: 18px;
    --font-2xl: 20px;
    --font-3xl: 24px;
    --font-4xl: 28px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 50%;
    --radius-pill: 30px;
    
    /* Transition */
    --transition-fast: 0.1s;
    --transition-base: 0.3s;
    --transition-slow: 0.5s;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    margin: 0; 
    padding: 0; 
    display: flex; 
    justify-content: center; 
}

.app-container { 
    width: 100%; 
    max-width: 480px; 
    background-color: white; 
    min-height: 100vh; 
    box-shadow: 0 0 15px rgba(0,0,0,0.05); 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    overflow-x: hidden; 
}

/* 로그인 모달 */
#login-modal { 
    display: flex; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(160deg, #FFF8E1 0%, #FFFFFF 40%, #FFF3E0 100%); 
    z-index: 1000; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
    text-align: center; 
    box-sizing: border-box; 
}

.login-title { 
    color: var(--primary-color); 
    font-size: 30px; 
    font-weight: 900; 
    margin-bottom: 5px; 
    letter-spacing: -0.5px;
}

.google-btn { 
    background-color: var(--white); 
    color: var(--text-color); 
    border: 1px solid var(--gray-200); 
    padding: 14px 28px; 
    font-size: var(--font-md); 
    font-weight: 700; 
    border-radius: var(--radius-pill); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: var(--spacing-md); 
    margin-top: var(--spacing-xl); 
    box-shadow: 0 2px 12px rgba(0,0,0,0.08); 
    transition: transform 0.12s, box-shadow 0.15s; 
}

.google-btn:active { 
    transform: scale(0.97); 
    box-shadow: 0 1px 4px rgba(0,0,0,0.08); 
}

.google-icon { 
    width: 20px; 
    height: 20px; 
}

.guest-btn { 
    background: none; 
    border: none; 
    color: var(--text-secondary); 
    text-decoration: none; 
    margin-top: 24px; 
    font-size: 13px; 
    cursor: pointer; 
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.15s;
}

.guest-btn:hover {
    background: rgba(0,0,0,0.04);
}

/* WebView 경고 박스 */
.webview-warning-box {
    background: #FFF8E1;
    border: 1px solid #FFD54F;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    margin-top: 16px;
    max-width: 320px;
}

.webview-warning-box .google-btn {
    margin-top: 8px;
    width: 100%;
    background: #4285F4;
    color: #fff;
    border: none;
}

.webview-warning-box .guest-btn {
    margin-top: 8px;
    color: #555;
}

/* 메인 앱 */
#main-app { 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    padding-bottom: 90px; 
}

/* 헤더 */
.header { 
    background-color: white; 
    padding: 12px 16px 8px 16px; 
    position: sticky; 
    top: 0; 
    z-index: 50; 
    border-bottom: 1px solid var(--gray-200); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-top { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 5px; 
}

.header h1 { 
    margin: 0; 
    font-size: 15px; 
    color: var(--primary-color); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    min-width: 4.8em;
    max-width: 42%;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.header h1:active {
    opacity: 0.7;
}

.date-selector-container { 
    background-color: #F1F8E9; 
    padding: 4px 8px; 
    border-radius: 6px; 
    display: flex; 
    align-items: center; 
    flex: 1 1 auto;
    min-width: 84px;
    justify-content: center; 
}

.date-input { 
    border: none; 
    background: transparent; 
    font-family: inherit; 
    font-size: 13px; 
    color: #2E7D32; 
    font-weight: bold; 
    outline: none; 
    text-align: center; 
    width: 100%;
}

.point-badge { 
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%); 
    border: 1.5px solid #64B5F6; 
    color: #1565C0; 
    font-size: 12px; 
    font-weight: 800; 
    padding: 5px 12px; 
    border-radius: 20px; 
    white-space: nowrap; 
    flex-shrink: 0;
    cursor: pointer; 
    box-shadow: 0 2px 6px rgba(21,101,192,0.12);
    transition: transform 0.12s;
}

.point-badge:active {
    transform: scale(0.95);
}

/* 탭 메뉴 */
.tab-menu { 
    display: flex; 
    flex-wrap: wrap; 
    background-color: white; 
    border-bottom: 1px solid var(--gray-200); 
    position: sticky;
    top: 49px;
    z-index: 49;
}

.tab-btn { 
    width: 33.33%; 
    box-sizing: border-box; 
    padding: 11px 5px; 
    text-align: center; 
    font-size: 13px; 
    font-weight: 700; 
    color: var(--gray-500); 
    background: none; 
    border: none; 
    cursor: pointer; 
    transition: color 0.2s; 
    border-bottom: 2.5px solid transparent; 
    letter-spacing: -0.3px;
}

.tab-btn.active { 
    color: var(--primary-color); 
    border-bottom: 2.5px solid var(--primary-color); 
}

.tab-btn:active { 
    opacity: 0.7; 
}

/* 콘텐츠 섹션 */
.content-section { 
    display: none; 
    padding: 20px; 
    animation: fadeIn 0.3s; 
}

.content-section.active { 
    display: block; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* 카드 */
.card { 
    background: var(--white); 
    border: 1px solid var(--gray-200); 
    border-radius: 14px; 
    padding: var(--spacing-xl); 
    margin-bottom: var(--spacing-lg); 
    box-sizing: border-box; 
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.card.metrics-card { 
    border: 2px solid var(--info-light); 
    background-color: var(--pink-light); 
    background: linear-gradient(to right, var(--white), var(--info-light)); 
}

.card h3 { 
    margin: 0 0 var(--spacing-md) 0; 
    font-size: var(--font-lg); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: var(--spacing-sm); 
}

/* ===========================
   내 지갑 탭 (Wallet Tab)
   =========================== */

/* 자산 요약 카드 */
.wallet-asset-card {
    background: linear-gradient(135deg, #FFAF3F 0%, #F57C00 52%, #E06200 100%);
    color: white;
    border: 1px solid rgba(191, 86, 0, 0.18);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(196, 98, 9, 0.16);
}

.wallet-asset-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.wallet-asset-card h3 {
    color: rgba(255,255,255,0.9);
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
}

.wallet-asset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.wallet-asset-item {
    background: rgba(255,255,255,0.13);
    backdrop-filter: blur(10px);
    padding: 14px 12px 10px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.14);
    transition: background 0.2s;
    min-width: 0;
}

.wallet-asset-item:active {
    background: rgba(255,255,255,0.12);
}

.wallet-asset-label {
    font-size: 12px;
    opacity: 0.8;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.wallet-asset-value {
    font-size: 22px;
    font-weight: 800;
    margin-top: 6px;
    margin-bottom: 0;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.wallet-asset-unit {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.7;
    margin-left: 1px;
}

.wallet-onchain-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    color: rgba(255,255,255,0.9);
    margin-top: 0;
    border: 1px solid rgba(255,255,255,0.25);
}

.wallet-onchain-badge .dot {
    width: 5px;
    height: 5px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* 지갑 정보 카드 */
.wallet-info-card {
    background: linear-gradient(180deg, #fffdf8 0%, #fff8ef 100%);
    border: 1px solid #f0d7b6;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(89, 69, 39, 0.05);
}

.wallet-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.wallet-info-header h3 {
    margin: 0;
    font-size: 14px;
    color: #5c3414;
}

.wallet-network-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff3de;
    border: 1px solid #f3cf9b;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: #9b5200;
    margin-left: auto;
}

.wallet-network-badge .dot {
    width: 6px;
    height: 6px;
    background: #F57C00;
    border-radius: 50%;
}

.wallet-address-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.88);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ecd9bf;
}

.wallet-address-text {
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: 12px;
    color: var(--gray-700);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-addr-actions {
    display: flex;
    gap: 4px;
}

.wallet-addr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    border: 1px solid var(--gray-200);
}

.wallet-addr-btn:active {
    transform: scale(0.92);
    background: var(--gray-100);
}

.wallet-links {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.wallet-link-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 9px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    background: white;
}

.wallet-link-btn:active {
    transform: scale(0.97);
}

.wallet-link-btn.primary {
    background: linear-gradient(135deg, #F57C00, #FF9F1C);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(255,140,0,0.3);
}

/* 변환 카드 */
.wallet-convert-card {
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(180deg, #fffdf8 0%, #fff8ef 100%);
    border: 1px solid #f0d7b6;
    box-shadow: 0 8px 20px rgba(89, 69, 39, 0.05);
}

.wallet-convert-card h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #5c3414;
}

.wallet-convert-desc {
    font-size: 12px;
    color: #866b4d;
    margin: 0 0 14px 0;
}

.wallet-convert-result-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.wallet-convert-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.wallet-convert-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: var(--gray-800);
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.wallet-convert-input::-webkit-inner-spin-button,
.wallet-convert-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.wallet-convert-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.wallet-convert-unit {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-500);
    white-space: nowrap;
}

.wallet-convert-arrow {
    font-size: 16px;
    color: var(--gray-400);
}

.wallet-convert-result {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
    white-space: nowrap;
}

.wallet-convert-presets {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.wallet-preset-btn {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.wallet-preset-btn:active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(0.95);
}

.wallet-preset-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.wallet-convert-submit {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #FF9800 0%, #FF6D00 100%);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(255,152,0,0.3);
}

.wallet-convert-submit:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(255,152,0,0.3);
}

.wallet-convert-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 반감기 카드 */
.wallet-halving-card {
    background: linear-gradient(135deg, #FFF4D6 0%, #FFE2A4 100%);
    border: 1px solid #f0cf8f;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(89, 69, 39, 0.05);
}

.wallet-halving-card h3 {
    color: #E65100;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.wallet-halving-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.wallet-halving-stat {
    background: rgba(255,255,255,0.7);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wallet-halving-stat-label {
    font-size: 10px;
    color: #888;
    letter-spacing: 0.3px;
}

.wallet-halving-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #E65100;
    margin-top: 4px;
    line-height: 1.2;
}

.wallet-halving-progress {
    background: rgba(255,255,255,0.5);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.wallet-halving-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
}

.wallet-halving-bar-bg {
    background: #E0E0E0;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.wallet-halving-bar-fill {
    background: linear-gradient(90deg, #FF8C00, #FFA726);
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s;
}

.wallet-halving-schedule {
    background: rgba(255,255,255,0.6);
    border-radius: 10px;
    overflow: hidden;
}

.wallet-halving-schedule-header {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr;
    font-size: 10px;
    font-weight: 700;
    color: #E65100;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wallet-halving-row {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr;
    padding: 6px 10px;
    font-size: 11px;
    color: #555;
    transition: background 0.2s;
}

.wallet-halving-row.active {
    background: rgba(255,140,0,0.08);
    font-weight: 700;
    color: #E65100;
}

.wallet-halving-row.future {
    opacity: 0.5;
}

.wallet-halving-tip {
    font-size: 12px;
    color: #E65100;
    margin: 10px 0 0;
    text-align: center;
    font-weight: 600;
}

/* 거래 기록 카드 */
.wallet-tx-card {
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(180deg, #fffdf8 0%, #fff8ef 100%);
    border: 1px solid #f0d7b6;
    box-shadow: 0 8px 20px rgba(89, 69, 39, 0.05);
}

.wallet-tx-card h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #5c3414;
}

.wallet-tx-list {
    max-height: 250px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
}

.wallet-tx-section + .wallet-tx-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(240, 215, 182, 0.9);
}

.wallet-tx-section-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    color: #8d5620;
    letter-spacing: 0.02em;
}

.wallet-tx-subempty {
    padding: 10px 2px 2px;
    font-size: 12px;
    color: #9b7b58;
}

.wallet-tx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.wallet-tx-item:last-child {
    border-bottom: none;
}

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

.wallet-tx-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.wallet-tx-icon.convert { background: #FFF3E0; }
.wallet-tx-icon.stake { background: #E3F2FD; }
.wallet-tx-icon.settle { background: #F3E5F5; }
.wallet-tx-icon.withdraw { background: #FFEBEE; }

.wallet-tx-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.wallet-tx-date {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 1px;
}

.wallet-tx-right {
    text-align: right;
}

.wallet-tx-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
}

.wallet-tx-amount.positive { color: #2E7D32; }
.wallet-tx-amount.negative { color: #D32F2F; }

.wallet-tx-status {
    font-size: 10px;
    margin-top: 2px;
}

.wallet-tx-empty {
    text-align: center;
    padding: 24px;
    color: var(--gray-400);
    font-size: 13px;
}

/* 거래 기록 빈 상태 CTA */
.wallet-tx-empty-cta {
    text-align: center;
    padding: 24px 16px;
}

.wallet-tx-empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.wallet-tx-empty-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.wallet-tx-empty-sub {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 14px;
}

.wallet-tx-empty-btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #FF9800, #FF6D00);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(255,152,0,0.3);
}

.wallet-tx-empty-btn:active {
    transform: scale(0.95);
}

/* 자산 증감 델타 (온체인 배지와 동일 스타일) */
.wallet-onchain-badge.today-delta {
    margin-top: 4px;
}
.wallet-onchain-badge.today-delta.up {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.9);
}
.wallet-onchain-badge.today-delta.up .dot {
    background: #4CAF50;
}
.wallet-onchain-badge.today-delta.neutral {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
}
.wallet-onchain-badge.today-delta.neutral .dot {
    background: rgba(255,255,255,0.3);
    animation: none;
}

/* 7일 미니차트 */
.wallet-minichart {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.16);
    border-radius: 10px;
}

.wallet-asset-note {
    font-size: 10px;
    color: rgba(255,255,255,0.82);
    margin-top: 8px;
    line-height: 1.45;
    text-align: center;
}

.wallet-minichart-label {
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.wallet-minichart-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 50px;
}

.wallet-minichart-bar {
    flex: 1;
    background: rgba(255,255,255,0.25);
    border-radius: 3px 3px 0 0;
    min-height: 3px;
    transition: height 0.3s ease;
    position: relative;
}

.wallet-minichart-bar.today {
    background: rgba(255,255,255,0.6);
}

.wallet-minichart-bar-value {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 700;
    opacity: 0.9;
    white-space: nowrap;
}

.wallet-minichart-bar-label {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    opacity: 0.5;
    white-space: nowrap;
}

/* 변환 비율 배지 */
.wallet-convert-rate-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    background: #FFE8C6;
    color: #B15900;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* 일일 한도 표시 */
.wallet-convert-limit {
    font-size: 11px;
    color: var(--gray-500);
    text-align: center;
    margin: 8px 0 12px;
}

/* 변환 확인 모달 */
.wallet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wallet-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 340px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.2s ease;
}

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

.wallet-modal-title {
    padding: 16px 20px 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    border-bottom: 1px solid var(--gray-100);
}

.wallet-modal-body {
    padding: 16px 20px;
}

.wallet-modal-summary {
    background: var(--gray-50);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.wallet-modal-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--gray-600);
}

.wallet-modal-row .highlight {
    font-weight: 700;
    color: var(--primary-color);
}

.wallet-modal-warn {
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
    margin: 0;
}

.wallet-modal-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px 16px;
}

.wallet-modal-btn {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.wallet-modal-btn.cancel {
    background: var(--gray-100);
    color: var(--gray-600);
}

.wallet-modal-btn.confirm {
    background: linear-gradient(135deg, #FF9800, #FF6D00);
    color: white;
    box-shadow: 0 2px 8px rgba(255,152,0,0.3);
}

.wallet-modal-btn:active {
    transform: scale(0.97);
}

/* 스켈레톤 로딩 */
.wallet-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-card {
    border-radius: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-asset { height: 140px; }
.skeleton-info { height: 100px; }
.skeleton-convert { height: 180px; }

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.wallet-skeleton + .card,
.wallet-skeleton ~ .card {
    display: none;
}

.wallet-skeleton.hidden {
    display: none;
}

.wallet-skeleton.hidden + .card,
.wallet-skeleton.hidden ~ .card {
    display: block;
}

/* 챌린지 카드 개선 */
.wallet-challenge-card {
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(180deg, #fffdf8 0%, #fff8ef 100%);
    border: 1px solid #f0d7b6;
    box-shadow: 0 8px 20px rgba(89, 69, 39, 0.05);
}

.wallet-challenge-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #5c3414;
}

.wallet-challenge-desc {
    font-size: 12px;
    color: #866b4d;
    margin: 0 0 12px 0;
}

.wallet-challenge-active {
    margin-bottom: 12px;
}

/* 챌린지 링 차트 진행 카드 */
.challenge-ring-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    position: relative;
}

.challenge-ring-card.tier-mini-bg { background: linear-gradient(135deg, #E8F5E9, #C8E6C9); }
.challenge-ring-card.tier-weekly-bg { background: linear-gradient(135deg, #FFF3E0, #FFE0B2); }
.challenge-ring-card.tier-master-bg { background: linear-gradient(135deg, #FBE9E7, #FFCCBC); }

.challenge-ring-svg {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.challenge-ring-bg {
    fill: none;
    stroke: rgba(0,0,0,0.08);
    stroke-width: 5;
}

.challenge-ring-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.challenge-ring-text {
    font-size: 12px;
    font-weight: 800;
    fill: #333;
    text-anchor: middle;
    dominant-baseline: central;
}

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

.challenge-ring-name {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin-bottom: 1px;
}

.challenge-ring-date {
    font-size: 10px;
    color: #666;
    margin-bottom: 1px;
}

.challenge-ring-stake {
    font-size: 10px;
    color: #555;
}

.challenge-ring-remain {
    font-size: 10px;
    color: #888;
    margin-top: 1px;
}

.challenge-ring-claim {
    font-size: 11px;
    font-weight: 700;
    color: #E65100;
    margin-top: 2px;
    animation: pulse-claim 1.5s infinite;
}

@keyframes pulse-claim {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.challenge-ring-card.claimable {
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(230, 81, 0, 0.2);
    border: 2px solid rgba(230, 81, 0, 0.3);
}

.challenge-ring-card.claimable:active {
    transform: scale(0.97);
}

.challenge-ring-forfeit {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 9px;
    color: #999;
    cursor: pointer;
}

.challenge-ring-forfeit:hover {
    background: rgba(244,67,54,0.1);
    color: #F44336;
}

.challenge-ring-detail {
    font-size: 10px;
    color: #666;
    line-height: 1.4;
}

/* 챌린지 예치 슬라이더 */
.tier-stake-slider-wrap {
    width: 100%;
    padding-top: 8px;
    border-top: 1px dashed rgba(0,0,0,0.08);
    margin-top: 6px;
}

.wallet-stake-label {
    font-size: 10px;
    color: #999;
    display: block;
    margin-bottom: 4px;
}

.wallet-stake-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding-top: 6px;
    border-top: 1px dashed rgba(0,0,0,0.08);
    margin-top: 4px;
}

.wallet-stake-slider {
    width: 90%;
    display: block;
    margin: 0 auto;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
    touch-action: pan-y; /* 수직 스크롤 허용, 수평 드래그는 슬라이더가 처리 */
}

.wallet-stake-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.wallet-stake-value {
    font-size: 12px;
    font-weight: 700;
    color: #E65100;
    min-width: 50px;
    text-align: right;
    white-space: nowrap;
}

/* 챌린지 예상 수익 표시 */
.wallet-stake-reward {
    font-size: 10px;
    color: #4CAF50;
    text-align: right;
    margin-top: 2px;
    padding-right: 4px;
}

/* 슬라이더 최소/최대 범위 라벨 */
.wallet-stake-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #888;
    margin-top: 1px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

/* 변환 버튼 스피너 */
.wallet-convert-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.wallet-convert-submit.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 다크모드 추가 */
body.dark-mode .wallet-modal {
    background: #1E1E2E;
}

body.dark-mode .wallet-modal-title {
    color: #eee;
    border-color: #333;
}

body.dark-mode .wallet-modal-summary {
    background: #161622;
}

body.dark-mode .wallet-modal-row { color: #ccc; }

body.dark-mode .wallet-modal-btn.cancel {
    background: #2A2A3A;
    color: #ccc;
}

body.dark-mode .wallet-convert-rate-badge {
    background: #332A15;
    color: #FFB74D;
}

body.dark-mode .wallet-challenge-card {
    background: #1E1E2E;
    border-color: #333;
}

body.dark-mode .skeleton-card {
    background: linear-gradient(90deg, #2A2A3A 25%, #333 50%, #2A2A3A 75%);
    background-size: 200% 100%;
}

body.dark-mode .wallet-tx-empty-text { color: #ccc; }
body.dark-mode .wallet-tx-empty-sub { color: #888; }
body.dark-mode .hbt-disclaimer { color: #bbb; }

/* HBT 변환 버튼 (legacy, 챌린지 등에서 재사용) */
.hbt-convert-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #FF9800 0%, #FF6D00 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(255,152,0,0.3);
    letter-spacing: -0.3px;
}

.hbt-convert-btn:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(255,152,0,0.3);
}

.hbt-convert-btn.hbt-convert-big {
    background: linear-gradient(135deg, #7C4DFF 0%, #651FFF 100%);
    box-shadow: 0 3px 10px rgba(124,77,255,0.3);
}

.hbt-convert-btn.hbt-convert-big:active {
    box-shadow: 0 1px 4px rgba(124,77,255,0.3);
}

.hbt-convert-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 입력 폼 */
.input-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
    margin-top: 10px; 
}

/* 인바디 필드 */
.inbody-field {
    display: flex;
    flex-direction: column;
}
.inbody-field input {
    margin-top: 0;
}

input[type="number"], 
input[type="text"], 
textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    box-sizing: border-box; 
    font-size: 14px; 
}

textarea { 
    resize: none; 
    height: 80px; 
    margin-top: 10px; 
}

/* 업로드 영역 */
.upload-area { 
    border: 2px dashed var(--gray-200); 
    border-radius: 12px; 
    padding: 15px 10px; 
    text-align: center; 
    background-color: var(--gray-50); 
    margin-bottom: var(--spacing-md); 
    display: block; 
    position: relative; 
    transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #FFF8E1;
}

.upload-area input[type="file"] { 
    display: none; 
}

.preview-img { 
    width: 100%; 
    max-width: 240px;
    max-height: 240px; 
    object-fit: contain; 
    display: none; 
    border-radius: 6px; 
    margin: 10px auto 0 auto; 
}

.preview-strength { 
    display: none; 
    margin-top: var(--spacing-md); 
    background: #0d1117; 
    padding: 0; 
    border-radius: var(--radius-md); 
    border: 1px solid var(--gray-200); 
    overflow: hidden;
    position: relative;
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
}

.preview-strength-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.preview-strength-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    color: var(--primary-color);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
}

.static-remove-btn { 
    display: none; 
    position: absolute; 
    top: 15px; 
    right: 5px; 
    background: var(--error-light); 
    border: 1px solid var(--error-border); 
    color: var(--error-dark); 
    font-size: var(--font-xs); 
    font-weight: bold; 
    cursor: pointer; 
    padding: 4px 8px; 
    border-radius: var(--radius-sm); 
    z-index: 20; 
    box-shadow: var(--shadow-light); 
}

.static-rotate-btn {
    display: none;
    position: absolute;
    top: 15px;
    left: 5px;
    background: rgba(255,255,255,0.92);
    border: 1px solid #ccc;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    z-index: 20;
    box-shadow: var(--shadow-light);
    line-height: 1;
}

.smart-upload-box { 
    background: linear-gradient(135deg, #FFF8E1 0%, #FFF3E0 100%); 
    border: 1.5px solid var(--warning-border); 
    border-radius: 14px; 
    padding: 16px; 
    text-align: center; 
    margin-bottom: 16px; 
}

.smart-upload-btn { 
    background: linear-gradient(135deg, #FF8C00 0%, #FF6D00 100%); 
    color: white; 
    border: none; 
    padding: 12px 24px; 
    font-size: var(--font-base); 
    font-weight: 700; 
    border-radius: 12px; 
    cursor: pointer; 
    display: inline-block; 
    box-shadow: 0 3px 10px rgba(255,109,0,0.25); 
    margin-top: 5px; 
    transition: transform 0.12s, box-shadow 0.15s; 
    letter-spacing: -0.3px;
}

.smart-upload-btn:active { 
    transform: scale(0.95); 
    box-shadow: 0 1px 4px rgba(255,109,0,0.15); 
}

/* 운동 블록 */
.exercise-block { 
    border: 1px solid var(--gray-200); 
    border-radius: var(--radius-md); 
    padding: 15px; 
    margin-bottom: 15px; 
    background: var(--gray-50); 
    position: relative; 
}

.block-remove-btn { 
    position: absolute; 
    top: -10px; 
    right: -10px; 
    background: var(--error-light); 
    border: 1px solid var(--error-border); 
    color: var(--error-dark); 
    font-size: var(--font-xs); 
    font-weight: bold; 
    cursor: pointer; 
    width: 24px; 
    height: 24px; 
    border-radius: var(--radius-full); 
    z-index: 30; 
    box-shadow: var(--shadow-light); 
}

.add-btn { 
    width: 100%; 
    padding: var(--spacing-md); 
    background: var(--success-light); 
    border: 1px dashed var(--success-color); 
    color: var(--success-dark); 
    font-weight: bold; 
    border-radius: var(--radius-md); 
    cursor: pointer; 
    margin-bottom: var(--spacing-md); 
    transition: background var(--transition-base); 
}

.add-btn:active { 
    background: var(--green-tint); 
}

/* 주간 그래프 */
.week-graph { 
    display: flex; 
    justify-content: space-between; 
    margin: 20px 0 10px 0; 
    padding: 0 5px; 
}

.day-wrap { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 5px; 
    cursor: pointer; 
}

.day-circle { 
    width: 36px; 
    height: 36px; 
    border-radius: var(--radius-full); 
    background-color: var(--gray-200); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: var(--font-sm); 
    font-weight: bold; 
    color: var(--text-tertiary); 
    transition: var(--transition-base); 
}

.day-circle.done { 
    background-color: var(--primary-color); 
    color: white; 
    box-shadow: var(--shadow-primary-hover); 
}

.day-label { 
    font-size: var(--font-xs); 
    color: var(--text-disabled); 
}

.day-label.today { 
    color: var(--primary-color); 
    font-weight: bold; 
}

/* 미션 */
.mission-level { 
    font-size: var(--font-sm); 
    background: var(--purple); 
    color: white; 
    padding: 3px 8px; 
    border-radius: var(--radius-lg); 
    font-weight: normal; 
    cursor: pointer; 
}

.mission-card-enhanced {
    position: relative;
    border: 1px solid #E2EBF8 !important;
    background: linear-gradient(180deg, #FFFFFF 0%, #F7FBFF 100%) !important;
    box-shadow: 0 10px 26px rgba(33, 150, 243, 0.07);
}

.mission-focus-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 2px 0 6px;
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #EEF7FF 0%, #F6FBFF 100%);
    border: 1px solid #D7EAFE;
}

.mission-focus-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.mission-focus-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #2196F3;
    margin-bottom: 2px;
}

.mission-focus-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: #243043;
}

.mission-focus-btn {
    flex-shrink: 0;
    min-height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2196F3 0%, #1E88E5 100%);
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(33, 150, 243, 0.18);
}

.mission-focus-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.mission-focus-tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid #DFE8F3;
    color: #607086;
    font-size: 11px;
    font-weight: 600;
}

.mission-card-intro {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.45;
    color: #6E7683;
}

.mission-levelup-lock {
    padding: 14px 12px;
    border-radius: 14px;
    border: 1px solid #E4D8F5;
    background: linear-gradient(180deg, #FBF8FF 0%, #F6F0FF 100%);
}

.mission-levelup-lock-title {
    font-size: 14px;
    font-weight: 800;
    color: #7B1FA2;
    margin-bottom: 6px;
}

.mission-levelup-lock-body {
    font-size: 12px;
    line-height: 1.5;
    color: #6E5F7B;
}

.community-dashboard-card {
    margin-top: 8px;
    border: 1px solid #F0E4CF !important;
    background: linear-gradient(180deg, #FFFDF8 0%, #FFF8EF 100%) !important;
    box-shadow: 0 10px 24px rgba(255, 152, 0, 0.06);
}

.community-dashboard-head {
    margin-bottom: 6px;
}

.community-dashboard-head h3 {
    margin-bottom: 0;
}

.card-invite.is-highlighted {
    box-shadow: 0 0 0 3px rgba(255, 179, 0, 0.2), 0 12px 28px rgba(255, 152, 0, 0.18);
    transition: box-shadow 0.2s ease;
}

.mission-item { 
    display: flex; 
    align-items: center; 
    gap: var(--spacing-sm); 
    margin-bottom: var(--spacing-md); 
    font-size: var(--font-base); 
    color: var(--gray-700); 
}

/* 미션 카테고리 블록 */
.mission-category-block {
    margin-bottom: 8px;
    padding: 8px 9px;
    background: var(--gray-50, #f8f9fa);
    border-radius: 10px;
    border: 1px solid var(--gray-200, #e9ecef);
}

.mission-category-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--gray-700);
}

.mission-category-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mission-category-top.compact {
    justify-content: space-between;
}

.mission-category-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 66px;
}

.mission-category-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary-color);
}

/* 난이도 탭 */
.mission-difficulty-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.diff-tab {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--gray-300, #dee2e6);
    border-radius: 8px;
    background: white;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--gray-600);
}

.diff-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.diff-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.diff-tab[data-diff="hard"].active {
    background: #E91E63;
    border-color: #E91E63;
}

.diff-tab[data-diff="easy"].active {
    background: #4CAF50;
    border-color: #4CAF50;
}

.mission-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: white;
    border-radius: 8px;
    font-size: 11px;
    color: var(--gray-700);
}

.mission-preview input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary-color);
}

.mission-preview.compact {
    margin-top: 5px;
    gap: 0;
    padding: 5px 8px;
}

.mission-preview.compact span {
    line-height: 1.3;
}

.mission-setup-intro {
    margin-bottom: 10px;
    font-size: 12px;
    color: #667085;
}

.custom-mission-shell {
    margin-top: 4px;
}

.mission-inline-toggle {
    width: 100%;
    min-height: 32px;
    font-size: 12px;
}

/* 커스텀 미션 */
.custom-mission-section {
    margin-top: 6px;
    padding: 8px;
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border-radius: 10px;
    border: 1px solid #FFB74D;
}

.custom-mission-header {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #E65100;
}

.custom-mission-input-row {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.custom-mission-input-row select {
    padding: 7px 4px;
    border: 1px solid #FFB74D;
    border-radius: 8px;
    font-size: 11px;
    background: white;
    min-width: 52px;
}

.custom-mission-input-row input[type="text"] {
    flex: 1;
    min-width: 80px;
    padding: 7px 8px;
    border: 1px solid #FFB74D;
    border-radius: 8px;
    font-size: 12px;
}

.add-custom-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #FF9800;
    color: white;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.custom-mission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: white;
    border-radius: 8px;
    font-size: 13px;
}

.remove-custom-btn {
    background: none;
    border: none;
    color: #EF5350;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

.custom-tag {
    font-size: 10px;
    background: #FF9800;
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* 지난주 리포트 카드 */
.week-report-card {
    padding: 12px 14px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: 10px;
    border: 1px solid #90CAF9;
}

.week-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1565C0;
}

.week-report-rate {
    font-size: 14px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.rate-great { background: #C8E6C9; color: #2E7D32; }
.rate-good { background: #FFF9C4; color: #F57F17; }
.rate-low { background: #FFCDD2; color: #C62828; }

.week-report-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #1976D2;
}

/* 스트릭 배지 */
.mission-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #FF6F00 0%, #FF8F00 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    animation: streakPulse 2s infinite;
}

@keyframes streakPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* 전체 달성 현황 */
.mission-overall-status {
    margin-top: 14px;
    padding: 12px;
    background: var(--gray-50, #f8f9fa);
    border-radius: 10px;
    text-align: center;
}

.overall-rate {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-700);
    word-break: keep-all;
}

.overall-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    color: var(--gray-600);
}

.mission-warning {
    margin-top: 10px;
    padding: 10px 12px;
    background: #FFF3E0;
    border: 1px solid #FFB74D;
    border-radius: 8px;
    font-size: 13px;
    color: #E65100;
    text-align: center;
}

.reset-mission-btn {
    margin-top: 10px !important;
    background-color: var(--gray-400, #bdbdbd) !important;
    font-size: 12px !important;
    padding: 8px 14px !important;
}

/* 미션 배지 */
.mission-badges-section {
    margin-top: 16px;
    border-top: 1px dashed var(--gray-200);
    padding-top: 14px;
}

.mission-badges-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-700);
}

.mission-badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.mission-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.2s;
    min-width: 0;
}

.mission-badge.earned {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFE082 100%);
    border: 1px solid #FFD54F;
}

.mission-badge.locked {
    background: var(--gray-100, #f5f5f5);
    border: 1px solid var(--gray-200, #e0e0e0);
    opacity: 0.6;
}

.mission-badge.earned:hover {
    transform: scale(1.05);
}

.badge-emoji {
    font-size: 22px;
    margin-bottom: 3px;
}

.badge-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.2;
    word-break: keep-all;
}

.badge-desc {
    font-size: 8px;
    color: var(--gray-500);
    margin-top: 2px;
    line-height: 1.2;
    word-break: keep-all;
}

/* 커뮤니티 액션 허브 */
.community-focus-panel {
    margin-top: 0;
    padding: 8px 9px;
    border-radius: 13px;
    background:
        radial-gradient(circle at top right, rgba(255, 193, 7, 0.22), transparent 34%),
        linear-gradient(135deg, #FFF8E1 0%, #FFF3E0 52%, #F8F3FF 100%);
    border: 1px solid rgba(255, 179, 0, 0.2);
}

.community-focus-head {
    margin-bottom: 0;
}

.community-focus-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-top: 0;
}

.community-focus-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    color: #3E2723;
}

.community-focus-badge {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 179, 0, 0.24);
    font-size: 11px;
    font-weight: 700;
    color: #8D6E63;
}

.community-focus-body {
    margin: 4px 0 0;
    font-size: 10px;
    line-height: 1.35;
    color: #6D4C41;
}

.community-focus-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.community-focus-stat {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 179, 0, 0.22);
    font-size: 10px;
    font-weight: 700;
    color: #8A6237;
}

.community-focus-actions {
    display: block;
    margin-top: 6px;
}

.community-focus-action {
    width: 100%;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #E3D4C0;
    background: rgba(255, 255, 255, 0.92);
    color: #6D4C41;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.community-focus-action:hover,
.community-focus-action:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(255, 183, 77, 0.14);
}

.community-focus-action.primary {
    background: linear-gradient(135deg, #FFB347 0%, #FF8C00 100%);
    border-color: transparent;
    color: #fff;
}

.community-module-card {
    margin-top: 10px;
    padding: 10px;
    border-radius: 16px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e8e8e8);
}

.community-module-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.community-module-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9E9E9E;
}

.community-module-title {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
}

.community-module-link {
    flex-shrink: 0;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(124, 77, 255, 0.22);
    background: rgba(124, 77, 255, 0.08);
    color: #6C43E0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.community-empty-state {
    padding: 10px;
    border-radius: 16px;
    background: #FAFAFA;
    border: 1px dashed #E0E0E0;
    font-size: 12px;
    line-height: 1.55;
    color: #8A8A8A;
    text-align: center;
}

.community-empty-state strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: #4E342E;
}

.community-empty-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.community-empty-btn,
.community-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(124, 77, 255, 0.18);
    background: rgba(124, 77, 255, 0.08);
    color: #6C43E0;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.friend-activity-summary,
.social-challenge-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.friend-activity-pill,
.social-challenge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #F8F5FF;
    color: #6C43E0;
    font-size: 11px;
    font-weight: 700;
}

.friend-activity-rows,
.social-challenge-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friend-activity-row,
.social-challenge-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 9px;
    border-radius: 14px;
    background: #FAFAFA;
    border: 1px solid #F0F0F0;
}

.friend-activity-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    color: #3E2723;
}

.friend-activity-streak {
    font-size: 11px;
    font-weight: 700;
    color: #F57C00;
}

.friend-activity-checks {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
}

.friend-activity-check {
    opacity: 0.25;
}

.friend-activity-check.is-on {
    opacity: 1;
}

.community-month-summary {
    font-size: 13px;
    line-height: 1.5;
    color: #6D4C41;
    margin-bottom: 10px;
}

.community-inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.community-privacy-inline {
    margin-top: 8px;
    justify-content: space-between;
    width: 100%;
}

.community-privacy-inline .community-inline-btn {
    min-height: 30px;
    padding: 0 10px;
}

.community-detail-shell {
    margin-top: 10px;
    border-top: 1px dashed #E3E8EF;
    padding-top: 10px;
}

.community-detail-shell.is-open {
    border-top: 1px dashed #E3E8EF;
}

.community-detail-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    font-weight: 700;
    color: #6C43E0;
}

.community-detail-toggle::-webkit-details-marker {
    display: none;
}

.community-detail-toggle::after {
    content: "열기";
    font-size: 11px;
}

.community-detail-shell[open] .community-detail-toggle::after {
    content: "접기";
}

.community-detail-body {
    padding-top: 10px;
}

.community-detail-body-always-open {
    padding-top: 0;
}

.community-detail-title {
    font-size: 12px;
    font-weight: 800;
    color: #7A4E12;
    margin-bottom: 10px;
}

.community-collapsible-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.community-collapsible-row[hidden] {
    display: none !important;
}

.community-more-btn {
    margin-top: 8px;
    width: 100%;
    min-height: 36px;
    border: 1px dashed rgba(124, 77, 255, 0.28);
    border-radius: 12px;
    background: rgba(124, 77, 255, 0.06);
    color: #6C43E0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.social-challenge-item.is-invite {
    background: #F5F0FF;
    border-color: #DDD0FF;
}

.social-challenge-item.is-active {
    background: #F7FBF4;
    border-color: #DCEAD3;
}

.social-challenge-main {
    min-width: 0;
}

.social-challenge-type {
    font-size: 13px;
    font-weight: 700;
    color: #3E2723;
}

.social-challenge-meta,
.social-challenge-status {
    margin-top: 3px;
    font-size: 11px;
    color: #7B7285;
}

.social-challenge-status.is-active {
    color: #2E7D32;
    font-weight: 700;
}

.social-challenge-status.is-pending {
    color: #F57C00;
    font-weight: 700;
}

.social-challenge-cta {
    flex-shrink: 0;
    min-height: 36px;
    padding: 0 12px;
    border: none;
    border-radius: 12px;
    background: #7C4DFF;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* 그룹 챌린지 */
.group-challenge-section {
    margin-top: 12px;
}

.group-challenge-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-700);
}

.group-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.group-stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: 10px;
    border: 1px solid #A5D6A7;
    min-width: 0;
}

.group-stat-num {
    font-size: 16px;
    font-weight: 700;
    color: #2E7D32;
}

.group-stat-label {
    font-size: 10px;
    color: #388E3C;
    margin-top: 2px;
}

.group-top-user {
    padding: 8px 12px;
    background: #FFF8E1;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    color: #F57F17;
    border: 1px solid #FFE082;
    word-break: keep-all;
}

/* 연속 기록 하이라이트 */
.community-highlight {
    padding: 6px 12px;
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    color: #E65100;
    border: 1px solid #FFCC80;
    margin-bottom: 8px;
}

/* 카테고리별 1등 */
.category-kings {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.cat-king {
    flex: 1;
    min-width: 0;
    padding: 5px 6px;
    background: #F1F8E9;
    border: 1px solid #C5E1A5;
    border-radius: 8px;
    font-size: 11px;
    text-align: center;
    color: #33691E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MVP 랭킹 */
.mvp-ranking-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #E65100;
    text-align: center;
}

.mvp-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.mvp-ranking-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.mvp-ranking-item.rank-1 {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFE082 100%);
    border: 1.5px solid #FFD54F;
}
.mvp-ranking-item.rank-2 {
    background: linear-gradient(135deg, #F5F5F5 0%, #E0E0E0 100%);
    border: 1.5px solid #BDBDBD;
}
.mvp-ranking-item.rank-3 {
    background: linear-gradient(135deg, #FBE9E7 0%, #FFCCBC 100%);
    border: 1.5px solid #FFAB91;
}

.mvp-medal {
    font-size: 18px;
    line-height: 1;
}

.mvp-name {
    flex: 1;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mvp-days {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
}

.mvp-reward {
    font-size: 12px;
    font-weight: 700;
    color: #E65100;
    background: rgba(255, 111, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.mvp-reward-info {
    font-size: 10px;
    color: #999;
    text-align: center;
    margin-top: 4px;
}

.community-history-btn-wrap {
    text-align: center;
    margin-top: 14px;
}
.community-history-btn {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #4CAF50;
    text-decoration: none;
    padding: 8px 18px;
    border: 1.5px solid #4CAF50;
    border-radius: 20px;
    transition: background 0.15s, color 0.15s;
}
.community-history-btn:active {
    background: #4CAF50;
    color: white;
}

@media (max-width: 640px) {
    .mission-focus-strip {
        padding: 8px 9px;
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
    }

    .mission-focus-btn {
        width: 100%;
        min-height: 36px;
        padding: 0 12px;
        border-radius: 12px;
        box-shadow: 0 8px 16px rgba(33, 150, 243, 0.14);
    }

    .mission-category-top {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .mission-category-check {
        min-width: 0;
    }

    .mission-difficulty-tabs {
        margin-bottom: 0;
    }

    .dashboard-hero-title {
        font-size: 22px;
    }

    .dashboard-action-strip {
        gap: 6px;
    }

    .dashboard-hero-stats {
        gap: 6px;
    }

    .mission-progress-topline,
    .mission-progress-summary-toggle {
        padding: 12px;
    }

    .mission-progress-detail-list {
        padding: 0 12px 12px;
    }

    .mission-progress-actions {
        flex-direction: column;
    }

    .mission-progress-primary-btn,
    .mission-secondary-btn {
        width: 100%;
    }

    .community-focus-panel {
        padding: 11px;
    }

    .community-focus-title-row {
        flex-direction: column;
        gap: 8px;
    }

    .community-focus-badge {
        align-self: flex-start;
    }

    .community-focus-title {
        font-size: 16px;
    }

    .community-focus-body {
        font-size: 12px;
        line-height: 1.45;
    }

    .community-focus-stat {
        min-height: 24px;
        padding: 0 8px;
        font-size: 10px;
    }

    .community-focus-action {
        width: 100%;
        justify-content: center;
    }

    .mission-card-intro {
        margin-bottom: 8px;
        font-size: 12px;
    }

    .mission-category-block {
        margin-bottom: 8px;
        padding: 7px 8px;
    }

    .mission-category-top.compact {
        gap: 6px;
    }

    .mission-difficulty-tabs.compact {
        width: 100%;
        margin-bottom: 0;
    }

    .dashboard-action-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-action-chip {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px;
        border-radius: 14px;
    }

    .dashboard-action-copy span {
        display: none;
    }

    .dashboard-action-copy strong {
        font-size: 12px;
    }

    .dashboard-action-emoji {
        font-size: 20px;
    }

    .dashboard-more-tools-head {
        padding: 11px 12px 0;
    }

    .dashboard-more-tools-body {
        padding: 0 10px 10px;
    }

    .share-card-container {
        padding: 10px;
        max-width: 100%;
    }

    .share-privacy-panel,
    .share-card-capture {
        max-width: 100%;
    }

    .share-privacy-grid {
        grid-template-columns: 1fr;
    }

    .group-stat-item {
        padding: 7px 4px;
    }
}

.mp-count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mission-progress-container { 
    margin-top: 8px; 
    padding-top: 0; 
}

.mission-progress-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mission-progress-topline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px 10px;
    border-radius: 12px;
    background: #F7FBFF;
    border: 1px solid #D9E9F8;
}

.mission-progress-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mission-progress-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid #D9E9F8;
    color: #58708A;
    font-size: 11px;
    font-weight: 700;
}

.mission-progress-pill.is-warning {
    background: #FFF3E0;
    border-color: #FFCC80;
    color: #E65100;
}

.mission-progress-detail-shell {
    border: 1px solid #E4ECF5;
    border-radius: 14px;
    background: #FFFFFF;
    overflow: hidden;
}

.mission-progress-summary-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    font-weight: 700;
    color: #5C6F82;
}

.mission-progress-summary-toggle::-webkit-details-marker {
    display: none;
}

.mission-progress-summary-toggle::after {
    content: "자세히 보기";
    font-size: 11px;
    color: #2196F3;
}

.mission-progress-detail-shell[open] .mission-progress-summary-toggle::after {
    content: "접기";
}

.mission-progress-detail-list {
    padding: 0 14px 14px;
}

.mission-progress-detail-list-plain {
    padding-top: 4px;
    border: 1px solid #E4ECF5;
    border-radius: 12px;
    background: #FFFFFF;
}

.mission-progress-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mission-progress-primary-btn,
.mission-secondary-btn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.mission-progress-primary-btn {
    margin: 0 !important;
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%) !important;
}

.mission-secondary-btn {
    border: 1px solid #D9E9F8;
    background: #FFFFFF;
    color: #58708A;
    cursor: pointer;
}

.mp-row { 
    margin-bottom: var(--spacing-md); 
}

.mp-row:last-child {
    margin-bottom: 0;
}

.mp-label { 
    display: flex; 
    justify-content: space-between; 
    font-size: var(--font-sm); 
    margin-bottom: 4px; 
    color: var(--gray-600); 
}

.mp-track { 
    width: 100%; 
    background-color: var(--gray-200); 
    height: 8px; 
    border-radius: var(--radius-sm); 
    overflow: hidden; 
}

.mp-fill { 
    height: 100%; 
    background-color: var(--secondary-color); 
    transition: width var(--transition-slow); 
}

/* 퀘스트 보드 */
.quest-board { 
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%); 
    border-radius: 14px; 
    padding: 14px 16px; 
    margin-bottom: 16px; 
    border: 1px solid #90CAF9;
}

.quest-item { 
    display: flex; 
    justify-content: space-between; 
    font-size: var(--font-sm); 
    margin-bottom: var(--spacing-sm); 
    color: var(--info-dark); 
}

.quest-item:last-child { 
    margin-bottom: 0; 
}

.quest-check { 
    color: var(--gray-300); 
}

.quest-check.done { 
    color: var(--success-color); 
    font-weight: bold; 
}

/* 공유 카드 */
.share-card-container { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 12px;
    margin-bottom: 0; 
    width: 100%; 
    max-width: 408px;
    background: linear-gradient(160deg, #FFF6E3 0%, #FFFDF6 55%, #F3FAF4 100%);
    padding: 12px 12px 0;
    border-radius: 18px;
    border: 1px solid #F1D7AC;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

.share-card-shell {
    width: 100%;
    margin-bottom: 16px;
}

.share-privacy-panel {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 204, 128, 0.95);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-privacy-panel-inline {
    max-width: none;
    width: 100%;
}

.share-privacy-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.share-privacy-header strong {
    font-size: 13px;
    line-height: 1.2;
    color: #8d3b0f;
}

.share-privacy-header span {
    font-size: 11px;
    line-height: 1.35;
    color: #9a5b35;
    font-weight: 600;
}

.share-privacy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.share-privacy-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 9px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 204, 128, 0.95);
    color: #8d3b0f;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.share-privacy-toggle input {
    margin: 0;
    accent-color: #ff8c00;
}

.share-privacy-toggle span {
    line-height: 1.3;
}

.share-card-capture { 
    width: 100%;
    max-width: 392px;
    aspect-ratio: 1 / 1;
    background: linear-gradient(160deg, #FFF8EA 0%, #FFFDF7 54%, #EEF8F1 100%);
    padding: 10px;
    border-radius: 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 32px rgba(224, 151, 51, 0.16);
    border: 1px solid #EFC98F;
    overflow: hidden;
}

.share-render-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff4e2 0%, #ffe5c0 100%);
}

.share-render-preview[hidden],
.share-render-empty[hidden] {
    display: none !important;
}

.share-render-empty {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    padding: 22px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    background:
        radial-gradient(circle at top right, rgba(255, 207, 131, 0.62) 0%, transparent 28%),
        linear-gradient(160deg, #FFF8EA 0%, #FFFDF7 54%, #EEF8F1 100%);
}

.share-empty-kicker {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.16em;
    color: #b96a00;
}

.share-empty-title {
    font-size: 21px;
    line-height: 1.22;
    color: #2f261d;
}

.share-empty-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #7a6754;
    font-weight: 600;
}

.share-poster-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.share-brand-mark {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(239, 201, 143, 0.95);
    color: #B76400;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.share-heading-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.share-title { 
    font-size: 18px;
    color: #2F261D;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.05em;
    line-height: 1.16;
}

.share-subtitle {
    font-size: 11px;
    line-height: 1.45;
    color: #7A6754;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.share-stat { 
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums;
}

.share-val { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(239, 201, 143, 0.95);
    font-size: 10px;
    font-weight: 800;
    color: #A64B00;
    white-space: nowrap;
}

.share-val.is-hidden {
    color: #a37a58;
    opacity: 0.85;
}

.share-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.share-tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.76);
    border: 1px solid rgba(223, 204, 171, 0.9);
    color: #7D5C3A;
    font-size: 10px;
    font-weight: 800;
}

.share-img-grid {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.share-media-layout {
    display: grid;
    gap: 8px;
    height: 100%;
    min-height: 0;
}

.share-media-layout.share-media-count-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.share-media-layout.share-media-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1fr;
}

.share-media-layout.share-media-count-3,
.share-media-layout.share-media-count-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.share-media-layout.share-media-count-3 .share-media-thumb:first-child {
    grid-row: span 2;
}

.share-empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-height: 0;
    padding: 18px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.7);
    border: 1px dashed rgba(191,54,12,0.2);
    text-align: left;
}

.share-empty-state strong {
    font-size: 16px;
    line-height: 1.25;
    color: #2F261D;
}

.share-empty-state span {
    font-size: 11px;
    line-height: 1.5;
    color: #806B57;
}

.share-media-thumb {
    position: relative;
    width: 100%;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow: 0 10px 18px rgba(53, 34, 8, 0.08);
    background: linear-gradient(145deg, #FFF0D7 0%, #FFE2B5 100%);
}

.share-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    box-shadow: none;
}

.share-media-play-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(0,0,0,0.58);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}

.share-media-chip {
    position: absolute;
    left: 12px;
    bottom: 12px;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    color: #7A4412;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.share-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.share-footer-mark {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    color: #A46019;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.share-footer { 
    font-size: 12px; 
    color: #7A5C3A; 
    font-weight: 800; 
    text-align: right;
}

.btn-share-action { 
    width: 100%; 
    max-width: 280px; 
    background: linear-gradient(135deg, #FF8C00 0%, #FF6D00 50%, #FF3D00 100%); 
    color: white; 
    padding: 11px 16px; 
    border: none; 
    border-radius: 12px; 
    font-weight: 800; 
    cursor: pointer; 
    margin: 8px auto 10px; 
    font-size: 14px; 
    box-shadow: 0 3px 12px rgba(255, 109, 0, 0.3); 
    transition: transform 0.12s, box-shadow 0.15s; 
    display: block; 
    align-self: center;
    justify-self: center;
    text-align: center;
    letter-spacing: -0.3px;
    margin-left: auto;
    margin-right: auto;
    width: min(100%, 320px);
}

.btn-share-action:active { 
    transform: scale(0.97); 
    box-shadow: 0 2px 6px rgba(255, 109, 0, 0.2); 
}

/* 갤러리 필터 */
.gallery-stage {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.gallery-hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(255, 214, 102, 0.35), transparent 38%),
        linear-gradient(135deg, #fffdf4 0%, #fff8ec 58%, #fff3df 100%);
    border: 1px solid #ffe0b2;
}

.gallery-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.gallery-hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-hero-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: #f57c00;
    margin-bottom: 10px;
}

.gallery-hero-title {
    margin: 0;
    font-size: 27px;
    line-height: 1.18;
    letter-spacing: -0.04em;
    color: #2b2116;
}

.gallery-hero-desc {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.65;
    color: #6d5a45;
    max-width: 34ch;
}

.gallery-guide-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(241, 220, 192, 0.95);
    background: rgba(255, 255, 255, 0.78);
    color: #8a5a23;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.gallery-hero-guide-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.gallery-hero-guide-body[hidden] {
    display: none !important;
}

.gallery-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.gallery-hero-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid #f1dcc0;
    background: rgba(255, 255, 255, 0.72);
    color: #463525;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.gallery-hero-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(77, 57, 27, 0.08);
}

.gallery-hero-action.primary {
    background: linear-gradient(135deg, #ff9c3f 0%, #ff7b21 100%);
    border-color: #ff8d35;
    color: #fff;
}

.gallery-hero-action-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(70, 53, 37, 0.08);
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.gallery-hero-action.primary .gallery-hero-action-step {
    background: rgba(255,255,255,0.2);
}

.gallery-hero-action-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.gallery-hero-action-text strong {
    font-size: 13px;
    line-height: 1.2;
}

.gallery-hero-action-text span {
    font-size: 11px;
    line-height: 1.35;
    color: rgba(70, 53, 37, 0.78);
}

.gallery-hero-action.primary .gallery-hero-action-text span {
    color: rgba(255,255,255,0.86);
}

.gallery-share-settings-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.gallery-privacy-note {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.62);
    border: 1px solid rgba(255, 224, 178, 0.9);
    box-sizing: border-box;
}

.gallery-share-settings-toggle {
    width: 100%;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 14px;
}

.gallery-share-settings-shell {
    width: 100%;
    animation: fadeIn 0.18s ease;
}

.share-template-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
}

.share-template-panel-visible {
    width: 100%;
    max-width: 408px;
    margin: 0 auto 6px;
}

.share-template-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.share-template-btn {
    min-height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 181, 110, 0.6);
    background: rgba(255, 248, 236, 0.92);
    color: #8a5a23;
    font-size: 10px;
    font-weight: 800;
    padding: 0 8px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.share-template-btn.is-active {
    background: linear-gradient(135deg, #ff9a1f 0%, #ff7a00 100%);
    color: #fff;
    border-color: #ff8c00;
    box-shadow: 0 10px 18px rgba(255, 140, 0, 0.18);
}

.gallery-privacy-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff3d6;
    color: #b55a00;
    font-size: 11px;
    font-weight: 800;
}

.gallery-privacy-text {
    font-size: 11px;
    color: #765d42;
    font-weight: 600;
}

.gallery-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.gallery-hero.is-collapsed {
    padding-bottom: 14px;
}

.gallery-hero-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 224, 178, 0.9);
}

.gallery-hero-stat strong {
    font-size: 24px;
    line-height: 1;
    color: #2b2116;
    font-variant-numeric: tabular-nums;
}

.gallery-hero-stat span {
    font-size: 12px;
    color: #8b6f4f;
    font-weight: 600;
}

.gallery-top-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.gallery-feed-shell {
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
}

.gallery-feed-toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
}

.gallery-feed-heading h3 {
    margin: 4px 0 6px;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: #2b2116;
}

.gallery-feed-heading p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--gray-500);
}

.gallery-feed-heading p:empty {
    display: none;
}

.gallery-feed-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: #ff8c00;
}

.gallery-user-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: #fff3e0;
    border-radius: 999px;
    border: 1px solid #ffd6a5;
    font-size: 12px;
}

.gallery-user-filter-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    color: #b55a00;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

#gallery-user-filter-label {
    color: #e65100;
    font-weight: 700;
}

.gallery-user-filter-clear {
    margin-left: auto;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(230, 81, 0, 0.14);
    background: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    line-height: 1;
    color: #e65100;
    font-weight: 800;
    cursor: pointer;
}

.gallery-top-grid > * {
    margin-bottom: 0;
}

#my-share-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-filters { 
    display: flex; 
    gap: 4px; 
    margin-bottom: 0; 
    overflow: visible; 
    padding-bottom: 0; 
    border-bottom: none;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: auto;
    max-width: 100%;
}

#gallery-container {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.filter-chip { 
    padding: 7px 10px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 700; 
    background: var(--white); 
    color: var(--gray-500); 
    border: 1.5px solid var(--gray-200); 
    cursor: pointer; 
    white-space: nowrap; 
    transition: all 0.15s; 
}

.filter-chip.active { 
    background: var(--primary-color); 
    color: white; 
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(255,140,0,0.25);
}

.filter-chip:active { 
    transform: scale(0.95); 
}

/* 갤러리 카드 - 인스타그램 스타일 */
.gallery-card { 
    background: var(--white); 
    border: none;
    border-radius: 0; 
    padding: 0; 
    margin-bottom: 16px; 
    box-shadow: none; 
    contain: layout style paint;
    content-visibility: auto;
    overflow: hidden;
}

.gallery-header { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    padding: 12px 14px 10px; 
    border-bottom: none; 
}

.gallery-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    flex-shrink: 0;
    border: 2px solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(135deg, #F77737, #E1306C, #833AB4);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.gallery-header-info { 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
    min-width: 0; 
    gap: 3px;
}

.gallery-name-row {
    display: flex;
    align-items: center;
    min-width: 0;
}

.gallery-name { 
    font-weight: 700; 
    font-size: 12px; 
    color: var(--gray-900); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    letter-spacing: -0.2px;
}

.gallery-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.gallery-relationship-chip {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f7f3ec;
    color: #7a624a;
    font-size: 9px;
    font-weight: 800;
}

.gallery-date { 
    display: inline-flex;
    align-items: center;
    padding: 2px 5px;
    border-radius: 999px;
    background: #f7f0e6;
    color: #8b7355;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.gallery-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.gallery-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    padding: 0 14px 8px;
}

.gallery-point-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff3d6;
    color: #b55a00;
    font-size: 11px;
    font-weight: 800;
}

.gallery-type-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gallery-type-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f7f3ec;
    color: #6f5d47;
    font-size: 11px;
    font-weight: 700;
}

.gallery-photos { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 2px; 
    margin: 0;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
}

.gallery-photos img { 
    width: 100%; 
    aspect-ratio: 1 / 1; 
    object-fit: cover; 
    cursor: pointer; 
    content-visibility: auto;
    contain: layout style paint;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 0;
    background: #f0f0f0;
    transition: opacity 0.3s ease;
    display: block;
}

.gallery-photos img[src=""],
.gallery-photos img:not([src]) {
    opacity: 0;
}

/* 이미지 로드 실패 시 폴백 UI */
.gallery-photos img.img-error {
    opacity: 1;
    object-fit: contain;
    background: var(--gray-100, #f5f5f5);
    padding: 20%;
    filter: grayscale(1) opacity(0.3);
}

.video-thumb-wrapper {
    position: relative;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
    aspect-ratio: 1 / 1;
}

.video-thumb-wrapper video,
.video-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    /* controls 속성은 JS에서 재생 시점에만 부여 */
}

/* 기본 video controls UI 완전 숨김 (재생 전) */
.video-thumb-wrapper:not(.playing) video::-webkit-media-controls {
    display: none !important;
}
.video-thumb-wrapper:not(.playing) video::-webkit-media-controls-enclosure {
    display: none !important;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.93);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: var(--primary-color);
    pointer-events: none;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.45);
    transition: transform 0.18s ease, opacity 0.18s ease;
    padding-left: 5px;
    z-index: 2;
}

.video-thumb-wrapper:hover .video-play-btn {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
}

.video-thumb-wrapper.playing .video-play-btn {
    display: none;
}

.video-thumb-wrapper.playing {
    cursor: default;
    aspect-ratio: unset;
    grid-column: 1 / -1;
}

.video-thumb-wrapper.playing video {
    height: auto;
    max-height: 400px;
}

/* 갤러리 스켈레톤 로딩 */
.gallery-skeleton {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    margin-bottom: 0;
}

.skeleton-item {
    aspect-ratio: 1 / 1;
    background: linear-gradient(110deg, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 0;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.gallery-card.skeleton-card {
    padding: 0;
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}

.skeleton-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(110deg, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

.skeleton-text {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(110deg, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-text.w60 { width: 60%; }
.skeleton-text.w40 { width: 40%; }

.gallery-actions { 
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    align-items: stretch;
    padding: 10px 0 6px; 
}

.action-btn { 
    background: #fff8f0; 
    border: 1px solid #f3e0c6; 
    border-radius: 14px;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    font-size: 14px; 
    padding: 6px 3px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 2px;
    flex-wrap: nowrap;
    cursor: pointer; 
    color: var(--gray-800); 
    font-weight: 700;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease; 
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}

.action-icon {
    flex: 0 0 auto;
    font-size: 10px;
    line-height: 1;
}

.action-label {
    font-size: 9px;
    font-weight: 700;
    color: #6f5d47;
    line-height: 1;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
}

.action-btn span {
    font-size: 11px;
    color: var(--gray-600);
    font-weight: 700;
}

.action-btn .action-icon,
.action-btn .action-label,
.action-btn .action-count {
    flex-shrink: 0;
}

.action-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: rgba(255, 140, 0, 0.12);
    color: #cc6b00;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.action-count.is-empty {
    display: none;
}

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

.action-btn.active,
.action-btn.reacted { 
    color: #E91E63; 
    border-color: rgba(233, 30, 99, 0.28);
    background: #fff1f6;
}

.action-btn.active span,
.action-btn.reacted span {
    color: #E91E63;
}

.action-btn.active .action-label,
.action-btn.reacted .action-label {
    color: #C2185B;
}

/* 게스트 모드 갤러리 액션 (보기 전용) */
.guest-actions .action-btn,
.guest-actions span.action-btn {
    cursor: default;
    opacity: 1;
}
.guest-actions .action-btn:active,
.guest-actions span.action-btn:active {
    transform: none;
}

.gallery-reaction-summary {
    padding: 0 14px 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.4;
}

.friend-btn { 
    background: none; 
    border: 1px solid var(--primary-color); 
    font-size: 10px; 
    cursor: pointer; 
    color: var(--primary-color); 
    font-weight: 700; 
    padding: 3px 8px; 
    border-radius: 999px; 
    transition: all 0.15s;
    line-height: 1.1;
    min-height: 24px;
    white-space: nowrap;
}

.friend-btn.is-friend {
    border-color: var(--gray-300);
    color: var(--gray-500);
}

.friend-btn.is-pending {
    border-color: #d7cde8;
    background: #f7f2ff;
    color: #6f5ca5;
    cursor: default;
}

.friend-btn.is-incoming {
    background: linear-gradient(135deg, #ffb347, #ff8c00);
    border-color: transparent;
    color: #fff;
}

.friend-btn.is-remove {
    border-color: #ffd7cf;
    background: #fff6f3;
    color: #d15b37;
}

/* 게시물 메뉴 (삭제 등) */
.post-menu-container {
    position: relative;
    margin-left: 4px;
}

.post-menu-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px 5px;
    border-radius: 50%;
    line-height: 1;
    letter-spacing: 1px;
}

.post-menu-btn:hover {
    background: var(--gray-100);
}

.post-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 50;
    overflow: hidden;
    min-width: 100px;
}

.post-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 13px;
    color: #D32F2F;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

.post-menu-dropdown button:hover {
    background: #FFF3F3;
}

/* 새 반응 뱃지 */
.new-reaction-badge {
    display: inline-block;
    background: linear-gradient(135deg, #E91E63, #FF5252);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 빈 상태 */
.gallery-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, #FAFAFA 0%, #F5F5F5 100%);
    border-radius: 16px;
    margin: 8px 0;
}

.empty-emoji {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.6;
}

.empty-actions {
    margin-top: 16px;
}

.empty-action-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #ff9c3f 0%, #ff7b21 100%);
    color: white;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(255, 123, 33, 0.18);
}

/* 주간 베스트 */
#weekly-best-container {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFFDE7 100%);
    border: 1px solid #FFE082;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 0;
}

.gallery-insight-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.gallery-insight-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: #ff8c00;
}

.gallery-insight-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

.gallery-insight-desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #7b6a56;
}

.gallery-insight-note {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: #8b6f4f;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.weekly-best-header {
    font-size: 17px;
    font-weight: 800;
    color: #2b2116;
    margin-bottom: 0;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.weekly-best-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.weekly-best-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.8);
    border-radius: 14px;
    border: 1px solid rgba(255, 224, 178, 0.85);
}

.best-medal {
    font-size: 20px;
    flex-shrink: 0;
}

.best-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
}

.best-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.best-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--gray-100);
}

.best-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.best-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}

.best-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.best-stats {
    font-size: 11px;
    color: var(--gray-500);
}

.best-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff3d6;
    color: #b55a00;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

/* 반응 요약 배너 (인스타그램 스타일) */
.activity-summary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: linear-gradient(135deg, #f8f0ff 0%, #fff0f5 50%, #fffde7 100%);
    border: 1px solid #e8d5f5;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 0;
    box-shadow: 0 10px 24px rgba(156, 39, 176, 0.08);
}

.summary-content {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
}

.summary-label {
    font-size: 13px;
    font-weight: 700;
    color: #7b1fa2;
    white-space: nowrap;
    margin-right: 2px;
}

.summary-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.summary-item {
    font-size: 13px;
    font-weight: 700;
    color: #4b3b52;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(232, 213, 245, 0.95);
}

/* 댓글 섹션 - 인스타그램 스타일 */
.comment-section {
    padding: 0 14px 12px;
}

@media (max-width: 820px) {
    .gallery-hero-title {
        font-size: 24px;
    }

    .gallery-hero-stats,
    .gallery-top-grid {
        grid-template-columns: 1fr;
    }

    .gallery-feed-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-filters {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .gallery-stage {
        gap: 14px;
    }

    .gallery-hero,
    .gallery-feed-shell {
        padding: 0;
        border-radius: 0;
    }

    .gallery-hero-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .gallery-hero-stat {
        padding: 12px 10px;
    }

    .gallery-hero-stat strong {
        font-size: 20px;
    }

    .gallery-share-settings-stack {
        gap: 8px;
    }

    .gallery-feed-heading h3 {
        font-size: 19px;
    }

    .gallery-insight-title-row {
        align-items: flex-start;
    }

    .gallery-post-meta,
    .gallery-header {
        padding-left: 6px;
        padding-right: 6px;
    }

    .gallery-user-filter-clear {
        width: 100%;
    }

    .gallery-actions {
        padding-left: 0;
        padding-right: 0;
    }

    .gallery-photos {
        margin: 0;
    }

    .gallery-feed-toolbar {
        padding: 0 2px;
        margin-bottom: 10px;
    }

    .gallery-card {
        margin-bottom: 14px;
    }

    .gallery-header {
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 8px;
    }

    .gallery-post-meta {
        padding-bottom: 6px;
    }

    .gallery-actions {
        gap: 3px;
        padding-top: 8px;
        padding-bottom: 6px;
    }

    .action-btn {
        min-height: 34px;
        border-radius: 12px;
        padding: 5px 2px;
    }

    .action-label {
        font-size: 8.5px;
        letter-spacing: -0.02em;
    }

    .action-count {
        min-width: 15px;
        height: 15px;
        padding: 0 3px;
        font-size: 8px;
    }

    .comment-section {
        padding-left: 6px;
        padding-right: 6px;
    }
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}

.comment-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    line-height: 1.4;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 700;
    color: var(--gray-900);
    flex-shrink: 0;
    font-size: 12px;
    letter-spacing: -0.2px;
}

.comment-text {
    color: #444;
    word-break: break-word;
}

.comment-time {
    font-size: 10px;
    color: #aaa;
    flex-shrink: 0;
    margin-left: auto;
}

.comment-delete-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.comment-delete-btn:hover {
    color: #e74c3c;
}

.comment-toggle-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 0;
    text-align: left;
    font-weight: 400;
}

.comment-toggle-btn:hover {
    color: #666;
}

.comment-input-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
    border-top: 1px solid var(--gray-100);
    padding-top: 10px;
    margin-top: 4px;
}

.comment-input {
    flex: 1;
    border: 1px solid #f0e0cb;
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 12px;
    outline: none;
    background: #fffaf4;
    transition: border-color 0.2s;
    color: var(--gray-800);
}

.comment-input::placeholder {
    color: var(--gray-400);
}

.comment-input:focus {
    border-color: #ffb86b;
    background: #fff;
}

.comment-submit-btn {
    background: linear-gradient(135deg, #ff9c3f 0%, #ff7b21 100%);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    padding: 9px 12px;
    white-space: nowrap;
    border-radius: 999px;
    opacity: 1;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 16px rgba(255, 123, 33, 0.18);
}

.comment-submit-btn:hover {
    transform: translateY(-1px);
}

.comment-btn {
    margin-left: 0;
}

/* 채팅 배너 */
.chat-banner-fixed { 
    position: fixed; 
    bottom: 70px; 
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 440px;
    padding: 12px 16px;
    background: #FEE500; 
    color: #3C1E1E; 
    text-align: center; 
    font-weight: 700; 
    font-size: 14px;
    cursor: pointer; 
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(254,229,0,0.4); 
    z-index: 45; 
    display: none; 
    box-sizing: border-box; 
    transition: transform 0.12s;
}

.chat-banner-fixed:active {
    transform: translateX(-50%) scale(0.97);
}

/* 카카오톡 배너 배경 (뒤 콘텐츠 가림) */
.chat-banner-fixed::before {
    content: '';
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    height: calc(12px * 2 + 1.5em);
    background-color: var(--bg-color);
    z-index: -1;
}

/* 관리자 피드백 */
#admin-feedback-box { 
    display: none; 
    background-color: #F3E5F5; 
    border: 2px solid #9C27B0; 
    border-radius: 12px; 
    padding: 15px; 
    margin-bottom: 15px; 
    position: relative; 
}

/* 라이트박스 */
#lightbox-modal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.95); 
    z-index: 1000; 
    justify-content: center; 
    align-items: center; 
    flex-direction: column; 
    cursor: pointer; 
}

#lightbox-img { 
    max-width: 90%; 
    max-height: 80vh; 
    object-fit: contain; 
    border-radius: 8px; 
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
}

#lightbox-video {
    display: none;
    width: min(960px, 95vw);
    max-height: 80vh;
    border-radius: 10px;
    background: #000;
    cursor: default;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    font-size: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1001;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

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

#lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    background: rgba(0,0,0,0.5);
    padding: 4px 14px;
    border-radius: 12px;
    z-index: 1001;
}

#share-platform-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1200;
    justify-content: center;
    align-items: flex-end;
    padding: 0;
}
@media (min-width: 600px) {
    #share-platform-modal { align-items: center; padding: 20px; }
}

.share-platform-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    padding: 0 0 env(safe-area-inset-bottom, 16px);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
    animation: shareSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 600px) {
    .share-platform-card { border-radius: 20px; padding-bottom: 20px; }
}
@keyframes shareSlideUp {
    from { transform: translateY(100%); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
}

.share-modal-handle {
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 10px auto 0;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 12px;
}
.share-modal-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.3px;
}
.share-modal-close-x {
    background: var(--gray-100);
    border: none;
    font-size: 20px;
    color: var(--gray-500);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}
.share-modal-close-x:hover { background: var(--gray-200); }

.share-preview-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 20px 16px;
}
.share-preview-img-wrap {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
    border: 2px solid var(--gray-100);
}
.share-preview-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.share-preview-info {
    flex: 1;
    min-width: 0;
}
.share-preview-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 3px;
}
.share-preview-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.share-modal-tip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 20px 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff7ea;
    border: 1px solid #f5dcc0;
    font-size: 11px;
    color: #7a624a;
    line-height: 1.45;
}

.share-modal-tip strong {
    color: #9a4f08;
}

.share-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px 6px;
}

.share-platform-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 0;
    padding: 4px 16px 14px;
}

.share-grid-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 14px;
    transition: background 0.15s, transform 0.12s;
}
.share-grid-btn:hover { background: var(--gray-50); }
.share-grid-btn:active { transform: scale(0.92); }

.share-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transition: transform 0.15s, box-shadow 0.15s;
}
.share-grid-btn:hover .share-icon {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(0,0,0,0.16);
}
.kakao-icon { background: #FEE500; }
.insta-icon { background: linear-gradient(135deg, #833AB4, #E1306C, #F77737); }
.fb-icon { background: #1877F2; }
.x-icon { background: #000; }
.blog-icon { background: #21C531; }

.share-label {
    font-size: 11px;
    color: var(--gray-700);
    font-weight: 600;
}

.share-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 6px 20px 8px;
}
.share-action-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 11px 6px;
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.share-action-pill:hover { background: var(--white); border-color: var(--gray-300); }
.share-action-pill:active { transform: scale(0.96); background: var(--gray-100); }
.share-action-pill svg { flex-shrink: 0; color: var(--gray-500); }

/* PWA 설치 배너 */
#pwa-install-banner {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    width: calc(100% - 28px);
    max-width: 400px;
}
.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 6px 28px rgba(0,0,0,0.18);
    border: 1px solid var(--gray-200);
}
.pwa-install-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
}
.pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.pwa-install-text strong {
    font-size: 14px;
    color: var(--text-color);
}
.pwa-install-text span {
    font-size: 11px;
    color: var(--text-secondary);
}
.pwa-install-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s;
}
.pwa-install-btn:active { transform: scale(0.95); }
.pwa-install-dismiss {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}
.pwa-banner-animate {
    animation: pwaBannerIn 0.4s ease-out;
}
@keyframes pwaBannerIn {
    from { transform: translateX(-50%) translateY(30px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.pwa-banner-fadeout {
    animation: pwaBannerOut 0.5s ease-in forwards;
}
@keyframes pwaBannerOut {
    from { transform: translateX(-50%) translateY(0); opacity: 1; }
    to { transform: translateX(-50%) translateY(30px); opacity: 0; }
}

/* 버튼들 */
.guide-btn { 
    background-color: #E3F2FD; 
    color: #1976D2; 
    border: none; 
    padding: 8px 12px; 
    border-radius: 8px; 
    font-size: 12px; 
    font-weight: bold; 
    cursor: pointer; 
    display: block; 
    width: 100%; 
    max-width: 440px; 
    margin: 0 auto 15px; 
    transition: background 0.2s; 
}

.guide-btn:active { 
    background-color: #BBDEFB; 
}

.pdf-btn { 
    background-color: var(--success-color); 
    color: white; 
    border: none; 
    padding: var(--spacing-md); 
    border-radius: var(--radius-md); 
    font-size: var(--font-base); 
    font-weight: bold; 
    width: 100%; 
    max-width: 440px; 
    margin: 15px auto 0; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: var(--spacing-sm); 
    transition: transform var(--transition-fast), opacity var(--transition-fast); 
}

.pdf-btn:active { 
    transform: scale(0.98); 
    opacity: 0.9; 
}

.pdf-btn-compact {
    margin-top: 0;
    max-width: none;
}

.dashboard-more-tools {
    margin-top: 10px;
    border: 1px solid #EAEAEA;
    border-radius: 14px;
    background: #FCFCFC;
}

.dashboard-more-tools-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 0;
}

.dashboard-more-tools-toggle {
    flex-shrink: 0;
}

.dashboard-more-tools-body {
    padding: 0 12px 12px;
}

.dashboard-more-tools-body[hidden] {
    display: none !important;
}

.dashboard-more-tools .milestone-section {
    margin-bottom: 10px;
}

.dashboard-extra-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.bottom-bar { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    width: 100%; 
    padding: 12px 20px; 
    background-color: white; 
    border-top: 1px solid var(--gray-200); 
    box-sizing: border-box; 
    z-index: 50; 
    display: flex; 
    justify-content: center; 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

@media (min-width: 768px) {
    .bottom-bar {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(600px, calc(100% - 24px));
        border-left: 1px solid var(--gray-200);
        border-right: 1px solid var(--gray-200);
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
    }
}

.submit-bar-inner {
    width: 100%;
    max-width: 440px;
}

.submit-bar-helper {
    margin-bottom: 8px;
    text-align: center;
    font-size: 12px;
    color: #7A7065;
    line-height: 1.5;
}

.submit-btn { 
    width: 100%; 
    max-width: 440px; 
    background: linear-gradient(135deg, #FF8C00 0%, #FF6D00 100%); 
    color: white; 
    border: none; 
    padding: 15px; 
    font-size: 15px; 
    font-weight: 800; 
    border-radius: 14px; 
    cursor: pointer; 
    transition: transform 0.12s, box-shadow 0.15s; 
    box-shadow: 0 4px 14px rgba(255,109,0,0.3); 
    display: block; 
    margin-left: auto; 
    margin-right: auto; 
    letter-spacing: -0.3px;
    text-align: center;
}

.submit-btn:active { 
    transform: scale(0.97); 
    box-shadow: 0 2px 6px rgba(255,109,0,0.2); 
}

/* 토스트 */
#toast { 
    visibility: hidden; 
    min-width: 200px; 
    max-width: 360px; 
    background: rgba(33,33,33,0.92); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    color: var(--white); 
    text-align: center; 
    border-radius: 14px; 
    padding: 14px 20px; 
    position: fixed; 
    z-index: 1300; 
    bottom: 90px; 
    left: 50%; 
    transform: translateX(-50%); 
    font-size: 13px; 
    font-weight: 600; 
    opacity: 0; 
    transition: opacity 0.3s, visibility 0.3s; 
    box-shadow: 0 6px 20px rgba(0,0,0,0.25); 
    letter-spacing: -0.2px;
}

#toast.show { 
    visibility: visible; 
    opacity: 1; 
}

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

.modal-content { 
    background: white; 
    width: 90%; 
    max-width: 380px; 
    border-radius: var(--radius-xl); 
    padding: 25px; 
    box-sizing: border-box; 
    position: relative; 
    animation: fadeIn var(--transition-base); 
    max-height: 80vh; 
    overflow-y: auto; 
}

.guide-modal-content {
    max-width: 430px;
}

.guide-platform {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 10px;
}

.guide-platform h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--text-color);
}

.guide-platform ol {
    margin: 0;
    padding-left: 18px;
    color: var(--gray-700);
    font-size: 13px;
    line-height: 1.6;
}

.guide-tip {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--info-dark);
    background: var(--info-light);
    border: 1px solid var(--info-border);
    border-radius: var(--radius-md);
    padding: 8px 10px;
}

.close-btn { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: none; 
    border: none; 
    font-size: var(--font-3xl); 
    cursor: pointer; 
    color: var(--text-secondary); 
}

/* 대시보드 상단 개편 */
.dashboard-hero-shell {
    margin-bottom: 14px;
}

.dashboard-hero-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255, 211, 140, 0.55) 0%, transparent 30%),
        linear-gradient(145deg, #FFF8E8 0%, #FFFDF5 55%, #EEF7F0 100%);
    border: 1px solid #F3D8AE;
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 12px 30px rgba(233, 163, 54, 0.12);
    margin-bottom: 10px;
    animation: dashboardHeroRise 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dashboard-hero-copy,
.dashboard-hero-stats {
    position: relative;
    z-index: 1;
}

.dashboard-hero-panel::after {
    content: '';
    position: absolute;
    right: -36px;
    bottom: -42px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.14) 0%, transparent 72%);
    pointer-events: none;
}

.dashboard-hero-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.dashboard-hero-topline-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #C56A00;
    text-transform: uppercase;
}

.dashboard-hero-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(229, 164, 88, 0.35);
    color: #A64B00;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-hero-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #2A241B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-hero-body {
    margin: 6px 0 10px;
    font-size: 12px;
    line-height: 1.3;
    color: #6B6256;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-hero-body-shell[hidden] {
    display: none !important;
}

.dashboard-panel-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(229, 164, 88, 0.28);
    background: rgba(255,255,255,0.82);
    color: #8a5a23;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.dashboard-hero-panel.is-collapsed {
    padding-bottom: 12px;
}

.dashboard-action-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-action-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    border: 1px solid rgba(223, 204, 171, 0.9);
    background: rgba(255,255,255,0.72);
    border-radius: 13px;
    padding: 9px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    text-align: left;
}

.dashboard-action-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0,0,0,0.07);
}

.dashboard-action-chip:active {
    transform: scale(0.985);
}

.dashboard-action-chip.is-focus {
    background: linear-gradient(135deg, #FF9A1F 0%, #FF7A00 100%);
    border-color: #FF8A00;
    box-shadow: 0 12px 22px rgba(255, 140, 0, 0.24);
}

.dashboard-action-chip.is-focus .dashboard-action-copy strong,
.dashboard-action-chip.is-focus .dashboard-action-copy span,
.dashboard-action-chip.is-focus .dashboard-action-emoji {
    color: white;
}

.dashboard-action-chip.is-complete {
    background: linear-gradient(135deg, #F0FAF2 0%, #E3F4E6 100%);
    border-color: rgba(76, 175, 80, 0.35);
}

.dashboard-action-chip.is-complete .dashboard-action-copy strong {
    color: #2E7D32;
}

.dashboard-action-chip.is-complete .dashboard-action-copy span {
    color: #4E7D58;
}

.dashboard-action-emoji {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.dashboard-action-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dashboard-action-copy strong {
    font-size: 12px;
    color: #2F2A22;
}

.dashboard-action-copy span {
    font-size: 10px;
    color: #7A7065;
    line-height: 1.35;
}

.dashboard-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
    align-items: start;
    grid-auto-rows: minmax(52px, auto);
    align-content: start;
}

.dashboard-stat-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
    height: 100%;
    aspect-ratio: auto;
    justify-content: flex-start;
    padding: 6px 8px;
    border-radius: 14px;
    background: rgba(255,255,255,0.74);
    border: 1px solid rgba(223, 204, 171, 0.9);
    backdrop-filter: blur(6px);
}

@media (min-width: 768px) {
    .dashboard-hero-panel {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .dashboard-action-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
}

.dashboard-stat-card.accent {
    background: linear-gradient(135deg, #FFF1DA 0%, #FFE1B2 100%);
    border-color: rgba(255, 167, 38, 0.35);
}

.dashboard-stat-label {
    font-size: 9px;
    font-weight: 700;
    color: #8A7D6C;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-stat-value {
    font-size: 16px;
    font-weight: 800;
    color: #27231D;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.dashboard-week-card {
    border: 1px solid #EFE3CC;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF8 100%);
    box-shadow: 0 8px 24px rgba(117, 93, 63, 0.06);
    margin-top: 0;
}

.dashboard-week-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-week-caption {
    margin: 4px 0 0;
    font-size: 12px;
    color: #8D8478;
    line-height: 1.5;
}

.dashboard-week-rate-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #FFF3E0;
    color: #B65A00;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-week-progress-bar {
    position: relative;
    width: 100%;
    height: 10px;
    margin: 14px 0 12px;
    background: #F4EBDD;
    border-radius: 999px;
    overflow: hidden;
}

.dashboard-week-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #FFB347 0%, #FF8C00 55%, #4CAF50 100%);
    transition: width 0.35s ease;
}

.dashboard-week-summary {
    font-size: 13px;
    line-height: 1.6;
    color: #655D52;
    margin-bottom: 6px;
}

@media (max-width: 480px) {
    .dashboard-hero-panel {
        padding: 14px;
        border-radius: 22px;
    }

    .dashboard-hero-title {
        font-size: 18px;
    }

    .dashboard-hero-body {
        font-size: 11px;
    }

    .dashboard-action-strip {
        gap: 6px;
    }

    .dashboard-action-chip {
        padding: 9px 8px;
    }

    .dashboard-action-copy strong {
        font-size: 12px;
    }

    .dashboard-action-copy span,
    .dashboard-week-summary,
    .dashboard-week-caption,
    .mission-card-intro {
        font-size: 11px;
    }

    .dashboard-stat-card {
        padding: 5px 7px;
        border-radius: 13px;
        min-height: 0;
        height: 100%;
    }

    .dashboard-stat-value {
        font-size: 14px;
    }

    .dashboard-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        grid-auto-rows: minmax(48px, auto);
    }
}

@media (max-width: 360px) {
    .dashboard-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .dashboard-stat-card {
        padding: 6px 7px;
        min-height: 0;
        height: 100%;
    }

    .dashboard-stat-label {
        font-size: 9px;
    }

    .dashboard-stat-value {
        font-size: 15px;
    }
}

@media (min-width: 900px) {
    .gallery-insight-title-row {
        flex-wrap: nowrap;
    }

    .weekly-best-header {
        white-space: nowrap;
    }

    .gallery-insight-note {
        flex-shrink: 0;
    }
}

@media (max-width: 600px) {
    .record-flow-head {
        flex-direction: column;
        gap: 6px;
    }

    .record-flow-head-side {
        width: auto;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }

    .record-flow-toggle {
        min-width: 64px;
    }
}

@keyframes dashboardHeroRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 오늘의 인증 현황 카드 */
.today-status-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, #F6FBF6 100%);
    border: 1px solid #DCEBDA;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 0;
    box-shadow: 0 8px 22px rgba(61, 106, 67, 0.06);
}

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

.today-status-title {
    font-size: 15px;
    font-weight: 800;
    color: #2E7D32;
}

.today-streak-badge {
    font-size: 13px;
    font-weight: 600;
    color: #E65100;
    background: rgba(255,255,255,0.8);
    padding: 3px 10px;
    border-radius: 20px;
}

.today-status-cheer {
    font-size: 13px;
    color: #5C6557;
    text-align: center;
    margin-top: 10px;
    padding: 8px 10px;
    background: #F2F8F2;
    border-radius: 12px;
    line-height: 1.4;
}

.today-status-items {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.today-status-item {
    flex: 1;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1px solid #E5EEE2;
    border-radius: 14px;
    padding: 12px 6px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s ease, border-color 0.15s ease;
}

.today-status-item.done {
    background: linear-gradient(180deg, #F3FBF0 0%, #E8F7EA 100%);
    border-color: #CDE7CF;
}

.today-status-item:hover {
    border-color: #CFE0C8;
    box-shadow: 0 8px 18px rgba(0,0,0,0.05);
}

.today-status-item:active {
    transform: scale(0.95);
}

.today-status-icon {
    font-size: 24px;
}

.today-status-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.today-status-item.done .today-status-label {
    color: #2E7D32;
}

/* 마일스톤 뱃지 (컴팩트) */
.milestone-section { 
    background: linear-gradient(135deg, #FFE082 0%, #FDD835 100%); 
    border-radius: var(--radius-lg); 
    padding: 12px; 
    margin-bottom: var(--spacing-lg); 
}

.milestone-title { 
    font-size: 15px; 
    font-weight: bold; 
    color: #F57F17; 
    margin: 0 0 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ms-expand-btn {
    font-size: 11px;
    font-weight: normal;
    color: #795548;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.6);
}

.ms-claimed-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}

.ms-claimable-list {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.badges-grid { 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
}

/* 마일스톤 카드 (카테고리별) - 컴팩트 */
.milestone-card {
    background: rgba(255,255,255,0.92);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ms-spacer {
    flex: 1;
}

.milestone-card-label {
    font-size: 11px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* 완료된 마일스톤 목록 (초소형 뱃지) */
.milestone-completed-list {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.milestone-completed-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
    border-radius: 10px;
    font-size: 10px;
    background: #E8F5E9;
    color: #2E7D32;
}

.milestone-completed-item.done {
    opacity: 0.65;
}

.milestone-completed-item.claimable {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border: 1px solid #FF9800;
    cursor: pointer;
    animation: claimPulse 2s infinite;
}

.milestone-completed-item.claimable:hover {
    transform: scale(1.05);
}

@keyframes claimPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,152,0,0.4); }
    50% { box-shadow: 0 0 6px 1px rgba(255,152,0,0.3); }
}

.ms-sm-name {
    font-weight: 600;
}

.ms-check {
    font-size: 9px;
}

.ms-claim-btn {
    background: #FF9800;
    color: white;
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: bold;
    white-space: nowrap;
}

/* 현재 목표 (컴팩트) */
.milestone-current-target {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border-radius: 8px;
    border: 1px dashed #42A5F5;
    margin-bottom: 5px;
}

.milestone-current-emoji {
    font-size: 18px;
    flex-shrink: 0;
}

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

.milestone-current-name {
    font-size: 10px;
    font-weight: bold;
    color: #1565C0;
}

.milestone-current-desc {
    font-size: 9px;
    color: #666;
    margin-top: 1px;
}

.milestone-all-done {
    text-align: center;
    padding: 6px;
    color: #F57F17;
    font-weight: bold;
    font-size: 11px;
    margin-top: auto;
}

/* ===========================
   챌린지 티어 카드 & 진행 현황
   =========================== */

/* 티어 카드 리스트 */
.challenge-tier-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.challenge-tier-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    cursor: default;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
    position: relative;
}

.tier-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.tier-card-header:active,
.tier-mini:active {
    transform: scale(0.97);
}

.tier-mini {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border: 1px solid #A5D6A7;
}

.tier-weekly {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border: 1px solid #FFCC80;
}

.tier-master {
    background: linear-gradient(135deg, #FBE9E7, #FFCCBC);
    border: 1px solid #FFAB91;
}

.tier-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

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

.tier-name {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.tier-desc {
    font-size: 11px;
    color: #777;
    margin-top: 1px;
}

.tier-stake {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #555;
    flex-shrink: 0;
}

.stake-input {
    width: 38px;
    padding: 4px 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    background: rgba(255,255,255,0.8);
}

/* 챌린지 예치 % 버튼 */
.tier-stake-btns {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding-top: 4px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    margin-top: 2px;
}

.stake-pct-btn {
    padding: 4px 7px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: rgba(255,255,255,0.85);
    font-size: 10px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}

.stake-pct-btn:active {
    background: #FF9800;
    color: #fff;
    border-color: #FF9800;
    transform: scale(0.93);
}

.stake-display {
    font-size: 11px;
    font-weight: 700;
    color: #E65100;
    margin-left: auto;
    white-space: nowrap;
}

.stake-display::after {
    content: ' HBT';
    font-weight: 400;
    color: #999;
    font-size: 10px;
}

.challenge-rules-note {
    margin-top: 10px;
    font-size: 10.5px;
    color: #999;
    text-align: center;
    line-height: 1.5;
}

.challenge-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: background 0.2s;
}

.challenge-toggle-btn:hover {
    background: var(--gray-100);
}

.challenge-toggle-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.challenge-toggle-arrow.open {
    transform: rotate(180deg);
}

body.dark-mode .challenge-toggle-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}

/* 진행 중인 챌린지 카드 */
.active-challenge-card {
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.active-challenge-card:last-child {
    margin-bottom: 0;
}

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

.active-ch-name {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.active-ch-stake {
    font-size: 11px;
    color: #888;
}

.active-ch-dates {
    font-size: 11px;
    color: #999;
    margin-bottom: 6px;
}

.active-ch-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.active-ch-bar-bg {
    flex: 1;
    height: 18px;
    background: #F0F0F0;
    border-radius: 9px;
    overflow: hidden;
}

.active-ch-bar-fill {
    height: 100%;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    font-weight: 700;
    min-width: 28px;
    transition: width 0.5s;
}

.active-ch-count {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

/* 로딩 애니메이션 */
@keyframes loadingBounce { 
    0%, 80%, 100% { transform: scaleY(0.5); opacity: 0.5; } 
    40% { transform: scaleY(1); opacity: 1; } 
}

.loading-spinner { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    padding: 20px 0;
}

.loading-dot { 
    display: inline-block; 
    width: 8px; 
    height: 8px; 
    background: var(--primary-color); 
    border-radius: 50%; 
    animation: loadingBounce 1.4s infinite;
}

.loading-dot:nth-child(2) { 
    animation-delay: 0.2s; 
}

.loading-dot:nth-child(3) { 
    animation-delay: 0.4s; 
}

/* ==========================
   유틸리티 클래스
   ========================== */

/* 간격 유틸리티 */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

/* 텍스트 유틸리티 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-bold { font-weight: bold; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success-color); }
.text-error { color: var(--error-color); }
.text-sm { font-size: var(--font-sm); }
.text-base { font-size: var(--font-base); }
.text-lg { font-size: var(--font-lg); }

/* 플렉스 유틸리티 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* 디스플레이 유틸리티 */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* 배경색 유틸리티 */
.bg-primary { background-color: var(--primary-color); }
.bg-success { background-color: var(--success-light); }
.bg-error { background-color: var(--error-light); }
.bg-warning { background-color: var(--warning-light); }
.bg-gray { background-color: var(--gray-50); }

/* 경계선 유틸리티 */
.border { border: 1px solid var(--border-color); }
.border-primary { border: 1px solid var(--primary-color); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* 그림자 유틸리티 */
.shadow-sm { box-shadow: var(--shadow-light); }
.shadow-md { box-shadow: var(--shadow-medium); }
.shadow-lg { box-shadow: var(--shadow-heavy); }

/* ==========================
   접근성
   ========================== */

/* 접근성: 키보드 포커스 */
button:focus-visible, 
.tab-btn:focus-visible,
.filter-chip:focus-visible,
input:focus-visible,
textarea:focus-visible,
.action-btn:focus-visible {
    outline: 3px solid var(--point-color);
    outline-offset: 2px;
}

.day-circle:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* 접근성: Skip to content */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    text-decoration: none;
    z-index: 9999;
    border-radius: 0 0 var(--radius-md) 0;
    font-weight: bold;
}

.skip-to-content:focus {
    top: 0;
}

/* 접근성: 스크린 리더 전용 텍스트 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 접근성: 고대비 모드 */
@media (prefers-contrast: high) {
    .card,
    .gallery-card,
    .modal-content {
        border: 2px solid var(--gray-900);
    }
    
    button,
    .tab-btn,
    .filter-chip {
        border: 2px solid currentColor;
    }
}

/* ==========================
   반응형 디자인
   ========================== */

/* 모바일 미션 UI (480px 이하) */
@media (max-width: 480px) {
    .mission-badges-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .mission-badge {
        padding: 6px 2px;
        border-radius: 8px;
    }

    .badge-emoji {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .badge-name {
        font-size: 9px;
        line-height: 1.15;
    }

    .badge-desc {
        font-size: 7.5px;
        line-height: 1.15;
    }

    .mission-difficulty-tabs {
        gap: 4px;
    }

    .diff-tab {
        padding: 5px 8px;
        font-size: 11px;
    }

    .group-stat-num {
        font-size: 14px;
    }

    .group-stat-label {
        font-size: 9px;
    }

    .custom-mission-input-row input[type="number"] {
        width: 48px;
        padding: 7px 4px;
        font-size: 12px;
    }

    .custom-mission-input-row button {
        padding: 7px 10px;
        font-size: 11px;
    }

    .mission-overall-status {
        padding: 10px;
    }

    .overall-rate {
        font-size: 12px;
    }

    .overall-stats {
        gap: 12px;
        font-size: 11px;
    }

    .week-report-card {
        padding: 12px;
    }

    .week-report-card h4 {
        font-size: 13px;
    }
}

/* 매우 작은 화면 (360px 이하) */
@media (max-width: 360px) {
    .mission-badges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .badge-emoji {
        font-size: 24px;
    }

    .badge-name {
        font-size: 11px;
    }

    .badge-desc {
        font-size: 9px;
    }

    .group-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .group-stat-item {
    }
}

/* 매우 작은 화면 (320px 이하) */
@media (max-width: 320px) {
    .header h1 {
        min-width: 4.5em;
        max-width: 46%;
        font-size: 14px;
    }

    .date-selector-container {
        min-width: 78px;
        padding: 4px 6px;
    }

    .date-input {
        font-size: 12px;
    }

    .card { 
        padding: var(--spacing-md); 
    }
    
    .input-grid { 
        grid-template-columns: 1fr; 
    }
    
    .gallery-photos { 
        grid-template-columns: repeat(3, 1fr); 
        justify-content: center;
    }
    
    .badges-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .share-card-capture {
        max-width: 100%;
    }
}

/* 큰 화면 (480px 이상) */
@media (min-width: 481px) {
    .gallery-photos { 
        grid-template-columns: repeat(3, 1fr); 
        justify-content: flex-start;
    }
    
    .input-grid.four-col { 
        grid-template-columns: repeat(4, 1fr); 
    }
    
    .badges-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

/* 태블릿 이상 (768px 이상) */
@media (min-width: 768px) {
    .app-container { 
        max-width: 600px; 
    }
    
    .gallery-photos { 
        grid-template-columns: repeat(3, 1fr); 
    }
    
    .share-card-capture {
        max-width: 368px;
    }
}

/* 다크모드 토글 버튼 */
.dark-mode-toggle {
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.dark-mode-toggle:active {
    transform: scale(0.9);
}
body.dark-mode .dark-mode-toggle {
    border-color: #3A3540;
}

/* ==========================
   다크모드 (opt-in: body.dark-mode)
   ========================== */
body.dark-mode {
    /* 기본 색상 — 따뜻한 다크 */
    --primary-color: #FFB74D;
    --secondary-color: #81C784;
    --bg-color: #17151A;
    --text-color: #E8E4DF;
    --border-color: #352F2A;
    --point-color: #64B5F6;

    /* 상태 색상 */
    --success-color: #66BB6A;
    --success-light: #1E2E1E;
    --success-dark: #81C784;
    --error-color: #EF5350;
    --error-light: #2E1C1C;
    --error-border: #5C2E2E;
    --error-dark: #EF9A9A;
    --warning-color: #FFA726;
    --warning-light: #2E2518;
    --warning-border: #5C4A2E;
    --info-color: #42A5F5;
    --info-light: #1A2636;
    --info-border: #2E4A6A;
    --info-dark: #90CAF9;

    /* 그레이스케일 — 따뜻한 톤 */
    --white: #1D1B20;
    --gray-50: #242128;
    --gray-100: #2B2830;
    --gray-200: #3A3540;
    --gray-300: #4A4452;
    --gray-400: #6D6878;
    --gray-500: #8E8998;
    --gray-600: #A8A3B0;
    --gray-700: #C0BCC6;
    --gray-800: #D8D4DC;
    --gray-900: #ECE8F0;
    --text-secondary: #A09AAA;
    --text-tertiary: #8A8494;
    --text-disabled: #5A5464;

    /* 특수 색상 */
    --purple: #B388FF;
    --pink-light: #3A2030;
    --blue-light: #1A2636;
    --green-tint: #1E2E1E;

    /* 그림자 */
    --shadow-light: 0 2px 8px rgba(0,0,0,0.35);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.45);
    --shadow-heavy: 0 8px 24px rgba(0,0,0,0.55);
    --shadow-primary: 0 2px 8px rgba(255,183,77,0.15);
    --shadow-primary-hover: 0 4px 14px rgba(255,183,77,0.25);

    background-color: var(--bg-color);
}

body.dark-mode .app-container {
    background-color: var(--white);
    box-shadow: none;
}

/* 로그인 모달 */
body.dark-mode #login-modal {
    background: linear-gradient(160deg, #1F1A14 0%, #1D1B20 40%, #1A1518 100%);
}

body.dark-mode .google-btn {
    background-color: #2B2830;
    color: var(--text-color);
    border-color: #3A3540;
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

body.dark-mode .guest-btn:hover { background: rgba(255,255,255,0.05); }

body.dark-mode .webview-warning-box {
    background: #2E2518;
    border-color: #5C4A2E;
}

/* 헤더 */
body.dark-mode .header {
    background-color: var(--white);
    border-bottom-color: var(--border-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

body.dark-mode .date-selector-container {
    background-color: #1E2A1E;
}
body.dark-mode .date-input { color: #81C784; }

body.dark-mode .point-badge {
    background: linear-gradient(135deg, #1A2636 0%, #1E3048 100%);
    border-color: #3A6090;
    color: #90CAF9;
    box-shadow: 0 2px 6px rgba(66,165,245,0.12);
}

/* 탭 메뉴 */
body.dark-mode .tab-menu {
    background-color: var(--white);
    border-bottom-color: var(--border-color);
}

/* 카드 */
body.dark-mode .card {
    box-shadow: 0 1px 6px rgba(0,0,0,0.18);
}
body.dark-mode .card.metrics-card {
    border-color: #2E4A6A;
    background: linear-gradient(to right, var(--white), #1A2636);
}

/* 입력 */
body.dark-mode input[type="number"],
body.dark-mode input[type="text"],
body.dark-mode textarea {
    background-color: #242128;
    color: var(--text-color);
    border-color: var(--border-color);
}

body.dark-mode input[type="date"] { color-scheme: dark; }

/* 업로드 영역 */
body.dark-mode .upload-area {
    border-color: #3A3540;
    background-color: #242128;
}
body.dark-mode .upload-area:hover {
    border-color: var(--primary-color);
    background: #2E2518;
}

/* 운동 블록 */
body.dark-mode .exercise-block {
    background: var(--gray-50);
    border-color: var(--border-color);
}

/* 주간 그래프 */
body.dark-mode .day-circle {
    background-color: #3A3540;
    color: #8A8494;
}

/* 퀘스트 보드 */
body.dark-mode .quest-board {
    background: linear-gradient(135deg, #1A2636 0%, #1E3048 100%);
    border-color: #2E4A6A;
}
body.dark-mode .quest-item { color: #90CAF9; }

/* 공유 카드 */
body.dark-mode .share-card-container {
    background: linear-gradient(145deg, #2E2518 0%, #332A15 100%);
    border-color: #5C4A2E;
}
body.dark-mode .share-card-capture {
    background: linear-gradient(145deg, #2E2518 0%, #382E1C 40%, #403420 100%);
    border-color: #5C4A2E;
}
body.dark-mode .share-brand-mark,
body.dark-mode .share-val,
body.dark-mode .share-footer-mark {
    background: rgba(255,255,255,0.08);
    border-color: #5C4A2E;
    color: #FFD28D;
}
body.dark-mode .share-title { color: #FFF0D4; }
body.dark-mode .share-subtitle,
body.dark-mode .share-footer { color: #D5C2A8; }
body.dark-mode .share-tag {
    background: rgba(255,255,255,0.06);
    border-color: #5C4A2E;
    color: #E8CFA6;
}
body.dark-mode .share-empty-state {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255, 183, 77, 0.22);
}
body.dark-mode .share-empty-state strong { color: #FFF0D4; }
body.dark-mode .share-empty-state span { color: #C7B79C; }
body.dark-mode .share-media-thumb {
    background: linear-gradient(145deg, #46331F 0%, #332716 100%);
    border-color: #5C4A2E;
}
body.dark-mode .share-media-chip {
    background: rgba(34, 25, 16, 0.84);
    color: #FFD28D;
}
body.dark-mode .share-media-play-badge {
    background: rgba(12, 10, 8, 0.7);
}

/* 갤러리 */
body.dark-mode .gallery-card { border-bottom-color: var(--border-color); }
body.dark-mode .gallery-avatar {
    background-image: linear-gradient(#1D1B20, #1D1B20), linear-gradient(135deg, #F77737, #E1306C, #833AB4);
}
body.dark-mode .gallery-relationship-chip {
    background: rgba(255,255,255,0.06);
    color: #D5C4B0;
}
body.dark-mode .gallery-photos { background: #2B2830; }
body.dark-mode .gallery-photos img { background: #242128; }
body.dark-mode .comment-text { color: #C0BCC6; }
body.dark-mode .comment-input { color: var(--text-color); }

/* 채팅 배너 */
body.dark-mode .chat-banner-fixed {
    background: #D4C800;
    color: #1D1B20;
}
body.dark-mode .chat-banner-fixed::before { background-color: var(--bg-color); }

/* 관리자 피드백 */
body.dark-mode #admin-feedback-box {
    background-color: #281E32;
    border-color: #7E52A0;
}

/* 라이트박스 */
body.dark-mode #lightbox-modal { background: rgba(0,0,0,0.95); }

/* 공유 플랫폼 모달 */
body.dark-mode .share-platform-card { background: var(--white); }
body.dark-mode .share-modal-close-x { background: #2B2830; color: #A8A3B0; }
body.dark-mode .share-modal-close-x:hover { background: #3A3540; }
body.dark-mode .share-preview-img-wrap { border-color: #3A3540; }
body.dark-mode .share-modal-tip {
    background: rgba(255,255,255,0.05);
    border-color: #3A3540;
    color: #C9B39A;
}
body.dark-mode .share-modal-tip strong { color: #FFD8A8; }
body.dark-mode .share-action-pill {
    border-color: #3A3540;
    background: #242128;
    color: #C0BCC6;
}
body.dark-mode .share-action-pill:hover {
    background: #2B2830;
    border-color: #4A4452;
}

/* 하단바 */
body.dark-mode .bottom-bar {
    background-color: var(--white);
    border-top-color: var(--border-color);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
}

/* 토스트 */
body.dark-mode #toast {
    background: rgba(44,40,48,0.95);
    color: #E8E4DF;
    border: 1px solid #3A3540;
}

/* 모달 */
body.dark-mode .modal-content { background: var(--white); }
body.dark-mode .guide-platform { background: #242128; border-color: #3A3540; }
body.dark-mode .guide-tip { background: var(--info-light); border-color: var(--info-border); }

/* 오늘의 인증 현황 - 다크모드 */
body.dark-mode .today-status-card {
    background: linear-gradient(180deg, #1F2622 0%, #1A231F 100%);
    border-color: #314236;
}
body.dark-mode .today-status-title { color: #81C784; }
body.dark-mode .today-streak-badge { color: #FFB74D; background: rgba(255,255,255,0.1); }
body.dark-mode .today-status-cheer { color: #fff; background: rgba(255,255,255,0.08); }
body.dark-mode .today-status-item {
    background: rgba(255,255,255,0.03);
    border-color: #38453B;
}
body.dark-mode .today-status-label { color: #B0B0B0; }
body.dark-mode .today-status-item.done {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(129, 199, 132, 0.4);
}
body.dark-mode .dashboard-panel-toggle {
    background: rgba(255,255,255,0.05);
    border-color: #43372f;
    color: #FFCC80;
}
body.dark-mode .dashboard-hero-panel {
    background:
        radial-gradient(circle at top right, rgba(255, 167, 38, 0.14) 0%, transparent 30%),
        linear-gradient(145deg, #241E18 0%, #1D1B20 55%, #18231B 100%);
    border-color: #4F3E2A;
    box-shadow: 0 16px 30px rgba(0,0,0,0.28);
}
body.dark-mode .dashboard-hero-kicker { color: #FFB74D; }
body.dark-mode .dashboard-hero-pill {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,183,77,0.18);
    color: #FFCC80;
}
body.dark-mode .dashboard-hero-title { color: #F5EFE7; }
body.dark-mode .dashboard-hero-body { color: #B6AEA4; }
body.dark-mode .dashboard-action-chip {
    background: rgba(255,255,255,0.04);
    border-color: #3D3530;
}
body.dark-mode .dashboard-action-chip:hover { box-shadow: 0 12px 18px rgba(0,0,0,0.16); }
body.dark-mode .dashboard-action-chip.is-focus {
    background: linear-gradient(135deg, #D97706 0%, #C65A00 100%);
    border-color: #E68A00;
}
body.dark-mode .dashboard-action-chip.is-complete {
    background: linear-gradient(135deg, rgba(76,175,80,0.12) 0%, rgba(46,125,50,0.2) 100%);
    border-color: rgba(129,199,132,0.22);
}
body.dark-mode .dashboard-action-copy strong { color: #ECE6DD; }
body.dark-mode .dashboard-action-copy span { color: #AAA3A0; }
body.dark-mode .dashboard-stat-card {
    background: rgba(255,255,255,0.04);
    border-color: #403731;
}
body.dark-mode .dashboard-stat-card.accent {
    background: linear-gradient(135deg, rgba(255,167,38,0.12) 0%, rgba(255,111,0,0.22) 100%);
    border-color: rgba(255,183,77,0.22);
}
body.dark-mode .dashboard-stat-label { color: #B09E8A; }
body.dark-mode .dashboard-stat-value { color: #F5EFE7; }
body.dark-mode .dashboard-week-card {
    background: linear-gradient(180deg, #201D22 0%, #1B1A1F 100%);
    border-color: #3B363E;
}
body.dark-mode .dashboard-week-caption,
body.dark-mode .dashboard-week-summary {
    color: #A8A3B0;
}
body.dark-mode .dashboard-week-rate-pill {
    background: rgba(255,183,77,0.12);
    color: #FFCC80;
}
body.dark-mode .dashboard-week-progress-bar { background: #322C2F; }
body.dark-mode .mission-card-enhanced {
    border-color: #2F425C !important;
    background: linear-gradient(180deg, #1D2028 0%, #1A212C 100%) !important;
}
body.dark-mode .mission-focus-strip {
    background: linear-gradient(135deg, #182231 0%, #1A2735 100%);
    border-color: #2D4A63;
}
body.dark-mode .mission-focus-kicker { color: #7DC3FF; }
body.dark-mode .mission-focus-title { color: #E8EEF5; }
body.dark-mode .mission-focus-btn {
    background: linear-gradient(135deg, #2B8DFF 0%, #2378D8 100%);
    box-shadow: 0 10px 20px rgba(28, 104, 190, 0.24);
}
body.dark-mode .mission-focus-tag {
    background: #222A35;
    border-color: #334457;
    color: #B7C3D2;
}
body.dark-mode .mission-card-intro { color: #A09AAA; }
body.dark-mode .mission-progress-topline {
    background: #1D2630;
    border-color: #324455;
}
body.dark-mode .mission-progress-pill {
    background: #202933;
    border-color: #324455;
    color: #B7C3D2;
}
body.dark-mode .mission-progress-pill.is-warning {
    background: #312719;
    border-color: #5B4628;
    color: #FFB74D;
}
body.dark-mode .mission-secondary-btn {
    background: #202933;
    border-color: #324455;
    color: #B7C3D2;
}
body.dark-mode .mission-progress-detail-list-plain {
    background: #191F27;
    border-color: #2C3947;
}

/* 마일스톤 */
body.dark-mode .milestone-section {
    background: linear-gradient(135deg, #302518 0%, #3A2E1C 100%);
}
body.dark-mode .milestone-title { color: #FFB74D; }
body.dark-mode .ms-expand-btn { color: #BCAAA4; background: rgba(255,255,255,0.1); }
body.dark-mode .milestone-card {
    background: rgba(29,27,32,0.92);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
body.dark-mode .milestone-card-label { color: #D8D4DC; border-bottom-color: #3A3540; }
body.dark-mode .milestone-completed-item { background: #1E2E1E; color: #81C784; }
body.dark-mode .milestone-current-target {
    background: linear-gradient(135deg, #1A2636, #1E3048);
    border-color: #2E4A6A;
}
body.dark-mode .milestone-current-name { color: #90CAF9; }
body.dark-mode .milestone-current-desc { color: #A09AAA; }

/* 챌린지 티어 */
body.dark-mode .tier-mini {
    background: linear-gradient(135deg, #1E2E1E, #223022);
    border-color: #3A6A3A;
}
body.dark-mode .tier-weekly {
    background: linear-gradient(135deg, #2E2518, #302718);
    border-color: #5C4A2E;
}
body.dark-mode .tier-master {
    background: linear-gradient(135deg, #2E1C1C, #321E1A);
    border-color: #5C3030;
}
body.dark-mode .tier-name { color: #D8D4DC; }
body.dark-mode .tier-desc { color: #A09AAA; }
body.dark-mode .stake-input {
    background: rgba(0,0,0,0.2);
    border-color: #4A4452;
    color: #D8D4DC;
}

/* 진행 중인 챌린지 */
body.dark-mode .active-challenge-card { background: #242128; border-color: #3A3540; }
body.dark-mode .active-ch-bar-bg { background: #3A3540; }

/* 버튼 */
body.dark-mode .guide-btn {
    background-color: var(--info-light);
    color: #90CAF9;
}
body.dark-mode .guide-btn:active { background-color: #1E3048; }
body.dark-mode .add-btn {
    background: #1E2E1E;
    border-color: #3A6A3A;
    color: #81C784;
}
body.dark-mode .add-btn:active { background: #2A3E2A; }

/* HBT 변환 버튼 */
body.dark-mode .hbt-convert-btn {
    background: linear-gradient(135deg, #E68A00 0%, #CC6600 100%);
    box-shadow: 0 3px 10px rgba(230,138,0,0.25);
}
body.dark-mode .hbt-convert-btn.hbt-convert-big {
    background: linear-gradient(135deg, #7C4DFF 0%, #6200EA 100%);
    box-shadow: 0 3px 10px rgba(124,77,255,0.25);
}

/* 지갑 탭 다크모드 */
body.dark-mode .wallet-asset-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
body.dark-mode .wallet-asset-card::before {
    background: radial-gradient(circle, rgba(255,140,0,0.12) 0%, transparent 70%);
}
body.dark-mode .wallet-asset-item {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode .wallet-onchain-badge {
    background: rgba(76,175,80,0.2);
    color: #81C784;
    border-color: rgba(76,175,80,0.3);
}
body.dark-mode .wallet-info-card {
    background: #1E1E2E;
    border-color: #333;
}
body.dark-mode .wallet-address-box {
    background: #161622;
    border-color: #333;
}
body.dark-mode .wallet-address-text { color: #ccc; }
body.dark-mode .wallet-addr-btn {
    background: #2A2A3A;
    border-color: #444;
    color: #ccc;
}
body.dark-mode .wallet-link-btn {
    background: #2A2A3A;
    border-color: #444;
    color: #ccc;
}
body.dark-mode .wallet-convert-card {
    background: #1E1E2E;
    border-color: #333;
}
body.dark-mode .wallet-convert-input {
    background: #161622;
    border-color: #444;
    color: #eee;
}
body.dark-mode .wallet-preset-btn {
    background: #2A2A3A;
    border-color: #444;
    color: #ccc;
}
body.dark-mode .wallet-tx-card {
    background: #1E1E2E;
    border-color: #333;
}
body.dark-mode .wallet-tx-item { border-color: #333; }
body.dark-mode .wallet-tx-label { color: #ddd; }
body.dark-mode .wallet-tx-amount { color: #eee; }
body.dark-mode .wallet-tx-section + .wallet-tx-section { border-top-color: rgba(255,255,255,0.08); }
body.dark-mode .wallet-tx-section-title { color: #f3c38a; }
body.dark-mode .wallet-tx-subempty { color: #b79f84; }
body.dark-mode .wallet-halving-card {
    background: linear-gradient(135deg, #2A2215 0%, #332A15 100%);
}
body.dark-mode .wallet-network-badge {
    background: #1E2E1E;
    color: #81C784;
}

/* 저장 버튼 */
body.dark-mode .submit-btn {
    background: linear-gradient(135deg, #E68A00 0%, #CC6600 100%);
    box-shadow: 0 4px 14px rgba(230,138,0,0.25);
}

/* PWA 배너 */
body.dark-mode .pwa-install-content {
    background: var(--white);
    border-color: #3A3540;
    box-shadow: 0 6px 28px rgba(0,0,0,0.4);
}

/* 식단 AI */
body.dark-mode .diet-ai-btn {
    background: linear-gradient(135deg, #1E2E1E, #223022);
    border-color: #3A6A3A;
    color: #81C784;
}
body.dark-mode .diet-ai-btn.loading { background: #2B2830; color: #6D6878; }

/* 30일 결과지 */
body.dark-mode .report-container { background: var(--white); }
body.dark-mode .report-header {
    background: linear-gradient(135deg, #E68A00 0%, #CC7700 100%);
}
body.dark-mode .report-section-title {
    color: #D8D4DC;
    border-bottom-color: #FFB74D;
}
body.dark-mode .report-stat-card {
    background: #2E2518;
    border-color: #5C4A2E;
}
body.dark-mode .report-stat-value { color: #FFB74D; }
body.dark-mode .report-stat-label { color: #A09AAA; }
body.dark-mode .report-cat-card { background: #242128; }
body.dark-mode .report-cat-name { color: #D8D4DC; }
body.dark-mode .report-metric-summary { color: #C0BCC6; border-bottom-color: #3A3540; }
body.dark-mode .report-btn-close { background: #3A3540; color: #D8D4DC; }
body.dark-mode .report-actions { border-top-color: #3A3540; }

/* 반응 요약 */
body.dark-mode .activity-summary {
    background: linear-gradient(135deg, #281E32 0%, #2E1C28 50%, #2E2518 100%);
    border-color: #4A3060;
}
body.dark-mode .gallery-insight-kicker { color: #FFB74D; }
body.dark-mode .gallery-insight-desc { color: #B9ADA0; }
body.dark-mode .gallery-insight-note {
    background: rgba(255,255,255,0.06);
    color: #C0AC96;
}
body.dark-mode .summary-label { color: #CE93D8; }
body.dark-mode .summary-item {
    background: rgba(255,255,255,0.06);
    border-color: #4A3060;
    color: #E7D9F5;
}
body.dark-mode .gallery-hero {
    background:
        radial-gradient(circle at top left, rgba(255, 183, 77, 0.12), transparent 36%),
        linear-gradient(135deg, #262018 0%, #211c17 55%, #1f1a16 100%);
    border-color: #4e3b28;
}
body.dark-mode .gallery-hero-kicker,
body.dark-mode .gallery-feed-kicker { color: #FFB74D; }
body.dark-mode .gallery-hero-title,
body.dark-mode .gallery-feed-heading h3 { color: #F4EEE6; }
body.dark-mode .gallery-hero-desc,
body.dark-mode .gallery-feed-heading p { color: #B9ADA0; }
body.dark-mode .gallery-privacy-note {
    background: rgba(255,255,255,0.04);
    border-color: #43372f;
}
body.dark-mode .gallery-privacy-badge {
    background: rgba(255, 183, 77, 0.12);
    color: #FFCC80;
}
body.dark-mode .gallery-privacy-text { color: #C9B39A; }
body.dark-mode .gallery-guide-toggle {
    background: rgba(255,255,255,0.05);
    border-color: #43372f;
    color: #FFCC80;
}
body.dark-mode .gallery-hero-action {
    background: rgba(255,255,255,0.04);
    border-color: #43372f;
    color: #E8DED2;
}
body.dark-mode .gallery-hero-action-step {
    background: rgba(255,255,255,0.08);
}
body.dark-mode .gallery-hero-action-text span {
    color: #B9ADA0;
}
body.dark-mode .gallery-hero-action.primary {
    background: linear-gradient(135deg, #D97706 0%, #C65A00 100%);
    border-color: #D97706;
    color: white;
}
body.dark-mode .gallery-hero-action.primary .gallery-hero-action-text span {
    color: rgba(255,255,255,0.84);
}
body.dark-mode .gallery-hero-stat {
    background: rgba(255,255,255,0.04);
    border-color: #40352e;
}
body.dark-mode .gallery-hero-stat strong { color: #FFF3E0; }
body.dark-mode .gallery-hero-stat span { color: #C0AC96; }
body.dark-mode .gallery-feed-shell {
    background: transparent;
    border-color: transparent;
}
body.dark-mode .gallery-user-filter-bar {
    background: #2E2518;
    border-color: #5C4A2E;
}
body.dark-mode #gallery-user-filter-label,
body.dark-mode .gallery-user-filter-clear { color: #FFB74D; }
body.dark-mode .gallery-user-filter-kicker {
    background: rgba(255,255,255,0.06);
    color: #FFD18A;
}
body.dark-mode .gallery-user-filter-clear {
    background: rgba(255,255,255,0.06);
    border-color: #5C4A2E;
}
body.dark-mode .gallery-card {
    background: #211f25;
    border-color: transparent;
    box-shadow: none;
}
body.dark-mode .action-btn {
    background: #2A2520;
    border-color: #43372f;
    color: #E7DED3;
}
body.dark-mode .action-label { color: #C8B8A8; }
body.dark-mode .gallery-point-badge {
    background: rgba(255, 183, 77, 0.12);
    color: #FFCC80;
}
body.dark-mode .gallery-type-chip {
    background: #2B2830;
    color: #C0BCC6;
}
body.dark-mode .comment-input {
    background: #26222a;
    border-color: #3A3540;
    color: #E8E4DF;
}
body.dark-mode .comment-input:focus {
    border-color: #FFB74D;
    background: #211f25;
}
body.dark-mode .comment-submit-btn {
    background: linear-gradient(135deg, #D97706 0%, #C65A00 100%);
    box-shadow: 0 8px 16px rgba(217, 119, 6, 0.2);
}

/* 스켈레톤 */
body.dark-mode .skeleton-item,
body.dark-mode .skeleton-avatar,
body.dark-mode .skeleton-text {
    background: linear-gradient(110deg, #242128 8%, #2B2830 18%, #242128 33%);
    background-size: 200% 100%;
}

/* 스마트 업로드 박스 */
body.dark-mode .smart-upload-box {
    background: linear-gradient(135deg, #2E2518 0%, #302718 100%);
    border-color: #5C4A2E;
}

/* 필터 칩 */
body.dark-mode .filter-chip {
    background: var(--gray-50);
    color: var(--gray-500);
    border-color: var(--gray-200);
}
body.dark-mode .filter-chip.active {
    background: var(--primary-color);
    color: #1D1B20;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(255,183,77,0.2);
}

/* 미션 레벨 */
body.dark-mode .mission-level {
    background: #4A2880;
    color: #D8D4DC;
}

/* 인라인 밝은 배경 카드 다크모드 오버라이드 */
body.dark-mode .card-blood-test {
    background: linear-gradient(to right, #2E1C1C, #331E1E) !important;
    border-color: #5C2E2E !important;
}
body.dark-mode .card-blood-test h3 { color: #EF9A9A !important; }

body.dark-mode .card-invite {
    background: linear-gradient(135deg, #2E2518, #332A15) !important;
    border-color: #5C4A2E !important;
}
body.dark-mode .card-invite h3 { color: #FFB74D !important; }
body.dark-mode .card-invite p { color: #A09AAA !important; }

body.dark-mode .card-fasting {
    background: linear-gradient(to right, #1A2636, #1E3048) !important;
    background-color: #1A2636 !important;
    border-color: #2E4A6A !important;
}

/* 업로드 CTA 다크모드 */
body.dark-mode .upload-cta {
    background: linear-gradient(135deg, #1E2E1E 0%, #281E32 100%);
    border-color: #3A6A3A;
}
body.dark-mode .upload-cta:active {
    background: linear-gradient(135deg, #223022 0%, #302438 100%);
}
body.dark-mode .upload-cta-text strong { color: #81C784; }
body.dark-mode .upload-cta-text span { color: #A09AAA; }
body.dark-mode .upload-cta-arrow { color: #81C784; }
body.dark-mode .record-flow-card {
    background: linear-gradient(135deg, #231F1B 0%, #1D2128 100%);
    border-color: #403831;
    box-shadow: 0 14px 24px rgba(0,0,0,0.2);
}
body.dark-mode .record-flow-kicker { color: #FFB74D; }
body.dark-mode .record-flow-card h3 { color: #F2ECE4; }
body.dark-mode .record-flow-card p { color: #A9A19A; }
body.dark-mode .record-flow-badge {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,183,77,0.2);
    color: #FFCC80;
}
body.dark-mode .record-flow-toggle {
    background: rgba(255,255,255,0.05);
    border-color: #4A423A;
    color: #FFCC80;
}
body.dark-mode .record-flow-btn {
    background: rgba(255,255,255,0.04);
    border-color: #4A423A;
    color: #E0D8D0;
}
body.dark-mode .record-flow-btn.primary {
    background: linear-gradient(135deg, #D97706 0%, #C65A00 100%);
    color: white;
}
body.dark-mode .submit-bar-helper { color: #A59DA8; }

/* 인라인 팁 박스 다크모드 */
body.dark-mode .tip-box {
    background: rgba(0,0,0,0.25) !important;
    color: #A09AAA !important;
}

/* 관리자 피드백 인라인 색상 */
body.dark-mode #admin-feedback-box div[style*="color: #4A148C"] { color: #CE93D8 !important; }
body.dark-mode #admin-feedback-box div[style*="color: #333"] { color: #D8D4DC !important; }

/* ───────────────────────────────
   대사건강 점수 카드 다크모드
   ─────────────────────────────── */
body.dark-mode .metabolic-score-card {
    background: linear-gradient(135deg, #1E2E1E 0%, #1A2A1E 100%);
}
body.dark-mode .metabolic-score-card h3 { color: #81C784; }
body.dark-mode .ms-circle circle[stroke="#E0E0E0"] { stroke: #3A3540; }
body.dark-mode .ms-area-label { color: #C0BCC6; }
body.dark-mode .ms-area-val { color: #A09AAA; }
body.dark-mode .ms-area-bar-bg { background: rgba(255,255,255,0.12); }
body.dark-mode .ms-area-missing .ms-area-need { color: #A09AAA; }
body.dark-mode .ms-area-missing .ms-area-label { color: #6D6878; }
body.dark-mode .ms-circle-label { color: #A09AAA; }
body.dark-mode .ms-partial-note {
    background: rgba(0,0,0,0.25);
    color: #A09AAA;
}
body.dark-mode .ms-insight-item {
    background: rgba(0,0,0,0.2);
    color: #D8D4DC;
}

/* ───────────────────────────────
   식단 AI 분석 결과 다크모드
   ─────────────────────────────── */
body.dark-mode .diet-analysis-card {
    background: #242128;
    border-color: #3A3540;
}
body.dark-mode .diet-grade-label { color: #A09AAA; }
body.dark-mode .diet-grade-summary { color: #D8D4DC; }
body.dark-mode .diet-natural-ratio { color: #C0BCC6; }
body.dark-mode .diet-ratio-bar-bg { background: #3A3540; }
body.dark-mode .diet-ratio-val { color: #81C784; }
body.dark-mode .diet-food-item { background: #1D1B20; }
body.dark-mode .diet-food-name { color: #D8D4DC; }
body.dark-mode .diet-food-cat[data-cat="natural"] {
    background: #1E2E1E; color: #81C784;
}
body.dark-mode .diet-food-cat[data-cat="processed"] {
    background: #2E2518; color: #FFB74D;
}
body.dark-mode .diet-food-cat[data-cat="ultraprocessed"] {
    background: #2E1C1C; color: #EF9A9A;
}
body.dark-mode .diet-scores-title { color: #8E8998; }
body.dark-mode .diet-score-label { color: #C0BCC6; }
body.dark-mode .diet-score-bar-bg { background: #3A3540; }
body.dark-mode .diet-score-val { color: #A09AAA; }
body.dark-mode .diet-insight-box {
    background: linear-gradient(135deg, #1E2E1E, #1A2A1E);
    border-color: #2E4A2E;
}
body.dark-mode .diet-insight-label { color: #81C784; }
body.dark-mode .diet-insight-text { color: #D8D4DC; }
body.dark-mode .diet-suggestion-box {
    background: #2E2518;
    border-color: #5C4A2E;
    color: #FFB74D;
}

/* 오늘의 식단 총평 다크모드 */
body.dark-mode .diet-day-summary {
    background: #242128;
    box-shadow: 0 1px 6px rgba(0,0,0,0.18);
}
body.dark-mode .diet-day-stats { color: #C0BCC6; }

/* ───────────────────────────────
   미션 관련 다크모드
   ─────────────────────────────── */
body.dark-mode .mission-warning {
    background: #2E2518;
    border-color: #5C4A2E;
    color: #FFB74D;
}
body.dark-mode .reset-mission-btn {
    background-color: #1D1B20 !important;
    color: #8E8998 !important;
    border: 1px solid #2B2830 !important;
}

/* 미션 배지 다크모드 */
body.dark-mode .mission-badges-title { color: #D8D4DC; }
body.dark-mode .mission-badge.earned {
    background: linear-gradient(135deg, #2E2518 0%, #332A15 100%);
    border-color: #5C4A2E;
}
body.dark-mode .mission-badge.locked {
    background: #242128;
    border-color: #3A3540;
}
body.dark-mode .badge-name { color: #D8D4DC; }
body.dark-mode .badge-desc { color: #8E8998; }

/* 그룹 챌린지 / 커뮤니티 현황 다크모드 */
body.dark-mode .community-dashboard-card {
    background: linear-gradient(180deg, #1D1A16 0%, #18161A 100%) !important;
    border-color: #3A332C !important;
}
body.dark-mode .community-focus-panel {
    background:
        radial-gradient(circle at top right, rgba(255, 179, 0, 0.12), transparent 34%),
        linear-gradient(135deg, #211D16 0%, #1E1A22 56%, #17151A 100%);
    border-color: rgba(255, 183, 77, 0.14);
}
body.dark-mode .community-focus-title { color: #F3EEE8; }
body.dark-mode .community-focus-body { color: #B7AFA6; }
body.dark-mode .community-focus-badge {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 183, 77, 0.15);
    color: #D7C8B7;
}
body.dark-mode .community-focus-stat {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 183, 77, 0.15);
    color: #D7C8B7;
}
body.dark-mode .community-focus-action {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 183, 77, 0.15);
    color: #E9DED0;
}
body.dark-mode .community-focus-action.primary { color: #fff; }
body.dark-mode .community-module-card {
    background: #201D24;
    border-color: #352F3B;
}
body.dark-mode .community-module-kicker { color: #8B8495; }
body.dark-mode .community-module-title { color: #ECE7F1; }
body.dark-mode .community-module-link,
body.dark-mode .community-empty-btn,
body.dark-mode .community-inline-btn {
    background: rgba(124, 77, 255, 0.15);
    border-color: rgba(124, 77, 255, 0.28);
    color: #D2C3FF;
}
body.dark-mode .community-empty-state,
body.dark-mode .friend-activity-row,
body.dark-mode .social-challenge-item {
    background: #26222B;
    border-color: #383240;
}
body.dark-mode .community-detail-shell {
    border-top-color: #352F3B;
}
body.dark-mode .community-detail-toggle {
    color: #C9B7FF;
}
body.dark-mode .community-more-btn {
    background: rgba(124, 77, 255, 0.12);
    border-color: rgba(201, 183, 255, 0.26);
    color: #D2C5FF;
}
body.dark-mode .community-empty-state { color: #A8A1AE; }
body.dark-mode .community-empty-state strong,
body.dark-mode .friend-activity-name,
body.dark-mode .social-challenge-type { color: #F0EBF4; }
body.dark-mode .friend-activity-pill,
body.dark-mode .social-challenge-pill {
    background: rgba(124, 77, 255, 0.15);
    color: #D2C3FF;
}
body.dark-mode .community-month-summary,
body.dark-mode .social-challenge-meta,
body.dark-mode .social-challenge-status { color: #B7B0BE; }
body.dark-mode .group-challenge-title { color: #D8D4DC; }
body.dark-mode .group-stat-item {
    background: linear-gradient(135deg, #1E2E1E 0%, #1A2A1E 100%);
    border-color: #2E4A2E;
}
body.dark-mode .group-stat-num { color: #81C784; }
body.dark-mode .group-stat-label { color: #66BB6A; }
body.dark-mode .group-top-user {
    background: #2E2518;
    border-color: #5C4A2E;
    color: #FFB74D;
}
body.dark-mode .community-highlight {
    background: linear-gradient(135deg, #2E2518 0%, #332A1A 100%);
    border-color: #5C4A2E;
    color: #FFB74D;
}
body.dark-mode .cat-king {
    background: #1E2E1E;
    border-color: #2E4A2E;
    color: #A5D6A7;
}
body.dark-mode .mvp-ranking-title { color: #FFB74D; }
body.dark-mode .mvp-ranking-item.rank-1 {
    background: linear-gradient(135deg, #2E2518 0%, #3A2E1A 100%);
    border-color: #5C4A2E;
}
body.dark-mode .mvp-ranking-item.rank-2 {
    background: linear-gradient(135deg, #252525 0%, #2A2A2A 100%);
    border-color: #444;
}
body.dark-mode .mvp-ranking-item.rank-3 {
    background: linear-gradient(135deg, #2A1E1A 0%, #302420 100%);
    border-color: #5A3E30;
}
body.dark-mode .mvp-name { color: #E8E4DF; }
body.dark-mode .mvp-days { color: #9E9E9E; }
body.dark-mode .mvp-reward {
    color: #FFB74D;
    background: rgba(255, 152, 0, 0.15);
}
body.dark-mode .mvp-reward-info { color: #6E6A74; }
body.dark-mode .community-history-btn { color: #66BB6A; border-color: #66BB6A; }
body.dark-mode .community-history-btn:active { background: #66BB6A; color: #1a1a1a; }

/* ───────────────────────────────
   30일 결과지 버튼 다크모드
   ─────────────────────────────── */
body.dark-mode .pdf-btn {
    background-color: #1B5E20;
    color: #C0BCC6;
    box-shadow: 0 2px 8px rgba(27,94,32,0.3);
}
body.dark-mode .dashboard-more-tools {
    background: #181A1F;
    border-color: #30343C;
}
body.dark-mode .dashboard-more-tools summary {
    color: #D4D0D8;
}

/* ───────────────────────────────
   공유 카드 / 갤러리 다크모드
   ─────────────────────────────── */
body.dark-mode .share-card-container {
    background: linear-gradient(145deg, #2E2518 0%, #332A15 100%);
    border-color: #5C4A2E;
}
body.dark-mode .share-privacy-panel {
    background: rgba(255,255,255,0.04);
    border-color: #5C4A2E;
}
body.dark-mode .share-privacy-header strong {
    color: #FFD8A8;
}
body.dark-mode .share-privacy-header span {
    color: #C9B39A;
}
body.dark-mode .share-privacy-toggle {
    background: rgba(255,255,255,0.06);
    border-color: #5C4A2E;
    color: #F2D3A4;
}
body.dark-mode .share-card-capture {
    background: linear-gradient(145deg, #2E2518 0%, #30271A 40%, #332A15 100%);
    border-color: #5C4A2E;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
body.dark-mode .btn-share-action {
    background: linear-gradient(135deg, #CC6600 0%, #B35A00 50%, #994D00 100%);
    box-shadow: 0 3px 12px rgba(204,102,0,0.25);
}

/* 이번 주 인기 기록 다크모드 */
body.dark-mode #weekly-best-container {
    background: linear-gradient(135deg, #2E2518 0%, #332A15 100%);
    border-color: #5C4A2E;
}
body.dark-mode .weekly-best-header { color: #FFB74D; }
body.dark-mode .weekly-best-item {
    background: rgba(255,255,255,0.06);
    border-color: #5C4A2E;
}
body.dark-mode .best-name { color: #D8D4DC; }
body.dark-mode .best-stats { color: #8E8998; }
body.dark-mode .best-thumb { background: #3A3540; }
body.dark-mode .best-no-img { background: #3A3540; }
body.dark-mode .best-score {
    background: rgba(255, 183, 77, 0.12);
    color: #FFCC80;
}
body.dark-mode .share-val.is-hidden {
    color: #C9B39A;
}
body.dark-mode .empty-action-btn {
    background: linear-gradient(135deg, #D97706 0%, #C65A00 100%);
    box-shadow: 0 8px 16px rgba(217, 119, 6, 0.2);
}

/* ───────────────────────────────
   갤러리 상세·댓글 다크모드
   ─────────────────────────────── */
body.dark-mode .gallery-header { color: #D8D4DC; }
body.dark-mode .gallery-actions button { color: #A09AAA; }
body.dark-mode .gallery-date { background: rgba(255,255,255,0.08); color: #d4c0a5; }
body.dark-mode .gallery-relationship-chip { background: rgba(255,255,255,0.08); color: #d7c6b5; }
body.dark-mode .post-menu-btn:hover { background: rgba(255,255,255,0.08); }

/* ───────────────────────────────
   마음 챙김·감사일기 다크모드
   ─────────────────────────────── */
body.dark-mode #gratitude-journal {
    background: #242128;
    color: #E8E4DF;
    border-color: #3A3540;
}

/* ───────────────────────────────
   기타 인라인 색상 다크모드 보정
   ─────────────────────────────── */
body.dark-mode .content-section p[style*="color:#888"],
body.dark-mode .content-section p[style*="color: #888"] {
    color: #8E8998 !important;
}
body.dark-mode .content-section p[style*="color:#FF8C00"],
body.dark-mode .content-section p[style*="color: #FF8C00"] {
    color: #FFB74D !important;
}
body.dark-mode .content-section div[style*="color:#555"],
body.dark-mode .content-section div[style*="color: #555"] {
    color: #A09AAA !important;
}
body.dark-mode .content-section label[style*="color:#555"],
body.dark-mode .content-section label[style*="color: #555"] {
    color: #A09AAA !important;
}
body.dark-mode .content-section div[style*="color:#666"],
body.dark-mode .content-section div[style*="color: #666"] {
    color: #8E8998 !important;
}
body.dark-mode .content-section span[style*="color: #666"],
body.dark-mode .content-section span[style*="color:#666"] {
    color: #8E8998 !important;
}
body.dark-mode .inbody-field label { color: #A09AAA !important; }
body.dark-mode .diet-analysis-card div[style*="color:#555"] { color: #A09AAA !important; }
body.dark-mode .diet-analysis-card div[style*="font-size:13px"] { color: #C0BCC6; }

/* ==========================
   다크모드 끝
   ========================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 480px) {
    .record-flow-card {
        padding: 10px 12px;
        border-radius: 14px;
    }

    .record-flow-topline {
        margin-bottom: 6px;
    }

    .record-flow-head {
        flex-direction: column;
        gap: 6px;
    }

    .record-flow-badge {
        min-height: 26px;
    }

    .record-flow-card h3 {
        font-size: 14px;
    }

    .record-flow-card p {
        font-size: 10px;
    }

    .record-flow-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 30일 종합 결과지 모달 */
.report-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 9999;
    display: flex; justify-content: center; align-items: flex-start;
    overflow-y: auto; padding: 20px 0;
}

.report-container {
    background: #fff; width: 100%; max-width: 520px;
    border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    margin: auto; overflow: hidden;
}

.report-header {
    background: linear-gradient(135deg, #FF8C00 0%, #FFA726 100%);
    color: white; padding: 20px 24px; text-align: center;
}

.report-header h2 { margin: 0 0 6px; font-size: 18px; }

.report-meta { font-size: 12px; opacity: 0.9; }

.report-body { padding: 16px; }

.report-section { margin-bottom: 20px; }

.report-section-title {
    font-size: 14px; font-weight: 700; color: #333;
    margin-bottom: 10px; padding-bottom: 6px;
    border-bottom: 2px solid #FF8C00;
}

.report-summary-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

.report-stat-card {
    background: #FFF8E1; border-radius: 10px; padding: 12px;
    text-align: center; border: 1px solid #FFE082;
}

.report-stat-value {
    font-size: 22px; font-weight: 800; color: #E65100;
}

.report-stat-label {
    font-size: 11px; color: #888; margin-top: 2px;
}

.report-category-grid {
    display: flex; flex-direction: column; gap: 10px;
}

.report-cat-card {
    background: #f9f9f9; border-radius: 10px; padding: 12px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.report-cat-emoji { font-size: 28px; flex-shrink: 0; }

.report-cat-name { font-size: 14px; font-weight: 700; width: 40px; }

.report-cat-stat { font-size: 13px; font-weight: 600; color: #333; }

.report-cat-detail { font-size: 11px; color: #777; width: 100%; padding-left: 48px; }

.report-cat-bar {
    width: 100%; height: 6px; background: #eee; border-radius: 3px;
    overflow: hidden;
}

.report-cat-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }

.report-canvas {
    width: 100%; height: 200px; display: block;
    border: 1px solid #f0f0f0; border-radius: 8px;
    margin-top: 6px;
}

.report-metric-summary {
    font-size: 13px; color: #333; padding: 6px 0;
    border-bottom: 1px dashed #eee;
}

.report-metric-diff { font-weight: 700; }
.report-metric-diff.good { color: #4CAF50; }
.report-metric-diff.warn { color: #FF5722; }

.report-heatmap {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}

.hm-cell {
    aspect-ratio: 1; border-radius: 4px; display: flex;
    align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600; color: #555;
}

.report-heatmap-legend {
    display: flex; gap: 10px; margin-top: 6px; justify-content: center;
}

.hm-legend-item { font-size: 10px; color: #888; display: flex; align-items: center; gap: 3px; }

.hm-box { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

.report-actions {
    display: flex; gap: 8px; padding: 12px 16px 16px;
    border-top: 1px solid #eee;
}

.report-btn {
    flex: 1; padding: 10px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
}

.report-btn-print { background: #FF8C00; color: white; }
.report-btn-close { background: #eee; color: #333; }

/* 인쇄 스타일 */
@media print {
    body { 
        background: white; 
        padding: 0; 
    }

    /* 결과지 모달이 열려있으면 결과지만 인쇄 */
    .report-modal {
        position: static !important;
        background: none !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .report-container {
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: 100% !important;
    }

    .report-actions { display: none !important; }

    .report-canvas {
        break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .hm-cell {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .report-cat-fill, .report-stat-card, .report-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .header, 
    .tab-menu, 
    .bottom-bar, 
    .quest-board, 
    .chat-banner-fixed, 
    .mission-progress-container,
    #dashboard,
    #profile,
    #assets,
    #diet,
    #exercise,
    #sleep,
    #gallery { 
        display: none !important; 
    }

    .app-container {
        max-width: 100% !important;
        padding: 0 !important;
    }
}

/* ==========================
   AI 식단 분석 카드
   ========================== */

.diet-ai-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 8px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border: 1px solid #A5D6A7;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #2E7D32;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.15s;
}

.diet-ai-btn:active {
    transform: scale(0.95);
}

.diet-ai-btn.loading {
    background: #E0E0E0;
    color: #999;
    pointer-events: none;
}

.diet-analysis-card {
    background: #FAFAFA;
    border-radius: 10px;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid #E8E8E8;
}

.diet-grade-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.diet-grade-badge {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}

.diet-grade-label {
    font-size: 12px;
    font-weight: 700;
    color: #555;
}

.diet-grade-summary {
    font-size: 13px;
    color: #333;
    margin-top: 2px;
    line-height: 1.4;
}

.diet-natural-ratio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #555;
    margin-bottom: 10px;
}

.diet-ratio-bar-bg {
    flex: 1;
    height: 8px;
    background: #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
}

.diet-ratio-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #66BB6A, #2E7D32);
    border-radius: 4px;
    transition: width 0.5s;
}

.diet-ratio-val {
    font-weight: 700;
    color: #2E7D32;
    min-width: 32px;
    text-align: right;
}

.diet-foods-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.diet-food-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: white;
    border-radius: 6px;
    font-size: 12px;
}

.diet-food-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.diet-food-name {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.diet-food-cat {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.diet-food-cat[data-cat="natural"] {
    background: #E8F5E9;
    color: #2E7D32;
}

.diet-food-cat[data-cat="processed"] {
    background: #FFF8E1;
    color: #F57F17;
}

.diet-food-cat[data-cat="ultraprocessed"] {
    background: #FFEBEE;
    color: #C62828;
}

.diet-scores-section {
    margin-bottom: 10px;
}

.diet-scores-title {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diet-score-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.diet-score-label {
    font-size: 11px;
    width: 64px;
    flex-shrink: 0;
}

.diet-score-bar-bg {
    flex: 1;
    height: 6px;
    background: #E0E0E0;
    border-radius: 3px;
    overflow: hidden;
}

.diet-score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s;
}

.diet-score-val {
    font-size: 11px;
    font-weight: 700;
    color: #555;
    min-width: 20px;
    text-align: right;
}

.diet-insight-box {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
    border-radius: 8px;
    border: 1px solid #C8E6C9;
    margin-bottom: 6px;
}

.diet-insight-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.diet-insight-label {
    font-size: 10px;
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 2px;
}

.diet-insight-text {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
}

.diet-suggestion-box {
    font-size: 12px;
    color: #E65100;
    padding: 8px;
    background: #FFF3E0;
    border-radius: 8px;
    border: 1px solid #FFE0B2;
}

/* 오늘의 식단 총평 */
.diet-day-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-light);
}

.diet-day-grade {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}

.diet-day-stats {
    display: flex;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

/* ==========================
   대사건강 점수 카드
   ========================== */

.metabolic-score-card {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: var(--spacing-lg);
    border: none;
}

.metabolic-score-card h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #1B5E20;
}

.ms-score-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.ms-circle-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.ms-circle {
    width: 90px;
    height: 90px;
}

.ms-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ms-circle-num {
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
}

.ms-circle-label {
    font-size: 10px;
    color: #888;
}

.ms-areas {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ms-area-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.ms-area-icon {
    font-size: 12px;
    flex-shrink: 0;
}

.ms-area-label {
    width: 42px;
    font-weight: 600;
    color: #444;
    flex-shrink: 0;
}

.ms-area-bar-bg {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.7);
    border-radius: 3px;
    overflow: hidden;
}

.ms-area-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #66BB6A, #2E7D32);
    border-radius: 3px;
    transition: width 0.5s;
}

.ms-area-val {
    font-size: 10px;
    color: #555;
    font-weight: 600;
    min-width: 30px;
    text-align: right;
}

.ms-area-missing .ms-area-need {
    flex: 1;
    font-size: 10px;
    color: #888;
    font-style: italic;
    text-align: right;
}

.ms-area-missing .ms-area-label {
    color: #aaa;
}

.ms-partial-note {
    font-size: 11px;
    color: #777;
    text-align: center;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
}

.ms-insights {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ms-insight-item {
    font-size: 12px;
    color: #333;
    padding: 8px;
    background: rgba(255,255,255,0.8);
    border-radius: 8px;
    line-height: 1.5;
}

/* ==========================
   온보딩 모달
   ========================== */

.onboarding-modal-content {
    max-width: 360px;
    padding: 24px 20px;
    text-align: center;
}

.onboarding-steps-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #DDD;
    transition: background 0.3s, transform 0.3s;
}

.onboarding-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.ob-question {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.ob-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.ob-choice-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #F5F5F5;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.ob-choice-item:has(input:checked) {
    background: #FFF3E0;
    border: 1px solid #FFB74D;
}

.ob-choice-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.ob-start-tips {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.ob-tip {
    padding: 10px 12px;
    background: #F5F5F5;
    border-radius: 10px;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}

/* Diet UI Refinements */
.input-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.diet-analysis-card.collapsed .diet-natural-ratio,
.diet-analysis-card.collapsed .diet-foods-list,
.diet-analysis-card.collapsed .diet-scores-section,
.diet-analysis-card.collapsed .diet-insight-box,
.diet-analysis-card.collapsed .diet-suggestion-box {
    display: none;
}

/* .diet-grade-row {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.diet-grade-row::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #888;
    transition: transform 0.3s ease;
}

.diet-analysis-card.collapsed .diet-grade-row::after {
    transform: translateY(-50%) rotate(180deg);
} */

/* ==========================================
   운동 탭 - 헤더 + 추가 버튼 인라인 배치
   ========================================== */
.exercise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.exercise-header h3 {
    margin: 0;
}

.add-exercise-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border: 1px solid #A5D6A7;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #2E7D32;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.12s, box-shadow 0.15s;
}

.add-exercise-btn:active {
    transform: scale(0.95);
}

/* 운동 블록별 AI 버튼 */
.exercise-ai-btn {
    width: 100%;
    margin-top: 6px;
}

.exercise-block-ai-result {
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
}

/* ==========================================
   갤러리 인라인 미디어 + AI 오버레이
   ========================================== */
.gallery-media-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
}

/* 이미지 확대 시 wrapper가 그리드 전체 너비 차지 */
.gallery-media-wrapper:has(img.gallery-img-expanded) {
    grid-column: 1 / -1;
}

.gallery-media-wrapper img {
    transition: max-height 0.3s ease;
    cursor: pointer;
}

.gallery-media-wrapper img.gallery-img-expanded {
    max-height: none !important;
    width: 100% !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    contain: none !important;
}

.gallery-ai-overlay-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: #2E7D32;
    border: 1px solid #A5D6A7;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: transform 0.12s;
}

.gallery-ai-overlay-btn:active {
    transform: scale(0.95);
}

.gallery-ai-overlay {
    background: #FAFAFA;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 6px;
    margin-top: 6px;
    overflow-y: auto;
    max-height: 400px;
}

.gallery-ai-overlay .diet-analysis-card {
    margin-top: 0;
    font-size: 12px;
}

/* ========================================
 * 업로드 CTA 배너
 * ======================================== */
.upload-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin: 8px 0 12px 0;
    background: linear-gradient(135deg, #e8f5e9 0%, #f3e5f5 100%);
    border: 2px dashed #4CAF50;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.upload-cta:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, #c8e6c9 0%, #e1bee7 100%);
}

.upload-cta-icon {
    font-size: 32px;
    flex-shrink: 0;
    animation: uploadBounce 2s ease-in-out infinite;
}

@keyframes uploadBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.upload-cta-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upload-cta-text strong {
    font-size: 14px;
    color: #2E7D32;
}

.upload-cta-text span {
    font-size: 11px;
    color: #666;
}

.upload-cta-arrow {
    font-size: 24px;
    color: #4CAF50;
    font-weight: bold;
}

.record-flow-card {
    margin: 6px 0 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #E6E1D8;
    background: linear-gradient(135deg, #FFF9EE 0%, #F8FBFF 100%);
    box-shadow: 0 8px 18px rgba(90, 78, 58, 0.05);
}

.record-flow-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.record-flow-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.record-flow-head-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.record-flow-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #C56A00;
    text-transform: uppercase;
}

.record-flow-card h3 {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.3;
    color: #2C251C;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-flow-card p {
    margin: 0;
    font-size: 10px;
    line-height: 1.4;
    color: #6A6359;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-flow-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(229, 164, 88, 0.28);
    color: #A65800;
    font-size: 11px;
    font-weight: 800;
}

.record-flow-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(226, 216, 199, 0.95);
    background: rgba(255,255,255,0.82);
    color: #8a5a23;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.record-flow-body[hidden] {
    display: none !important;
}

.record-flow-card.is-collapsed {
    padding-bottom: 10px;
}

.record-flow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.record-flow-btn {
    border: 1px solid #E2D8C7;
    background: white;
    color: #4E4438;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.record-flow-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}

.record-flow-btn:active {
    transform: scale(0.98);
}

.record-flow-btn.primary {
    border: none;
    background: linear-gradient(135deg, #FF9A1F 0%, #FF7A00 100%);
    color: white;
    box-shadow: 0 8px 18px rgba(255, 138, 0, 0.18);
}

/* ==========================================
   걸음수 카드 & 위젯 스타일
   ========================================== */

/* Step Ring (운동 탭) */
.step-card { position: relative; }
.step-display { display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.step-ring-container { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.step-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.step-ring-bg { fill: none; stroke: #f0f0f0; stroke-width: 8; }
.step-ring-progress { fill: none; stroke: #4CAF50; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.step-ring-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.step-count { font-size: 22px; font-weight: 700; color: #333; display: block; }
.step-goal-label { font-size: 11px; color: #999; }

/* Step Right Panel (입력 + 캡처) */
.step-right-panel { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.step-input-group { display: flex; gap: 6px; }
.step-number-input {
    flex: 1; min-width: 0; padding: 9px 10px; border: 1.5px solid #ddd; border-radius: 10px;
    font-size: 14px; outline: none; transition: border-color 0.2s;
}
.step-number-input:focus { border-color: #4CAF50; }
.step-input-btn {
    padding: 9px 14px; background: #4CAF50; color: white; border: none;
    border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: background 0.2s;
}
.step-input-btn:active { background: #388E3C; }
.step-screenshot-btn {
    display: block; text-align: center; padding: 10px 8px; background: #f8f9fa;
    border: 1.5px dashed #ccc; border-radius: 10px; font-size: 13px;
    color: #555; cursor: pointer; transition: all 0.2s;
}
.step-screenshot-btn:active { background: #e8f5e9; border-color: #4CAF50; }

/* Step Details */
.step-details { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.step-detail-item { font-size: 12px; color: #555; display: flex; gap: 6px; align-items: center; }

/* Step Analysis Result */
.step-analysis-box {
    margin-top: 10px; padding: 12px 14px; background: #e8f5e9;
    border-radius: 10px; border-left: 4px solid #4CAF50;
}
.step-analysis-box .step-result-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.step-analysis-box .step-result-label { color: #666; }
.step-analysis-box .step-result-value { font-weight: 600; color: #333; }

/* Dark Mode */
body.dark-mode .step-count { color: #e0e0e0; }
body.dark-mode .step-ring-bg { stroke: #333; }
body.dark-mode .step-number-input { background: #2a2a2a; color: #e0e0e0; border-color: #444; }
body.dark-mode .step-number-input:focus { border-color: #66BB6A; }
body.dark-mode .step-screenshot-btn { background: #2a2a2a; border-color: #444; color: #aaa; }
body.dark-mode .step-analysis-box { background: #1b3a1b; border-left-color: #66BB6A; }
body.dark-mode .step-detail-item { color: #bbb; }

/* ============================================================
   스트릭 뱃지 (갤러리 카드)
   ============================================================ */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    color: #E65100;
    background: rgba(255, 152, 0, 0.12);
    border-radius: 8px;
    padding: 1px 5px;
    vertical-align: middle;
    white-space: nowrap;
}

/* ============================================================
   친구 초대 카드 (지갑 탭)
   ============================================================ */
.referral-card {
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    border: 1.5px solid #FFB300;
}

.chatbot-link-card,
.friend-request-card {
    border: 1.5px solid #ebc893;
    background: linear-gradient(135deg, #fffdf8, #fff5e8);
    box-shadow: 0 8px 18px rgba(95, 66, 28, 0.05);
}

.chatbot-link-head,
.friend-request-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.chatbot-link-head h3,
.friend-request-head h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 800;
    color: #3b2f1e;
}

.chatbot-link-head p,
.friend-request-head p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #6f583f;
}

.chatbot-link-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.chatbot-link-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #f2dcc2;
    background: rgba(255, 255, 255, 0.86);
}

.chatbot-link-step-no {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffb347, #ff8c00);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.chatbot-link-step strong {
    display: block;
    font-size: 13px;
    color: #3b2f1e;
    margin-bottom: 2px;
}

.chatbot-link-step small {
    display: block;
    font-size: 11px;
    line-height: 1.45;
    color: #866b4d;
}

.chatbot-link-badge {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 140, 0, 0.12);
    color: #d26900;
    font-size: 11px;
    font-weight: 800;
}

.chatbot-link-status,
.chatbot-link-foot {
    font-size: 12px;
    line-height: 1.5;
    color: #735c43;
}

.chatbot-link-status strong {
    color: #a85d00;
}

.chatbot-link-fallback-toggle {
    width: 100%;
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid #efd7bd;
    background: rgba(255, 255, 255, 0.84);
    color: #8f5717;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.chatbot-link-fallback-panel {
    margin-top: 10px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #f0dfca;
    background: rgba(255, 255, 255, 0.78);
}

.chatbot-link-fallback-copy {
    font-size: 12px;
    line-height: 1.5;
    color: #8a6a46;
}

.chatbot-link-code-box {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #f1dfca;
    border-radius: 14px;
    padding: 12px 14px;
    margin: 12px 0;
}

.chatbot-link-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.chatbot-link-code-label,
.chatbot-link-meta {
    font-size: 12px;
    color: #866b4d;
}

.chatbot-link-code-value {
    font-size: 20px;
    letter-spacing: 3px;
    color: #ff8c00;
}

.chatbot-link-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.chatbot-link-primary {
    flex: 1;
    margin: 0;
}

.chatbot-link-copy-btn {
    flex-shrink: 0;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #f0d0b0;
    background: #fff;
    color: #9a5b1a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.chatbot-link-copy-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.profile-update-card {
    border: 1.5px solid #ebc893;
    background: linear-gradient(135deg, #fffdf8, #fff6ea);
    box-shadow: 0 8px 18px rgba(95, 66, 28, 0.05);
}

.profile-update-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.profile-update-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    color: #3b2f1e;
}

.profile-update-head p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #735c43;
}

.profile-update-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #efd7bd;
    color: #a45a10;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.profile-update-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-update-day {
    padding: 14px 14px 12px;
    border-radius: 14px;
    border: 1px solid #f1deca;
    background: rgba(255,255,255,0.9);
}

.profile-update-day-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.profile-update-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffb347, #ff8c00);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.profile-update-day-head strong {
    font-size: 13px;
    color: #4a3014;
}

.profile-update-items {
    margin: 0;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-update-items li {
    font-size: 12px;
    line-height: 1.5;
    color: #6a553d;
}

.chatbot-connect-modal-content {
    max-width: 400px;
}

.chatbot-connect-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 140, 0, 0.12);
    color: #c86c00;
    font-size: 11px;
    font-weight: 800;
}

.chatbot-connect-modal-title {
    margin: 14px 0 8px;
    font-size: 22px;
    line-height: 1.3;
    color: #2b2116;
}

.chatbot-connect-modal-copy {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.55;
    color: #6f5b45;
}

.chatbot-connect-modal-summary {
    background: #fff9f1;
    border: 1px solid #f1dfca;
    border-radius: 16px;
    padding: 12px 14px;
}

.chatbot-connect-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #7a6146;
}

.chatbot-connect-summary-row + .chatbot-connect-summary-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(240, 215, 189, 0.8);
}

.chatbot-connect-summary-row strong {
    max-width: 65%;
    text-align: right;
    color: #352618;
    word-break: break-word;
}

.chatbot-connect-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.chatbot-connect-modal-actions .wallet-modal-btn {
    flex: 1;
}

.friend-request-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.friend-request-chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 140, 0, 0.1);
    color: #9a5b1a;
    font-size: 11px;
    font-weight: 700;
}

.friend-request-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friend-request-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #f0e2cf;
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.9);
}

.friend-request-copy {
    min-width: 0;
}

.friend-request-name {
    font-size: 14px;
    font-weight: 700;
    color: #3c2f24;
    margin-bottom: 2px;
}

.friend-request-meta {
    font-size: 12px;
    color: #7d6b59;
    line-height: 1.45;
}

.friend-request-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.friend-request-btn {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid #ecd9c4;
    background: #fff;
    color: #7a6958;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.friend-request-btn.accept {
    background: linear-gradient(135deg, #ffb347, #ff8c00);
    border-color: transparent;
    color: #fff;
}

.friend-request-btn.cancel {
    color: #d15b37;
    border-color: #f4c7b8;
    background: #fff7f4;
}

.friend-request-empty {
    font-size: 12px;
    color: #8a7764;
    line-height: 1.6;
    padding: 2px 0;
}

.referral-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.referral-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.referral-badge {
    font-size: 11px;
    font-weight: 700;
    color: #E65100;
    background: rgba(255, 152, 0, 0.15);
    border-radius: 20px;
    padding: 2px 10px;
}

.referral-rewards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.referral-reward-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
}

.rr-emoji { font-size: 16px; }

.referral-link-box {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

.referral-link-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 12px;
    color: #333;
    background: #fff;
    min-width: 0;
}

.referral-copy-btn {
    padding: 8px 14px;
    background: #FF6F00;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.referral-share-row {
    display: flex;
    gap: 8px;
}

.referral-share-btn {
    flex: 1;
    padding: 8px 0;
    border: 1.5px solid #FFB300;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #E65100;
    cursor: pointer;
}

body.dark-mode .referral-card {
    background: linear-gradient(135deg, #2a2200, #261800);
    border-color: #996600;
}

body.dark-mode .chatbot-link-card,
body.dark-mode .friend-request-card {
    background: linear-gradient(135deg, #2a241a, #231d15);
    border-color: #6b573f;
}

body.dark-mode .profile-update-card {
    background: linear-gradient(135deg, #2a241a, #231d15);
    border-color: #6b573f;
}

body.dark-mode .profile-update-head h3,
body.dark-mode .profile-update-day-head strong {
    color: #f1e6d6;
}

body.dark-mode .profile-update-head p,
body.dark-mode .profile-update-items li {
    color: #cbb59c;
}

body.dark-mode .profile-update-day {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .profile-update-link {
    background: #2b2620;
    border-color: #5b4a39;
    color: #e2d2c0;
}

body.dark-mode .chatbot-link-head h3,
body.dark-mode .friend-request-head h3,
body.dark-mode .friend-request-name {
    color: #f1e6d6;
}

body.dark-mode .chatbot-link-head p,
body.dark-mode .friend-request-head p,
body.dark-mode .chatbot-link-status,
body.dark-mode .chatbot-link-foot,
body.dark-mode .chatbot-link-meta,
body.dark-mode .friend-request-meta,
body.dark-mode .friend-request-empty {
    color: #c8b49d;
}

body.dark-mode .chatbot-link-step,
body.dark-mode .chatbot-link-code-box,
body.dark-mode .friend-request-row,
body.dark-mode .chatbot-link-fallback-panel {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .chatbot-link-step strong,
body.dark-mode .chatbot-connect-modal-title,
body.dark-mode .chatbot-connect-summary-row strong,
body.dark-mode .friend-request-name {
    color: #f1e6d6;
}

body.dark-mode .chatbot-link-step small,
body.dark-mode .chatbot-link-fallback-copy,
body.dark-mode .chatbot-connect-modal-copy,
body.dark-mode .chatbot-connect-summary-row {
    color: #dec7ae;
}

body.dark-mode .chatbot-link-fallback-toggle,
body.dark-mode .chatbot-link-copy-btn,
body.dark-mode .friend-request-btn {
    background: #2b2620;
    border-color: #5b4a39;
    color: #e2d2c0;
}

body.dark-mode .chatbot-connect-modal-summary {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .friend-request-btn.accept {
    color: #fff;
    border-color: transparent;
}

body.dark-mode .wallet-asset-note {
    color: rgba(255,255,255,0.72);
}

body.dark-mode .referral-link-input {
    background: #1e1e1e;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .referral-share-btn {
    background: #1e1e1e;
    color: #FFB300;
    border-color: #996600;
}

body.dark-mode .streak-badge {
    background: rgba(255, 152, 0, 0.2);
}

@media (max-width: 640px) {
    .chatbot-link-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .chatbot-link-steps,
    .chatbot-connect-modal-actions,
    .chatbot-link-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .chatbot-link-copy-btn {
        width: 100%;
    }

    .profile-update-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-update-link {
        width: auto;
        max-width: 100%;
        align-self: flex-start;
    }
}

