/* ==========================================================================
   VoiceMemo 모던 반응형 스타일시트
   디자인 테마: 스티치 Warm Sanctuary (온화한 안식처 - 감성 내추럴 미니멀리즘)
   + 딥 포레스트 그린(#3a5a40) & 웜 테라코타 클레이(#d47a60) & 소프트 세이지(#588157)
   + Plus Jakarta Sans & Pretendard 하모니 폰트
   ========================================================================== */

:root {
    color-scheme: light dark;
    /* 스티치 다크 포레스트 모드 (눈부시지 않은 부드러운 덜 진한 차콜 톤) */
    --bg-primary: #252d27;       /* 덜 진한 편안한 다크 배경 */
    --bg-secondary: #2c362f;     /* 카드 및 패널 배경 */
    --bg-card: #2c362f;
    --bg-input: #354038;        /* 입력창 배경 */
    --border-color: #424e45;
    --border-focus: #588157;
    
    --text-primary: #cbd5e1;    /* 덜 밝고 눈이 편안한 소프트 화이트 */
    --text-secondary: #94a3b8;  /* 보조 텍스트 */
    --text-muted: #64748b;

    --primary: #588157;          /* 포레스트 세이지 악센트 */
    --primary-hover: #486e47;
    --secondary: #e0896f;        /* 웜 테라코타 클레이 */
    --secondary-hover: #cf7459;
    --tertiary: #a5d2a2;         /* 소프트 세이지 */
    --danger: #e06d53;           /* 부드러운 테라코타 레드 */
    --danger-hover: #c9563c;
    --success: #588157;
    --warning: #d99b26;

    /* 스티치 감성 카테고리 틴트 색상 (다크 모드) */
    --cat-diary-bg: #382420;   --cat-diary-text: #f5b5a4;
    --cat-idea-bg: #3a321a;    --cat-idea-text: #fae19c;
    --cat-todo-bg: #1e3522;    --cat-todo-text: #b6e4bc;
    --cat-done-bg: #212f3d;    --cat-done-text: #b8d4ee;
    --cat-people-bg: #362232;  --cat-people-text: #ebb8e4;
    --cat-event-bg: #362a20;   --cat-event-text: #f0caa4;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.45);
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

    /* [글자 크기 개별 조절 배율 변수] */
    --fs-calendar-scale: 1;
    --fs-search-scale: 1;
    --fs-category-scale: 1;
    --fs-title-scale: 1;
    --fs-content-scale: 1;
    --fs-memo_body-scale: 1;
    --fs-ai_summary-scale: 1;
    --fs-button-scale: 1;
}

/* ==========================================================================
   스티치 대표 테마: Warm Sanctuary 라이트 모드 (따스한 린넨 종이 & 딥 포레스트)
   - 모바일 브라우저의 강제 다크 반전 방지 (color-scheme: light !important)
   ========================================================================== */
:root[data-theme="light"],
html[data-theme="light"],
body[data-theme="light"] {
    color-scheme: only light !important;
    --bg-primary: #fbf9f5;       /* 포근한 언블리치드 오트밀/린넨 종이색 */
    --bg-secondary: #ffffff;     /* 깨끗한 밀크 화이트 카드 서피스 */
    --bg-card: #ffffff;
    --bg-input: #f4efeb;         /* 따스한 린넨 베이지 인셋 */
    --border-color: #e6e0d6;     /* 섬세한 헤어라인 린넨 테두리 */
    --border-focus: #3a5a40;     /* 딥 포레스트 그린 포커스 */
    
    --text-primary: #2b2d2f;     /* 눈부심 없는 딥 차콜 잉크 */
    --text-secondary: #5a625b;   /* 부드러운 올리브 그레이 보조 텍스트 */
    --text-muted: #848c84;       /* 차분한 안내문/플레이스홀더 */

    --primary: #3a5a40;          /* 스티치 딥 포레스트 그린 */
    --primary-hover: #29422f;
    --secondary: #d47a60;        /* 스티치 웜 테라코타 클레이 (마이크/녹음) */
    --secondary-hover: #bd644b;
    --tertiary: #588157;         /* 스티치 소프트 세이지 그린 */
    --danger: #d47a60;
    --danger-hover: #bd644b;
    --success: #588157;
    --warning: #d99b26;

    /* 스티치 6대 카테고리 감성 파스텔 틴트 */
    --cat-diary-bg: #f3ece7;   --cat-diary-text: #965646; /* 일기: 웜 뮤티드 클레이 */
    --cat-idea-bg: #fbf3df;    --cat-idea-text: #8c6b1f;  /* 아이디어: 선릿 앰버 */
    --cat-todo-bg: #ebf3ed;    --cat-todo-text: #3d6b48;  /* 할일: 프레시 허브 그린 */
    --cat-done-bg: #edf1f5;    --cat-done-text: #486581;  /* 한일: 슬레이트 리버 */
    --cat-people-bg: #f5edf3;  --cat-people-text: #884c77;/* 인물: 더스티 플럼 */
    --cat-event-bg: #f5efe7;   --cat-event-text: #855f3e; /* 행사: 에이지드 샌드스톤 */

    /* 유기적인 자연광 그림자 (종이 레이어링 효과) */
    --shadow-sm: 0 2px 6px -1px rgba(66, 56, 42, 0.05);
    --shadow-md: 0 6px 20px -3px rgba(66, 56, 42, 0.07), 0 2px 6px -1px rgba(66, 56, 42, 0.03);
    --shadow-lg: 0 14px 34px -4px rgba(66, 56, 42, 0.10), 0 4px 12px -2px rgba(66, 56, 42, 0.04);
}

html[data-theme="light"] body,
html[data-theme="light"] .app-container,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .main-content,
html[data-theme="light"] .memo-list-section {
    background-color: #fbf9f5 !important;
    color: #2b2d2f !important;
}

html[data-theme="light"] .app-header {
    background-color: rgba(251, 249, 245, 0.92) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid #e6e0d6 !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] .calendar-card,
html[data-theme="light"] .memo-card,
html[data-theme="light"] .memo-item,
html[data-theme="light"] .settings-drawer,
html[data-theme="light"] .menu-drawer {
    background-color: #ffffff !important;
    border: 1px solid #e6e0d6 !important;
    box-shadow: 0 4px 20px -2px rgba(66, 56, 42, 0.05) !important;
    color: #2b2d2f !important;
}

/* 🌿 [스티치 Warm Sanctuary 라이트 모드] 메모 작성 박스: 딥 포레스트 그린 테두리 & 편안한 그림자 */
html[data-theme="light"] .write-card {
    background-color: #ffffff !important;
    border: 2px solid #3a5a40 !important; /* 스티치 대표색 딥 포레스트 그린 테두리 */
    box-shadow: 0 8px 30px rgba(58, 90, 64, 0.12), 0 2px 8px rgba(66, 56, 42, 0.04) !important;
    color: #2b2d2f !important;
}

html[data-theme="light"] .search-input {
    background-color: #ffffff !important;
    border-color: #e6e0d6 !important;
    color: #2b2d2f !important;
}

html[data-theme="light"] .cal-month-year {
    color: #2b2d2f !important;
    font-weight: 700;
}

html[data-theme="light"] .cal-day.current-month {
    color: #2b2d2f;
}

html[data-theme="light"] .cal-day.other-month {
    color: #a4aca5;
}

html[data-theme="light"] .cal-day.current-month:hover {
    background: #f4efeb;
    color: #3a5a40;
}

html[data-theme="light"] .cal-day.is-today {
    border-color: #3a5a40;
    color: #3a5a40;
    font-weight: 700;
}

html[data-theme="light"] .cal-day.has-memo {
    background: rgba(58, 90, 64, 0.08);
    border: 1px solid rgba(58, 90, 64, 0.22);
    color: #3a5a40;
    font-weight: 700;
}

html[data-theme="light"] .cal-day.is-selected {
    background: #3a5a40 !important;
    color: #ffffff !important;
    border-color: #3a5a40 !important;
    box-shadow: 0 4px 14px rgba(58, 90, 64, 0.35) !important;
}

html[data-theme="light"] .cal-footer {
    border-top: 1px solid #e6e0d6 !important;
}

html[data-theme="light"] .btn-cal-tool {
    background: #f4efeb;
    color: #5a625b;
    border: 1px solid #e6e0d6;
    border-radius: 9999px;
}

html[data-theme="light"] .btn-cal-tool:hover {
    background: #ede6de;
    color: #3a5a40;
}

html[data-theme="light"] .btn-cal-tool.is-active {
    background: #3a5a40 !important;
    color: #ffffff !important;
    border-color: #3a5a40 !important;
    box-shadow: 0 2px 8px rgba(58, 90, 64, 0.25) !important;
}

/* [라이트 모드 전용 컴포넌트 스타일] */
html[data-theme="light"] .form-control {
    background-color: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .form-control::placeholder {
    color: #64748b !important;
}

html[data-theme="light"] .form-control:focus {
    background-color: #ffffff !important;
    border-color: #6366f1 !important;
}

html[data-theme="light"] .recorder-panel {
    background: #fbf9f5 !important;
    border: 1px solid #e6e0d6 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px -2px rgba(66, 56, 42, 0.05) !important;
}

/* 🌿 [스티치 Warm Sanctuary] 음성 녹음 마이크 버튼: 따뜻한 테라코타 클레이 톤 (#d47a60) */
html[data-theme="light"] .btn-record {
    background: linear-gradient(135deg, #d47a60 0%, #b85e46 100%) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 16px rgba(212, 122, 96, 0.35), 0 2px 6px rgba(66, 56, 42, 0.04) !important;
    border-radius: 9999px !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html[data-theme="light"] .btn-record:hover {
    background: linear-gradient(135deg, #bd644b 0%, #a44d36 100%) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 6px 22px rgba(212, 122, 96, 0.45), 0 3px 8px rgba(66, 56, 42, 0.06) !important;
    transform: translateY(-1px) scale(1.02) !important;
}

html[data-theme="light"] .memo-content-guide {
    color: #8b968e !important; /* 은은하고 눈이 편안한 소프트 린넨 그레이 안내문 */
}

html[data-theme="light"] #memoContent::placeholder,
html[data-theme="light"] .form-control-content::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

html[data-theme="light"] .btn-tool {
    background: #f4efeb;
    color: #2b2d2f;
    border: 1px solid #e6e0d6;
    border-radius: 9999px;
    font-weight: 500;
}

html[data-theme="light"] .btn-tool:hover {
    background: #ede6de;
    color: #3a5a40;
    border-color: #d8cfc3;
}

html[data-theme="light"] .media-audio {
    background: #f4efeb !important;
    border-color: #e6e0d6 !important;
    border-radius: 12px !important;
}

html[data-theme="light"] .audio-header {
    color: #2b2d2f !important;
}

html[data-theme="light"] .category-radio .badge-opt {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    padding: 0.22rem 0.75rem;
    min-width: 52px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

html[data-theme="light"] .category-radio .badge-opt:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

/* 🌿 [라이트 모드] 카테고리 선택 상태: 짙은 차콜 회색으로 명확하게 식별 */
html[data-theme="light"] .category-radio input[type="radio"]:checked + .badge-opt {
    background: #334155 !important;
    color: #ffffff !important;
    border-color: #334155 !important;
    box-shadow: 0 2px 6px rgba(51, 65, 85, 0.25) !important;
    font-weight: 700 !important;
}

/* 🌿 [라이트 모드] 메모 저장 버튼: 색상을 많이 흐리게(은은한 소프트 세이지 린넨 그레이) */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-save {
    background: #d6ded7 !important;
    color: #2c3830 !important;
    border: 1px solid #b6c3b8 !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
    font-weight: 700 !important;
}

html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] .btn-save:hover {
    background: #c5d0c6 !important;
    color: #1e2621 !important;
    border-color: #a5b3a7 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* 기본 리셋 및 전역 스타일 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* 전체 컨테이너 */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   헤더 (Header)
   ========================================================================== */
.app-header {
    background-color: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    background: transparent;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-badge {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.85rem 0.25rem 0.35rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: var(--transition);
}

.user-badge:hover {
    border-color: var(--primary);
    background: var(--bg-card);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* 둥근 원형 축소 아바타 컨테이너 */
.user-avatar-wrap {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(99, 102, 241, 0.15);
    border: 1.5px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.user-avatar-fallback {
    font-size: 1rem;
    color: var(--primary);
}

/* 마우스 호버 시 카메라 아이콘 안내 오버레이 */
.avatar-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 50%;
}

.user-badge:hover .avatar-edit-overlay {
    opacity: 1;
}

.user-name-text {
    letter-spacing: -0.01em;
}

/* 라이트 모드 사용자 배지 스타일 */
html[data-theme="light"] .user-badge {
    background: #ffffff;
    border-color: #e6e0d6;
    color: #2b2d2f;
}
html[data-theme="light"] .user-badge:hover {
    border-color: #3a5a40;
    background: #f4efeb;
}

.btn-logout {
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* 상단 헤더 핵심 액션 버튼 (기어 환경설정, 삼단바 전체메뉴) */
.btn-header-action,
.btn-settings-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.btn-header-action:hover,
.btn-settings-toggle:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-header-gear:hover i {
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

/* ==========================================================================
   플래시 메시지 알림 (Flash Alerts)
   ========================================================================== */
.flash-container {
    max-width: 1200px;
    margin: 1rem auto 0;
    padding: 0 1.25rem;
    width: 100%;
}

.flash-message {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.flash-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.flash-danger  { background: rgba(239, 68, 68, 0.15);  color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.flash-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.flash-info    { background: rgba(99, 102, 241, 0.15);  color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }

/* ==========================================================================
   메인 콘텐츠 2열 대시보드 레이아웃 (Dashboard 2-Column Layout)
   ========================================================================== */
.app-main {
    flex: 1;
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-pane {
    width: 100%;
}

.filter-section-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.memo-write-section {
    width: 100%;
}

.memo-list-pane {
    width: 100%;
    min-width: 0;
}

/* [PC/데스크톱 화면 (900px 이상)]
   넓은 화면에서는 좌측 320px 달력 사이드바 + 우측 메인 영역 2열 배치 */
@media (min-width: 900px) {
    .dashboard-layout {
        display: grid;
        grid-template-columns: 320px 1fr;
        grid-template-areas:
            "sidebar write"
            "sidebar filter"
            "sidebar list";
        align-items: start;
        gap: 1.75rem;
    }

    .sidebar-pane {
        grid-area: sidebar;
        position: sticky;
        top: 80px;
    }

    .filter-section-wrap {
        grid-area: filter;
    }

    .memo-write-section {
        grid-area: write;
    }

    .memo-list-pane {
        grid-area: list;
    }
}

/* 카드 기본 스타일 */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* ==========================================================================
   📅 좌측 사이드바 달력 위젯 (Calendar Card)
   ========================================================================== */
.calendar-card {
    padding: 1.25rem;
    position: sticky;
    top: 5rem;
}

.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cal-month-year {
    font-size: 1.25rem; /* 기존 1.05rem에서 2단계 확대 */
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.btn-cal-nav {
    background: var(--bg-input);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-cal-nav:hover {
    color: var(--text-primary);
    background: #475569;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.95rem; /* 기존 0.8rem에서 2단계 확대 */
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.cal-weekdays .sun { color: #f87171; }
.cal-weekdays .sat { color: #60a5fa; }

.cal-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.cal-day {
    position: relative;
    aspect-ratio: 1;
    min-height: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.05rem; /* 기존 0.85rem에서 2단계 확대 */
    font-weight: 400; /* 다크 모드: 볼드체 해제하여 눈이 편안한 일반 굵기 */
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.cal-day.other-month {
    color: #475569;
    cursor: default;
}

.cal-day.current-month:hover {
    background: rgba(51, 65, 85, 0.5);
    color: var(--text-primary);
}

/* (1) 오늘 날짜 */
.cal-day.is-today {
    border-color: rgba(99, 102, 241, 0.6);
    font-weight: 500;
    color: #818cf8;
}

/* (2) 메모가 있는 날짜 */
.cal-day.has-memo {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
    font-weight: 400; /* 다크 모드: 메모 있는 날짜도 과한 볼드 해제 */
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.25);
}

/* 라이트 모드 전용 달력 일자 두께 */
html[data-theme="light"] .cal-day {
    font-weight: 600;
}
html[data-theme="light"] .cal-day.is-today,
html[data-theme="light"] .cal-day.has-memo {
    font-weight: 700;
}

.cal-day.has-memo:hover {
    background: rgba(99, 102, 241, 0.35);
    border-color: #818cf8;
}

.memo-dot {
    position: absolute;
    bottom: 3px;
    width: 5px;
    height: 5px;
    background-color: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 4px #f59e0b;
    transition: var(--transition);
}

/* 카테고리별 달력 동그라미 감성 모노톤 회색 색상 */
.memo-dot.dot-all,
.memo-dot.dot-일반,
.memo-dot.dot-메모,
.memo-dot.dot-IDEA,
.memo-dot.dot-아이디어,
.memo-dot.dot-일기,
.memo-dot.dot-할일,
.memo-dot.dot-한일,
.memo-dot.dot-인물,
.memo-dot.dot-행사 {
    background-color: #64748b;
    box-shadow: 0 0 4px rgba(100, 116, 139, 0.6);
}

/* (3) 현재 선택된 날짜 */
.cal-day.is-selected {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}

.cal-day.is-selected .memo-dot {
    background-color: #ffffff !important;
    box-shadow: 0 0 4px #ffffff !important;
}

/* 달력 하단 범례 및 도구 버튼 */
.cal-footer {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1.15rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(51, 65, 85, 0.4);
    font-size: 0.85rem;
}

@media (min-width: 480px) {
    .cal-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.cal-legend {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    white-space: nowrap;
    font-weight: 400; /* 다크 모드: 범례 텍스트 볼드체 해제 */
}

.legend-count-highlight {
    font-weight: 600; /* 다크 모드: 800 -> 600으로 볼드 완화 */
    font-size: 0.96rem;
    color: var(--secondary, #d47a60); /* 기본 따뜻한 웜 테라코타 클레이 */
    margin-right: 0.15rem;
}

html[data-theme="light"] .cal-legend {
    color: #475569 !important;
    font-weight: 600;
}

html[data-theme="light"] .legend-count-highlight {
    color: #b85e46 !important; /* 라이트 모드: 선명한 테라코타 브라운 */
    font-weight: 800;
}

html:not([data-theme="light"]) .legend-count-highlight {
    color: #e0896f !important; /* 다크 모드: 눈이 편안하고 온화한 웜 테라코타 클레이 */
}

.legend-badge {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: rgba(88, 129, 87, 0.35);
    border: 1px solid #588157;
}

/* 카테고리별 범례 배지 모노톤 회색 색상 */
.legend-badge.badge-dot-all,
.legend-badge.badge-dot-일반,
.legend-badge.badge-dot-메모,
.legend-badge.badge-dot-IDEA,
.legend-badge.badge-dot-아이디어,
.legend-badge.badge-dot-일기,
.legend-badge.badge-dot-할일,
.legend-badge.badge-dot-인물 {
    background: rgba(100, 116, 139, 0.2);
    border-color: #94a3b8;
    color: #475569;
}

.cal-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-cal-tool {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: 0.32rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 400; /* 다크 모드: 기간조회, 올해 등의 텍스트 볼드체 해제 */
    cursor: pointer;
    transition: var(--transition);
}

.btn-cal-tool:hover {
    color: var(--text-primary);
    background: #38463c;
    border-color: #4a5c4d;
}

.btn-cal-tool.is-active {
    background: var(--primary) !important;
    color: #e2e8f0 !important;
    border-color: var(--primary) !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

html[data-theme="light"] .btn-cal-tool {
    font-weight: 600;
}

.btn-cal-reset {
    background: rgba(224, 109, 83, 0.15);
    color: #e2e8f0 !important;
    border: 1px solid rgba(224, 109, 83, 0.3);
}

.btn-cal-reset:hover {
    background: rgba(224, 109, 83, 0.25);
    color: #ffffff !important;
}

/* 기간 선택 모달 스타일 */
.range-modal-dialog {
    max-width: 420px;
    width: 90%;
}

.range-inputs-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0;
}

.range-inputs-wrap .form-group {
    flex: 1;
    margin-bottom: 0;
}

.range-inputs-wrap label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.range-separator {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    padding-top: 1.25rem;
}

html[data-theme="light"] .cal-footer {
    border-top-color: #e2e8f0;
}

html[data-theme="light"] .btn-cal-tool {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

html[data-theme="light"] .btn-cal-tool:hover {
    background: #e2e8f0;
    color: #0f172a;
}

html[data-theme="light"] .btn-cal-tool.is-active {
    background: var(--primary) !important;
    color: #ffffff !important;
}

/* 날짜 필터 선택 시 상단 알림 배너 (아래 카테고리 박스 및 배지 스타일과 완벽 통일) */
.date-filter-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.25rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease;
}

.date-filter-banner .banner-info {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-primary);
    font-size: 0.82rem;
}

.date-filter-banner .banner-info i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.date-filter-banner .banner-info strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* 전체메모보기 배지 (아래 카테고리 배지와 완벽히 동일한 스타일) */
.btn-clear-date {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f1f5f9;
    color: #475569 !important;
    border: 1px solid #cbd5e1;
    padding: 0.24rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.2;
}

.btn-clear-date:hover {
    background: #e2e8f0;
    color: #1e293b !important;
    border-color: #94a3b8;
}

.btn-clear-date i {
    font-size: 0.68rem;
    color: inherit;
}

/* [라이트 모드] 날짜 필터 상단 알림 배너 & 취소 버튼 - 아래 카테고리 박스 스타일과 통일 */
html[data-theme="light"] .date-filter-banner {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #2b2d2f !important;
}

html[data-theme="light"] .date-filter-banner .banner-info {
    color: #2b2d2f !important;
}

html[data-theme="light"] .date-filter-banner .banner-info i {
    color: #64748b !important;
}

html[data-theme="light"] .date-filter-banner .banner-info strong {
    color: #2b2d2f !important;
}

html[data-theme="light"] .date-filter-banner .banner-info span {
    color: #2b2d2f !important;
}

html[data-theme="light"] .btn-clear-date {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 500 !important;
}

html[data-theme="light"] .btn-clear-date:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    border-color: #94a3b8 !important;
}

/* ==========================================================================
   메모 작성 폼 (Write Card) - 첫 방문자도 어디서 시작할지 즉시 인지하도록 강조 테두리 적용
   ========================================================================= */
.write-card {
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.12) !important; /* 다크모드: 눈이 편안한 얇고 은은한 테두리 */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

.write-header {
    display: flex;
    margin-bottom: 0.85rem;
}

.category-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.category-radio input {
    display: none;
}

.category-radio .badge-opt {
    display: inline-block;
    padding: 0.22rem 0.75rem;
    min-width: 52px;
    text-align: center;
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.category-radio input:checked + .badge-opt {
    background: #4a544e;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid #334155;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* 본문 입력창 래퍼 및 가로/세로 정중앙 가이드 오버레이 */
.memo-input-wrapper {
    position: relative;
    width: 100%;
}

.memo-content-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    text-align: center;
    pointer-events: none;
    font-size: 1.15rem; /* 기존 대비 3pt 정도 키움 */
    font-weight: 700;
    color: #ffffff; /* 🌟 가이드 텍스트 흰색 */
    line-height: 1.4;
    letter-spacing: -0.01em;
    user-select: none;
    z-index: 2;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* PC 화면 (769px 이상): '내용을 직접 입력하거나...' 노출 */
.memo-content-guide .guide-text-pc {
    display: inline;
}
.memo-content-guide .guide-text-mobile {
    display: none;
}

/* 스마트폰 / 모바일 화면 (768px 이하): '★ 녹음이 끝나면 자동으로 입력됩니다.' 전용 노출 */
@media (max-width: 768px) {
    .memo-content-guide .guide-text-pc {
        display: none !important;
    }
    .memo-content-guide .guide-text-mobile {
        display: inline !important;
    }
}

/* 사용자가 직접 입력하거나 포커스/내용이 있을 때 오버레이 즉시 숨김 */
#memoContent:focus ~ .memo-content-guide,
#memoContent:focus-within ~ .memo-content-guide,
#memoContent:not(:placeholder-shown) ~ .memo-content-guide,
.memo-input-wrapper.is-focused .memo-content-guide,
.memo-input-wrapper.has-content .memo-content-guide {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 본문 입력창 상단 placeholder 완전 은닉 (중앙 오버레이로만 단독 노출) */
#memoContent::placeholder,
.form-control-content::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.form-control-content {
    resize: vertical;
    min-height: 140px; /* 기존 110px에서 약 1/4(25% 이상) 늘려 넉넉한 입력 공간 제공 */
    line-height: 1.6;
    /* 모바일 브라우저에서도 크고 선명하게 보이도록 우측 하단에 굵은 사선 리사이즈 아이콘 직접 렌더링 (다크모드 회색) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 22L22 6M12 22L22 12M18 22L22 18' stroke='%2394a3b8' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px bottom 4px;
    background-size: 24px 24px;
}

/* 라이트 모드에서의 리사이즈 사선 아이콘 (차분하고 선명한 슬레이트 그레이) */
html[data-theme="light"] .form-control-content {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 22L22 6M12 22L22 12M18 22L22 18' stroke='%2364748b' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 4px bottom 4px !important;
    background-size: 24px 24px !important;
}

/* ==========================================================================
   텍스트 영역 크기 조절 손잡이 (Textarea Resize Handle 커스텀)
   - 스마트폰 화면에서도 손가락으로 잡기 쉽고 선명하게 보이도록 대폭 확대
   ========================================================================== */
.form-control-content::-webkit-resizer,
textarea::-webkit-resizer {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 22L22 6M12 22L22 12M18 22L22 18' stroke='%2394a3b8' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px bottom 2px;
    background-size: 26px 26px;
    width: 36px;
    height: 36px;
    cursor: se-resize;
}

html[data-theme="light"] .form-control-content::-webkit-resizer,
html[data-theme="light"] textarea::-webkit-resizer {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 22L22 6M12 22L22 12M18 22L22 18' stroke='%2364748b' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 26px 26px;
    width: 36px;
    height: 36px;
}

/* ==========================================================================
   음성 녹음 & STT 컨트롤 패널 (Recorder Panel)
   ========================================================================== */
.recorder-panel {
    background: var(--bg-secondary, transparent);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 0.85rem;
    box-shadow: none;
}

.recorder-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 스페이스 바 2번 단축키 안내 문구 (아이콘 없이 깔끔한 텍스트 뱃지) */
.record-shortcut-hint {
    font-size: 0.88rem;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.28rem 0.75rem;
    border-radius: 9999px;
    letter-spacing: -0.01em;
    user-select: none;
    white-space: nowrap;
    line-height: 1.4;
    font-weight: 500;
}

@media (max-width: 640px) {
    .record-shortcut-hint {
        display: none;
    }
}

/* 음성 녹음 시작 버튼 (눈이 편안한 은은한 소프트 보라 톤) */
.btn-record {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: linear-gradient(135deg, #4b4f74 0%, #585d87 100%);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important; /* 노란색 테두리 제거 */
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important; /* 번쩍이는 노란색 네온 글로우 제거 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.btn-record:hover {
    background: linear-gradient(135deg, #545982 0%, #626896 100%);
    transform: translateY(-1.5px);
    border-color: rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
}

.btn-record:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 마이크 아이콘 원형 포인트 */
.btn-record .record-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    font-size: 0.85rem;
    color: #ffffff;
    transition: transform 0.2s ease;
}

.btn-record:hover .record-icon {
    transform: scale(1.1);
}

/* 녹음 진행 중 (강렬한 레드 펄스) */
.btn-record.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border: 2.5px solid #fecaca !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45) !important;
    animation: pulse 1.5s infinite;
}

.btn-record.recording .record-icon {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 녹음 타이머(위) 및 준비완료 텍스트(아래) 상하 수직 배치 */
.record-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 65px;
    text-align: center;
}

.record-timer {
    font-family: monospace;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

.stt-status-text {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.1;
    color: #a5b4fc;
}

html[data-theme="light"] .stt-status-text {
    color: #4f46e5 !important;
}

.audio-preview-container {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.audio-preview-container audio {
    flex: 1;
    height: 38px;
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: #fff;
}

/* ==========================================================================
   작성 폼 푸터 및 버튼
   ========================================================================== */
.write-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.attach-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-tool:hover {
    color: var(--text-primary);
    background: #475569;
}

.file-count-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* ==========================================================================
   메모 작성창 '저장' 버튼 (노란색 박스 크기 확대)
   ========================================================================== */
.btn-save {
    min-width: 110px !important;
    height: 38px !important;
    padding: 0.52rem 1.8rem !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==========================================================================
   카테고리 칩, 탭, 배지 및 드롭다운 앞 이모지 전역 제거
   ========================================================================== */
.cat-icon-emoji,
.category-radio .badge-opt .cat-icon-emoji,
.tab-btn .cat-icon-emoji,
.btn-cat-badge .cat-icon-emoji,
.cat-drop-item .cat-icon-emoji {
    display: none !important;
}

.memo-input-wrapper.drag-over {
    border-color: var(--primary, #3b82f6) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
    background-color: rgba(59, 130, 246, 0.04) !important;
}

.selected-files-list {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-tag {
    background: var(--bg-input);
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.file-tag .file-thumb {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.file-tag .file-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-tag .file-size-badge {
    font-size: 0.7rem;
    color: var(--text-muted, #94a3b8);
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 4px;
    border-radius: 3px;
}

.file-tag .btn-remove-file {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    padding: 0 3px;
    margin-left: 2px;
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, transform 0.15s ease;
}

.file-tag .btn-remove-file:hover {
    color: #ef4444;
    transform: scale(1.2);
}

/* ==========================================================================
   상단 필터 & 검색 통합 큰 카드 박스 (.filter-card)
   - 아래 메모 입력 카드(.write-card)와 완벽히 동일한 카드 패널 디자인
   ========================================================================== */
.filter-card {
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
    transition: var(--transition);
}

html[data-theme="light"] .filter-card {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

.memo-filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.filter-controls-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.sort-control-wrap {
    flex-shrink: 0;
}

.sort-select {
    padding: 0.62rem 2.2rem 0.62rem 0.85rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1.15rem;
    transition: var(--transition);
}

.sort-select:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

.sort-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

html[data-theme="light"] .sort-select {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.65rem 1rem 0.65rem 2.6rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* 카테고리 탭 (기본 다크모드: 눈이 편안한 다크 포레스트 톤) */
.tab-btn {
    padding: 0.24rem 0.75rem;
    min-width: 48px;
    text-align: center;
    border-radius: 9999px;
    background: #232c25;
    color: #94a3b8;
    border: 1px solid #3b473d;
    font-size: 0.72rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: #cbd5e1;
    background: #2c372f;
    border-color: #4c5d4f;
}

.tab-btn.active {
    background: #38463c !important;
    color: #e2e8f0 !important;
    border-color: #588157 !important;
    font-weight: 700 !important;
}

/* 라이트 모드 전용 카테고리 탭 */
html[data-theme="light"] .tab-btn {
    background: #f4efeb;
    color: #5a625b;
    border: 1px solid #e6e0d6;
}

html[data-theme="light"] .tab-btn:hover {
    color: #2b2d2f;
    background: #ede6de;
    border-color: #c8c0b5;
}

html[data-theme="light"] .tab-btn.active {
    background: #3a5a40 !important;
    color: #ffffff !important;
    border-color: #3a5a40 !important;
}

/* ==========================================================================
   메모 카드 리스트 그리드 (Memo Grid)
   ========================================================================== */
.memo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 600px) and (max-width: 899px) {
    .memo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .memo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.memo-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.memo-card:hover {
    border-color: #475569;
    box-shadow: var(--shadow-md);
}

.card-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.memo-badge {
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.26rem 0.75rem;
    border-radius: 9999px;
    background: var(--bg-input);
    color: var(--text-secondary);
    line-height: 1.25;
}

/* 카테고리 배지 클릭 드롭다운 메뉴 스타일 (상단 배지와 크기/폰트 완벽 동기화) */
.badge-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.btn-cat-badge {
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.26rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.25;
    transition: var(--transition);
    font-family: inherit;
}

.btn-cat-badge:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cat-badge-caret {
    font-size: 0.72rem;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.badge-dropdown-wrap.is-open .cat-badge-caret {
    transform: rotate(180deg);
}

.cat-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 120;
    min-width: 135px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    padding: 0.4rem;
    animation: fadeIn 0.15s ease-out;
}

html[data-theme="light"] .cat-dropdown-menu {
    background: #ffffff !important;
    border: 1.5px solid #e6e0d6 !important;
    box-shadow: 0 12px 30px -4px rgba(66, 56, 42, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

.badge-dropdown-wrap.is-open .cat-dropdown-menu {
    display: block;
}

.cat-drop-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.cat-drop-item:hover {
    background: rgba(88, 129, 87, 0.18);
    color: var(--primary);
}

.cat-drop-item.is-active {
    background: #334155;
    color: #ffffff;
    font-weight: 700;
}

/* 🌿 [라이트 모드] 카테고리 변경 팝업 메뉴 글자 선명화 */
html[data-theme="light"] .cat-drop-item {
    color: #2b2d2f !important;
}

html[data-theme="light"] .cat-drop-item:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

html[data-theme="light"] .cat-drop-item.is-active {
    background: #334155 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* 카테고리별 테마 배지 색상 (다크 모드 기본: 모노톤 회색) */
.badge-메모,
.badge-일반,
.badge-IDEA,
.badge-아이디어,
.badge-일기,
.badge-할일,
.badge-한일,
.badge-인물,
.badge-행사 {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* 🌿 [라이트 모드] 카테고리 배지: 화려한 색을 완전히 뺀 단정하고 조화로운 모노톤 회색 */
html[data-theme="light"] .badge-메모,
html[data-theme="light"] .badge-일반,
html[data-theme="light"] .badge-IDEA,
html[data-theme="light"] .badge-아이디어,
html[data-theme="light"] .badge-일기,
html[data-theme="light"] .badge-할일,
html[data-theme="light"] .badge-한일,
html[data-theme="light"] .badge-인물,
html[data-theme="light"] .badge-행사 {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

/* ==========================================================================
   카테고리 텍스트 하단 굵은 언더라인 바 (카테고리별 시그니처 색상)
   - 캡슐 배경은 모노톤으로 단정하게 유지하고,
   - 글자(문자 넓이) 바로 밑에 3.5px 굵기의 선명한 라인을 배치하여 직관적 구분 지원
   - 대상: ① 메모 카드 배지(.badge-text) ② 작성 폼 라디오 칩(.radio-cat-text) ③ 필터 탭(.tab-cat-text)
   ========================================================================== */
.memo-badge .badge-text,
.btn-cat-badge .badge-text,
.radio-cat-text,
.tab-cat-text {
    position: relative;
    display: inline-block;
    padding-bottom: 2px;
    border-bottom: 2.5px solid #64748b; /* 기본 보조색 */
    border-radius: 2px;
    line-height: 1.15;
    transition: border-color 0.2s ease;
}

/* 1. 메모 / 일반 / Memo: 소프트 테라코타 레드 (#e06d53) */
.badge-메모 .badge-text,
.badge-일반 .badge-text,
.badge-Memo .badge-text,
.category-radio input[value="메모"] + .badge-opt .radio-cat-text,
.category-radio input[value="Memo"] + .badge-opt .radio-cat-text,
.tab-btn[data-cat="메모"] .tab-cat-text,
.tab-btn[data-cat="Memo"] .tab-cat-text {
    border-bottom-color: #e06d53 !important;
}

/* 2. IDEA / 아이디어 / Idea: 소프트 웜 앰버 (#d99b26) */
.badge-IDEA .badge-text,
.badge-아이디어 .badge-text,
.badge-Idea .badge-text,
.category-radio input[value="IDEA"] + .badge-opt .radio-cat-text,
.category-radio input[value="Idea"] + .badge-opt .radio-cat-text,
.tab-btn[data-cat="IDEA"] .tab-cat-text,
.tab-btn[data-cat="Idea"] .tab-cat-text {
    border-bottom-color: #d99b26 !important;
}

/* 3. 일기 / Diary: 웜 테라코타 클레이 (#d47a60) */
.badge-일기 .badge-text,
.badge-Diary .badge-text,
.category-radio input[value="일기"] + .badge-opt .radio-cat-text,
.category-radio input[value="Diary"] + .badge-opt .radio-cat-text,
.tab-btn[data-cat="일기"] .tab-cat-text,
.tab-btn[data-cat="Diary"] .tab-cat-text {
    border-bottom-color: #d47a60 !important;
}

/* 4. 할일 / Todo: 포레스트 세이지 (#588157) */
.badge-할일 .badge-text,
.badge-Todo .badge-text,
.category-radio input[value="할일"] + .badge-opt .radio-cat-text,
.category-radio input[value="Todo"] + .badge-opt .radio-cat-text,
.tab-btn[data-cat="할일"] .tab-cat-text,
.tab-btn[data-cat="Todo"] .tab-cat-text {
    border-bottom-color: #588157 !important;
}

/* 5. 한일 / Done: 뮤티드 슬레이트 블루 (#5b8ec0) */
.badge-한일 .badge-text,
.badge-Done .badge-text,
.category-radio input[value="한일"] + .badge-opt .radio-cat-text,
.category-radio input[value="Done"] + .badge-opt .radio-cat-text,
.tab-btn[data-cat="한일"] .tab-cat-text,
.tab-btn[data-cat="Done"] .tab-cat-text {
    border-bottom-color: #5b8ec0 !important;
}

/* 6. 인물 / Person: 소프트 뮤티드 퍼플 (#9d7dc7) */
.badge-인물 .badge-text,
.badge-Person .badge-text,
.category-radio input[value="인물"] + .badge-opt .radio-cat-text,
.category-radio input[value="Person"] + .badge-opt .radio-cat-text,
.tab-btn[data-cat="인물"] .tab-cat-text,
.tab-btn[data-cat="Person"] .tab-cat-text {
    border-bottom-color: #9d7dc7 !important;
}

/* 7. 행사 / Event: 뮤티드 틸 (#4e9b91) */
.badge-행사 .badge-text,
.badge-Event .badge-text,
.category-radio input[value="행사"] + .badge-opt .radio-cat-text,
.category-radio input[value="Event"] + .badge-opt .radio-cat-text,
.tab-btn[data-cat="행사"] .tab-cat-text,
.tab-btn[data-cat="Event"] .tab-cat-text {
    border-bottom-color: #4e9b91 !important;
}

.memo-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-card-share,
.btn-card-edit,
.btn-card-del {
    background: none;
    border: none;
    color: var(--text-muted) !important; /* 🌟 공유 및 도구 아이콘 회색 */
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem 0.35rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-card-share i,
.btn-card-edit i,
.btn-card-del i {
    color: var(--text-muted) !important; /* 🌟 아이콘 색상 명시적 회색 적용 */
}

.btn-card-share:hover i,
.btn-card-share:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.08);
}

.btn-card-edit:hover {
    color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.15);
}

.btn-card-del:hover {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.15);
}

/* 인라인 메모 수정 폼 스타일 */
.memo-edit-mode {
    margin-top: 0.5rem;
    animation: fadeIn 0.2s ease-out;
}

.memo-edit-mode .form-control {
    background-color: rgba(15, 23, 42, 0.8);
}

.edit-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-edit-cancel {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-edit-cancel:hover {
    background: #475569;
    color: var(--text-primary);
}

.btn-edit-save {
    padding: 0.45rem 1rem !important;
    font-size: 0.85rem !important;
}

.memo-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.memo-body-wrapper {
    position: relative;
}

.memo-body {
    font-size: calc(1.15rem * var(--fs-memo_body-scale, 1));
    color: var(--text-primary);
    line-height: 1.65;
    word-break: break-word;
    transition: max-height 0.3s ease;
}

.memo-body.collapsible.is-collapsed {
    max-height: 135px; /* 약 5~6줄 높이 */
    overflow: hidden;
    position: relative;
}

/* 접힌 상태일 때 하단 페이드아웃 그라데이션 */
.memo-body.collapsible.is-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: linear-gradient(to bottom, rgba(30, 41, 59, 0) 0%, var(--bg-card) 100%);
    pointer-events: none;
}

/* 더보기 / 접기 버튼 중앙 정렬 바 */
.memo-collapse-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 0.5rem;
}

/* 더보기 / 접기 버튼 스타일 */
.btn-memo-collapse {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-memo-collapse:hover {
    background: rgba(99, 102, 241, 0.16);
    color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-memo-collapse i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

/* 라이트 모드에서의 페이드아웃 그라데이션 보정 */
html[data-theme="light"] .memo-body.collapsible.is-collapsed::after {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, var(--bg-card) 100%);
}

html[data-theme="light"] .btn-memo-collapse {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--primary);
}

html[data-theme="light"] .btn-memo-collapse:hover {
    background: rgba(99, 102, 241, 0.12);
}

/* ==========================================================================
   미디어 렌더링 영역 (Audio, Image, Video)
   ========================================================================== */
.media-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.media-audio {
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-color);
}

.audio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.audio-header-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-bullet {
    font-size: 0.9rem;
    line-height: 1;
    color: var(--text-muted);
    flex-shrink: 0;
}

.media-item-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.35rem;
}

.btn-att-del {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-att-del:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

.media-audio audio {
    width: 100%;
    height: 36px;
}

.media-image img {
    max-width: 100%;
    max-height: 360px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.media-image img:hover {
    transform: scale(1.01);
}

.media-video video {
    width: 100%;
    max-height: 380px;
    border-radius: var(--radius-md);
    background: #000;
}

/* ==========================================================================
   일반 문서 및 텍스트 첨부파일 카드 (.media-file)
   ========================================================================== */
.media-file {
    width: 100%;
}

.file-attachment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    gap: 0.75rem;
    transition: all 0.2s ease;
}
.file-attachment-card:hover {
    border-color: #3b82f6;
    background: var(--bg-hover);
}
html[data-theme="light"] .file-attachment-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}
html[data-theme="light"] .file-attachment-card:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.file-info-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.file-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    font-size: 1.05rem;
    flex-shrink: 0;
}
html[data-theme="light"] .file-icon-box {
    background: #eff6ff;
    color: #2563eb;
}

.file-text-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-download-link {
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}
.file-download-link:hover {
    color: #38bdf8;
    text-decoration: underline;
}
html[data-theme="light"] .file-download-link {
    color: #1e293b;
}
html[data-theme="light"] .file-download-link:hover {
    color: #1d4ed8;
}

.file-size-text {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.file-action-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.btn-att-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-att-download:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
}

/* ==========================================================================
   빈 상태 (Empty State)
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
}

.empty-icon {
    font-size: 2.8rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.empty-state h4 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ==========================================================================
   로그인 페이지 (Auth Card)
   ========================================================================== */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border: 1px solid transparent;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-block {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.8rem 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.auth-footer-notice {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* ==========================================================================
   인증 폼 컨트롤 및 고대비 플레이스홀더 (다크모드 시인성 대폭 강화)
   ========================================================================== */
.auth-form .form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.auth-form label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-form .form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: var(--transition);
}

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background-color: var(--bg-card);
}

/* 🌟 입력창 안내 문자(Placeholder) 흰색 밝기 대폭 상향 (다크모드 고대비 가독성 확보) */
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(241, 245, 249, 0.88) !important; /* 선명하고 밝은 화이트 (약 88%) */
    opacity: 1 !important;
    font-weight: 400;
}

/* 라이트 모드일 때의 플레이스홀더 */
html[data-theme="light"] .form-control::placeholder,
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: #94a3b8 !important;
}

/* 폼 보조 안내 텍스트(small) 가독성 향상 */
.auth-form small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: #cbd5e1 !important; /* 다크모드에서 선명한 밝은 실버 그레이 */
    line-height: 1.45;
}

html[data-theme="light"] .auth-form small {
    color: #475569 !important; /* 라이트모드 보조 안내문 선명화 */
}

/* ==========================================================================
   회원가입/인증 배지 및 보안 안심 배너 (다크모드 & 라이트모드 양방향 최적화)
   ========================================================================== */
.auth-header-badges {
    margin-top: 0.6rem;
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 700;
}

/* 기본 (다크모드) 배지 스타일 */
.auth-badge-beta {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    border: 1px solid rgba(165, 180, 252, 0.45);
}

.auth-badge-auto {
    background: rgba(16, 185, 129, 0.22);
    color: #a7f3d0;
    border: 1px solid rgba(52, 211, 153, 0.45);
}

.auth-badge-pending {
    background: rgba(245, 158, 11, 0.22);
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.45);
}

/* 🔒 보안 및 프라이버시 안심 배너 (다크모드 기본) */
.auth-privacy-banner {
    margin: 1.25rem 0 1.5rem 0;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.45);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    text-align: left;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.auth-privacy-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #34d399;
    font-weight: 800;
    font-size: 0.96rem;
    margin-bottom: 0.5rem;
}

.auth-privacy-desc {
    margin: 0;
    font-size: 0.86rem;
    color: #f1f5f9;
    line-height: 1.6;
    word-break: keep-all;
}

.auth-privacy-desc .hl-beta {
    color: #fde047;
    font-weight: 700;
    text-decoration: underline;
}

.auth-privacy-desc .hl-admin {
    color: #38bdf8;
    font-weight: 800;
    text-decoration: underline;
}

/* ☀️ 라이트 모드 (Light Mode) 전용 고대비 스타일 - 선명도 극대화 */
html[data-theme="light"] .auth-badge-beta {
    background: #e0e7ff !important;
    color: #3730a3 !important; /* 선명하고 짙은 인디고 */
    border: 1px solid #c7d2fe !important;
}

html[data-theme="light"] .auth-badge-auto {
    background: #d1fae5 !important;
    color: #065f46 !important; /* 선명하고 짙은 에메랄드 */
    border: 1px solid #a7f3d0 !important;
}

html[data-theme="light"] .auth-badge-pending {
    background: #fef3c7 !important;
    color: #92400e !important; /* 선명하고 짙은 앰버 */
    border: 1px solid #fde68a !important;
}

html[data-theme="light"] .auth-privacy-banner {
    background: #ecfdf5 !important; /* 깨끗하고 부드러운 민트 배경 */
    border: 1px solid #6ee7b7 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1) !important;
}

html[data-theme="light"] .auth-privacy-title {
    color: #047857 !important; /* 짙은 포레스트 에메랄드 */
}

html[data-theme="light"] .auth-privacy-desc {
    color: #0f172a !important; /* 짙은 슬레이트 블랙 (최고의 가독성) */
}

html[data-theme="light"] .auth-privacy-desc .hl-beta {
    color: #b45309 !important; /* 짙은 앰버 골드 */
    font-weight: 800 !important;
}

html[data-theme="light"] .auth-privacy-desc .hl-admin {
    color: #0369a1 !important; /* 짙은 오션 블루 */
    font-weight: 800 !important;
}

/* 라이트 모드 텍스트 박스 플레이스홀더 및 라벨 */
html[data-theme="light"] .auth-form .form-control {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .form-control::placeholder,
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: #64748b !important; /* 라이트모드에서도 흐리지 않고 선명한 플레이스홀더 */
}

html[data-theme="light"] .auth-footer-notice {
    color: #64748b !important;
}

.label-optional {
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: normal;
}

html[data-theme="light"] .label-optional {
    color: #64748b !important;
}

/* 푸터 */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(51, 65, 85, 0.4);
}

/* ==========================================================================
   🍁 한국의 가을 단풍 풍경 랜딩페이지 스타일 (배경 100% 온전 감상 뷰)
   ========================================================================== */
.landing-body {
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    background-color: #0b0f19;
    color: #ffffff;
    min-height: 100vh;
    height: auto;
    -webkit-overflow-scrolling: touch;
}

.landing-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: -2;
}

.landing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.0) 40%,
        rgba(0, 0, 0, 0.0) 70%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

.landing-minimal-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 3.5rem;
    position: relative;
    z-index: 10;
}

.landing-header {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.landing-login-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.landing-login-link:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.landing-bottom-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out;
}

.btn-landing-enter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.88);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.68rem 1.6rem;
    border-radius: 9999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: var(--transition);
    letter-spacing: 0.3px;
    text-decoration: none;
}

.btn-landing-enter:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(255, 255, 255, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

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

/* ==========================================================================
   모바일 최적화 미디어 쿼리 (카테고리 탭 & 라디오 슬림화)
   ========================================================================== */
@media (max-width: 640px) {
    .category-tabs {
        gap: 0.35rem;
    }
    .tab-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.8rem;
    }
    .category-selector {
        gap: 0.35rem;
    }
    .category-radio .badge-opt {
        padding: 0.3rem 0.6rem;
        font-size: 0.78rem;
    }
}

/* ==========================================================================
   공유 버튼 & 공유 모달 스타일
   ========================================================================== */
.btn-card-share {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-card-share:hover {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.15);
}

/* 공유 활성화 상태일 때 눈에 띄는 하이라이트 */
.btn-card-share.is-shared {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.15);
}

/* 공유 모달 백드롭 */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-title i {
    color: #06b6d4;
}

.btn-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.btn-modal-close:hover {
    color: #ffffff;
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.share-url-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-url-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: #38bdf8;
    font-size: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    outline: none;
}

.btn-copy-url {
    white-space: nowrap;
    padding: 0.65rem 1.1rem;
    font-size: 0.85rem;
}

.share-status-alert {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #34d399;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    text-align: center;
    animation: fadeIn 0.2s ease-out;
}

.share-toggle-area {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.btn-share-off {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.btn-share-off:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* ==========================================================================
   환경설정 슬라이드 드로어 (Settings Drawer) & 딤 오버레이
   ========================================================================== */
.settings-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.settings-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.settings-drawer,
.menu-drawer {
    position: fixed;
    top: 0;
    right: -380px;
    width: 340px;
    max-width: 85vw;
    height: 100%;
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-drawer.is-open,
.menu-drawer.is-open {
    right: 0;
}

.settings-header,
.menu-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.settings-title,
.menu-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.settings-title i,
.menu-title i {
    color: var(--primary);
}

.btn-settings-close,
.btn-menu-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-settings-close:hover,
.btn-menu-close:hover {
    color: var(--text-primary);
    background: var(--bg-input);
}

.settings-body,
.menu-body {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

/* ==========================================================================
   전체 메뉴 드로어 전용 스타일 (.menu-drawer)
   ========================================================================== */
.menu-user-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.menu-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-input);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 1.3rem;
}

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

.menu-user-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.menu-user-name {
    font-size: 0.98rem;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-user-role {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    width: fit-content;
}

.menu-user-role.role-admin {
    background: #fef3c7;
    color: #b45309;
}

.menu-user-role.role-member {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* 전체 메뉴 내비게이션 리스트 */
.menu-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.menu-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    font-family: inherit;
}

.menu-nav-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.menu-item-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    overflow: hidden;
}

.menu-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: #f1f5f9;
    color: #64748b;
    transition: var(--transition);
}

/* [사용자 프로필과 로그아웃 제외 모두 모던한 회색 톤 적용] */
.menu-item-icon.icon-admin,
.menu-item-icon.icon-board,
.menu-item-icon.icon-about,
.menu-item-icon.icon-shortcut,
.menu-item-icon.icon-trash,
.menu-item-icon.icon-login {
    background: #f1f5f9;
    color: #64748b;
}

html[data-theme="dark"] .menu-item-icon.icon-admin,
html[data-theme="dark"] .menu-item-icon.icon-board,
html[data-theme="dark"] .menu-item-icon.icon-about,
html[data-theme="dark"] .menu-item-icon.icon-shortcut,
html[data-theme="dark"] .menu-item-icon.icon-trash,
html[data-theme="dark"] .menu-item-icon.icon-login {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

/* [로그아웃 아이콘만 로즈/레드 포인트 유지] */
.menu-item-icon.icon-logout {
    background: #fee2e2;
    color: #ef4444;
}

html[data-theme="dark"] .menu-item-icon.icon-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.menu-item-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.menu-item-text strong {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
}

.menu-item-text small {
    font-size: 0.77rem;
    color: var(--text-secondary);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-item-arrow {
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.menu-nav-item:hover .menu-item-arrow {
    transform: translateX(2px);
    color: var(--primary);
}

.menu-item-right-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-nav-item.item-logout {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.04);
}

.menu-nav-item.item-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.settings-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.settings-icon {
    font-size: 1.15rem;
    color: var(--primary);
    margin-top: 0.15rem;
    width: 22px;
    text-align: center;
}

.settings-desc strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.settings-desc small {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    line-height: 1.35;
}

.settings-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.btn-setting-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-setting-opt:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-setting-opt.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.settings-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0;
}

/* ==========================================================================
   글자 크기 개별 조절 UI 스타일 (Font Size Settings)
   ========================================================================== */
.settings-label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-label-left {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    flex: 1;
}

.settings-label-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-fs-reset {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.28rem 0.55rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
}

.btn-fs-reset:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.btn-fs-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-fs-toggle i {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-fs-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--bg-input);
}

/* 펼쳐졌을 때 화살표 180도 회전(위쪽을 가리킴) */
.btn-fs-toggle.is-expanded i {
    transform: rotate(180deg);
    color: var(--primary);
}

.font-size-settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.25rem;
    animation: fadeIn 0.25s ease;
}

/* 기본 접힘 상태 */
.font-size-settings-list.is-collapsed {
    display: none;
}

.fs-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.fs-row-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.fs-row-label i {
    color: var(--primary);
    width: 16px;
    text-align: center;
}

.fs-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-card);
    padding: 0.15rem 0.25rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
}

.btn-fs-step {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: var(--bg-input);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
}

.btn-fs-step:hover:not(:disabled) {
    background: var(--primary);
    color: #ffffff;
}

.btn-fs-step:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.fs-scale-badge {
    min-width: 44px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569 !important;
    background: #f1f5f9;
    border-radius: 9999px;
    padding: 0.1rem 0.4rem;
}

/* 라이트 모드 대응 */
html[data-theme="light"] .fs-setting-row {
    background: #f8fafc;
    border-color: #e2e8f0;
}
html[data-theme="light"] .fs-stepper {
    background: #ffffff;
    border-color: #cbd5e1;
}
html[data-theme="light"] .btn-fs-step {
    background: #f1f5f9;
    color: #334155;
}
html[data-theme="light"] .btn-fs-step:hover:not(:disabled) {
    background: #475569;
    color: #ffffff;
}
html[data-theme="light"] .fs-scale-badge {
    color: #475569 !important;
    background: #f1f5f9;
}
html[data-theme="light"] .btn-fs-reset {
    border-color: #cbd5e1;
    color: #64748b;
}
html[data-theme="light"] .btn-fs-toggle {
    border-color: #cbd5e1;
    color: #475569;
}
html[data-theme="light"] .btn-fs-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: #f1f5f9;
}

/* ==========================================================================
   글자 크기 배율 동적 적용 (6대 핵심 영역)
   ========================================================================== */
/* 1. 달력 컨트롤 */
.calendar-card .cal-month-year {
    font-size: calc(1.35rem * var(--fs-calendar-scale)) !important;
}
.calendar-card .cal-weekdays span {
    font-size: calc(0.85rem * var(--fs-calendar-scale)) !important;
}
.calendar-card .cal-day {
    font-size: calc(1.15rem * var(--fs-calendar-scale)) !important;
}
.calendar-card .cal-legend {
    font-size: calc(0.85rem * var(--fs-calendar-scale)) !important;
}
.calendar-card .legend-count-highlight {
    font-size: calc(0.96rem * var(--fs-calendar-scale)) !important;
}
.calendar-card .btn-cal-tool {
    font-size: calc(0.8rem * var(--fs-calendar-scale)) !important;
}

/* 2. 검색창 */
.search-input {
    font-size: calc(0.95rem * var(--fs-search-scale)) !important;
}
.sort-select {
    font-size: calc(0.85rem * var(--fs-search-scale)) !important;
}
.filter-card .btn-search-clear {
    font-size: calc(0.8rem * var(--fs-search-scale)) !important;
}

/* 3. 카테고리 (상단 탭과 메모 카드 배지 완벽 동일 폰트 크기 동기화) */
.category-tabs .tab-btn,
.btn-cat-badge,
.memo-badge,
.btn-cat-badge .badge-text {
    font-size: calc(0.88rem * var(--fs-category-scale, 1)) !important;
}
.category-selector .badge-opt {
    font-size: calc(0.85rem * var(--fs-category-scale, 1)) !important;
}
.badge-category {
    font-size: calc(0.88rem * var(--fs-category-scale, 1)) !important;
}

/* 4. 메모 제목 (최대 200% 확장 지원) */
#memoTitle {
    font-size: calc(1.05rem * var(--fs-title-scale)) !important;
}
.memo-title,
.memo-item .memo-title {
    font-size: calc(1.1rem * var(--fs-title-scale)) !important;
}

/* 5. 메모 입력창 */
#memoContent {
    font-size: calc(0.95rem * var(--fs-content-scale)) !important;
}

/* 6. 메모 본문 (메모 카드 본문 글자 크기, 기본 +3pt 확대 및 최대 200% 지원) */
.memo-body,
.memo-body p,
.memo-item .memo-text {
    font-size: calc(1.15rem * var(--fs-memo_body-scale)) !important;
    line-height: 1.65;
}

/* 7. AI 핵심 요약 (요약 말풍선 글자 크기, 기본 +2pt 확대 및 최대 200% 지원) */
.ai-summary-content {
    font-size: calc(1.05rem * var(--fs-ai_summary-scale, 1)) !important;
    line-height: 1.65;
}
.ai-summary-edit-textarea {
    font-size: calc(1.02rem * var(--fs-ai_summary-scale, 1)) !important;
}

/* 8. 단추 (버튼류) */
.btn-record,
.btn-submit,
.btn-tool,
.btn-primary,
.btn-danger,
.btn-manage-categories {
    font-size: calc(0.9rem * var(--fs-button-scale));
}
.btn-record #recordLabel {
    font-size: calc(0.95rem * var(--fs-button-scale));
}
.btn-submit span {
    font-size: calc(0.95rem * var(--fs-button-scale));
}

@media (max-width: 480px) {
    .settings-drawer,
    .menu-drawer {
        width: 85vw;
    }
}

/* ==========================================================================
   카테고리 관리 메뉴 버튼 & 전용 모달 팝업 (Category Modal)
   ========================================================================== */
.btn-manage-categories {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-manage-categories:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.category-modal-backdrop {
    z-index: 1200 !important;
}

.category-modal-dialog {
    max-width: 520px;
    width: 95%;
    border-radius: var(--radius-lg);
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    padding: 1.5rem;
}

html:not([data-theme="light"]) .category-modal-dialog {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.category-modal-body {
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 새 카테고리 추가 박스 (배경을 깔끔한 모노톤 회색으로 통일) */
.add-cat-card {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1rem;
}

html:not([data-theme="light"]) .add-cat-card {
    background: #28322a;
    border: 1px solid #424e45;
}

.add-cat-header {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.add-cat-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.add-cat-inputs {
    display: flex;
    gap: 0.5rem;
}

.input-cat-name,
.input-cat-name-en {
    flex: 1;
    padding: 0.6rem 0.85rem;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-primary);
    transition: var(--transition);
}

html:not([data-theme="light"]) .input-cat-name,
html:not([data-theme="light"]) .input-cat-name-en {
    background: #354038;
    border-color: #424e45;
}

.input-cat-name:focus,
.input-cat-name-en:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(88, 129, 87, 0.2);
}

.add-cat-color-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.2rem 0;
}

.color-picker-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.color-presets {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.color-dot:hover {
    transform: scale(1.2);
}

.color-dot.is-active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--text-primary, #ffffff), 0 2px 5px rgba(0, 0, 0, 0.3);
    transform: scale(1.15);
}

.color-custom-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all 0.15s ease;
    margin-left: 0.2rem;
}

html:not([data-theme="light"]) .color-custom-wrap {
    background: rgba(255, 255, 255, 0.12);
}

.color-custom-wrap:hover {
    transform: scale(1.15);
    color: var(--primary);
}

.input-color-native {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: none;
    padding: 0;
}

.btn-add-cat {
    padding: 0.65rem;
    font-size: 0.92rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: var(--radius-sm);
}

/* 카테고리 목록 항목 내 시그니처 색상 도트 */
.cat-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 카테고리 목록 리스트 */
.cat-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* 카테고리 각 항목 카드 (배경을 깔끔한 모노톤 회색으로 통일) */
.cat-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

html:not([data-theme="light"]) .cat-item-row {
    background: #28322a;
    border: 1px solid #424e45;
}

.cat-item-row:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

html:not([data-theme="light"]) .cat-item-row:hover {
    background: #313d34;
    border-color: var(--primary);
}

.cat-item-info {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

.cat-item-names {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cat-name-ko {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cat-name-en {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cat-item-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-cat-order,
.btn-cat-edit,
.btn-cat-del {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.btn-cat-order:hover:not(:disabled) {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-cat-order:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-cat-edit:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.btn-cat-del:hover:not(:disabled) {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

.btn-cat-del:disabled {
    opacity: 0.25 !important;
    cursor: not-allowed !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
    color: var(--text-muted) !important;
}

/* 카테고리 인라인 수정 모드 */
.cat-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: 100%;
    padding: 0.2rem 0;
}

.edit-cat-color-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px dashed var(--border-color);
    flex-wrap: wrap;
}

.edit-cat-inputs-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
}

.edit-cat-inputs-row .edit-cat-name,
.edit-cat-inputs-row .edit-cat-name-en {
    flex: 1;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    min-width: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .add-cat-inputs {
        flex-direction: column;
    }
}

/* ==========================================================================
   무한 스크롤 (Infinite Scroll) 센티널 & 페이드인 효과
   ========================================================================== */
.scroll-loading-sentinel {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0;
    width: 100%;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.scroll-spinner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
}

.fade-in {
    animation: fadeInMemoCard 0.35s ease-out forwards;
}

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

/* ==========================================================================
   프로필 사진 관리 모달 팝업 (Profile Modal)
   ========================================================================== */
.profile-modal-backdrop {
    z-index: 1250 !important;
}

.profile-modal-dialog {
    max-width: 420px;
    width: 90%;
    text-align: center;
    border-radius: var(--radius-lg);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
}

.profile-modal-body {
    padding: 1.25rem 0 1.25rem 0;
}

.profile-preview-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
}

.profile-preview-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.profile-preview-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-preview-username {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-preview-guide {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.profile-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-delete-profile {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.btn-delete-profile:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-change-profile {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-change-profile:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* 라이트 모드 테마 지원 */
html[data-theme="light"] .profile-modal-dialog {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

html[data-theme="light"] .profile-preview-username {
    color: #0f172a !important;
}

html[data-theme="light"] .profile-preview-guide {
    color: #64748b !important;
}

/* ==========================================================================
   ✨ 메모 AI 핵심 요약 (AI Summary) 및 환경설정 스위치 스타일
   ========================================================================== */

/* 1. 환경설정 드로어 스위치 토글 */
.ai-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.5rem;
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
    margin-bottom: 0;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(148, 163, 184, 0.3);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked + .switch-slider {
    background-color: #334155 !important;
    border-color: #334155 !important;
    box-shadow: 0 0 8px rgba(51, 65, 85, 0.35) !important;
}

.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(22px);
}

.ai-toggle-status {
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
}

/* 1-1. 환경설정 AI 요약 엔진 선택 세그먼트 버튼 */
.ai-engine-selector-box {
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.ai-engine-selector-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-engine-selector-title i {
    color: var(--primary);
    font-size: 0.85rem;
}

.ai-engine-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-ai-engine {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ai-engine:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-ai-engine.is-active {
    background: #334155 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(51, 65, 85, 0.25) !important;
}

/* 1-2. 환경설정 Google Gemini API 키 설정 박스 */
.gemini-key-container {
    margin-top: 0.9rem;
    padding: 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: var(--transition);
}

.gemini-key-container:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

.gemini-key-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gemini-key-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.gemini-key-label i {
    color: #eab308;
    font-size: 0.85rem;
}

.gemini-key-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.gemini-key-input-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}

.gemini-key-input {
    flex: 1;
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem;
    height: 34px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: var(--transition);
}

.gemini-key-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-gemini-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    height: 34px;
    width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-gemini-icon:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.btn-gemini-save {
    height: 34px;
    padding: 0 0.75rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

.btn-gemini-delete {
    height: 34px;
    padding: 0 0.65rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

.gemini-key-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.25rem;
}

.gemini-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    letter-spacing: -0.2px;
}

.gemini-badge-builtin,
.gemini-badge-active {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

.gemini-link {
    font-size: 0.74rem;
    color: #64748b;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
}

.gemini-link:hover {
    color: #1e293b;
    text-decoration: underline;
}

.settings-drawer .settings-icon {
    display: none !important;
}

/* 2. 메모 카드 AI 요약 버튼 ('요약' 텍스트 지원, 차분한 소프트 톤) */
.btn-card-ai {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 28px;
    padding: 0 0.45rem;
    border-radius: var(--radius-sm);
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn-card-ai:hover {
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* 이미 요약이 생성된 카드의 버튼 강조 (자극 없는 소프트 라벤더 슬레이트) */
.btn-card-ai.has-summary {
    background: rgba(139, 92, 246, 0.14);
    border-color: rgba(139, 92, 246, 0.28);
    color: #b4a2f8;
}

/* 로딩 스피너 애니메이션 */
.btn-card-ai.is-loading i {
    animation: ai-spin 1s linear infinite;
}

@keyframes ai-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 3. 메모 카드 본문 상단 AI 핵심 요약 박스 */
.ai-summary-box {
    margin-bottom: 0.9rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-left: 2.5px solid rgba(167, 139, 250, 0.5); /* 구분은 확실하되 눈부시지 않은 옅은 소프트 보라 */
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

/* 요약 박스 상단 헤더에 배치된 일자와 시간 */
.ai-summary-header .memo-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ai-badge i {
    color: #a78bfa;
    font-size: 0.82rem;
}

.ai-summary-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-ai-resummarize,
.btn-ai-summary-edit,
.btn-ai-summary-delete,
.btn-ai-summary-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-ai-resummarize:hover,
.btn-ai-summary-edit:hover,
.btn-ai-summary-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.btn-ai-summary-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.btn-ai-resummarize.is-loading i {
    animation: ai-spin 1s linear infinite;
}

.ai-summary-content {
    font-size: calc(1.05rem * var(--fs-ai_summary-scale, 1));
    line-height: 1.65;
    color: var(--text-primary);
    word-break: break-word;
}

/* 인라인 요약 수정 폼 스타일 */
.ai-summary-edit-box {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-summary-edit-textarea {
    width: 100%;
    font-size: calc(1.02rem * var(--fs-ai_summary-scale, 1));
    line-height: 1.6;
    padding: 0.5rem 0.65rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    resize: vertical;
    transition: var(--transition);
}

.ai-summary-edit-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.ai-summary-edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.ai-summary-edit-actions .btn {
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
}

/* 라이트 모드에서의 AI 요약 카드 & 버튼 */
html[data-theme="light"] .btn-card-ai {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.25);
    color: #7c3aed;
}

html[data-theme="light"] .btn-card-ai:hover {
    background: rgba(139, 92, 246, 0.16);
    border-color: #7c3aed;
    color: #6d28d9;
}

html[data-theme="light"] .btn-card-ai.has-summary {
    background: rgba(88, 129, 87, 0.12);
    border-color: rgba(88, 129, 87, 0.35);
    color: #3a5a40;
}

html[data-theme="light"] .ai-summary-box {
    background: linear-gradient(135deg, rgba(235, 243, 237, 0.65), rgba(244, 239, 235, 0.65));
    border: 1px solid rgba(88, 129, 87, 0.25);
    border-left: 3.5px solid #588157;
    border-radius: 12px;
}

html[data-theme="light"] .ai-badge {
    color: #3a5a40;
}

html[data-theme="light"] .ai-badge i {
    color: #588157;
}

html[data-theme="light"] .ai-summary-header .memo-date {
    color: #475569;
}

html[data-theme="light"] .ai-summary-content {
    color: #2b2d2f;
}

/* 4. [개별 수동 요약 지원] 환경설정에서 자동 요약을 끄더라도 개별 메모의 요약 버튼(.btn-card-ai)은 항상 노출하여 필요 시 수동 요약 생성 가능 */
/* (기존 숨김 규칙을 제거하여 항상 상시 노출 유지) */

/* ==========================================================================
   헤더 상단 네비게이션 버튼 (공통 & 데스크탑)
   ========================================================================== */
.btn-board-header {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.75rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-board-header:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: #6366f1;
    transform: translateY(-1px);
}

.btn-board-header i {
    color: #818cf8;
}

/* ==========================================================================
   바로가기 생성 (스마트폰 홈 화면 & 데스크탑 바탕화면 바로가기 UI)
   ========================================================================== */
.btn-shortcut-install {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.85rem;
    background: #eef4f0;
    color: #2e5537 !important;
    border: 1px solid #c7dcd0;
    border-radius: 9999px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(46, 85, 55, 0.08);
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-shortcut-install:hover {
    background: #e2ede5;
    color: #1e3f26 !important;
    border-color: #b0d0bd;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(46, 85, 55, 0.15);
}

html:not([data-theme="light"]) .btn-shortcut-install {
    background: rgba(88, 129, 87, 0.2);
    color: #b6e4bc !important;
    border: 1px solid rgba(88, 129, 87, 0.4);
    box-shadow: none;
}

html:not([data-theme="light"]) .btn-shortcut-install:hover {
    background: rgba(88, 129, 87, 0.35);
    color: #ffffff !important;
}

/* 모달 백드롭 */
.shortcut-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    box-sizing: border-box;
}

.shortcut-modal-card {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-lg, 0 20px 25px -5px rgba(0, 0, 0, 0.5));
    width: 100%;
    max-width: 440px;
    padding: 1.75rem;
    box-sizing: border-box;
    animation: fadeIn 0.25s ease-out;
}

html[data-theme="light"] .shortcut-modal-card {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.shortcut-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    margin-bottom: 1.25rem;
}

.shortcut-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.shortcut-icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.shortcut-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
}

.shortcut-modal-body {
    margin-bottom: 1.5rem;
}

.shortcut-intro {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 1.15rem 0;
    line-height: 1.5;
}

.shortcut-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
}

html[data-theme="light"] .shortcut-step {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary, #6366f1);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.step-desc {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.shortcut-option-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    padding: 0.9rem 1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.shortcut-option-card:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}

html[data-theme="light"] .shortcut-option-card {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.option-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

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

.option-info strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.option-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   📢 공지 & 베타 피드백 게시판 (Beta Tester Lounge) 스타일
   ========================================================================== */
.board-container,
.board-detail-container,
.board-write-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* 1. 상단 배너 (차분한 모노톤 린넨 그레이) */
.board-header-banner {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 1.6rem 1.8rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

html[data-theme="light"] .board-header-banner {
    background: #f1f3f1;
    border-color: #d4dad5;
}

.board-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    background: rgba(71, 85, 105, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

html[data-theme="light"] .board-badge {
    background: #e2e8e3;
    border-color: #cbd5cd;
    color: #47554d;
}

.board-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
    letter-spacing: -0.3px;
}

.board-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    word-break: keep-all;
}

.board-header-actions {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.btn-board-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-board-write {
    background: #475569;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-board-write:hover {
    background: #334155;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.btn-board-notice {
    background: #334155;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-board-notice:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* 2. 탭 & 검색 컨트롤 바 */
.board-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.board-tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
}

.board-tabs::-webkit-scrollbar {
    display: none;
}

.board-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.48rem 0.95rem;
    border-radius: 9999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.board-tab i {
    color: #64748b;
    font-size: 0.85rem;
}

.board-tab:hover {
    color: var(--text-primary);
    border-color: #94a3b8;
    background: var(--bg-hover);
}

/* 선택된 탭: 짙은 회색으로 명확하게 선택 표시 */
.board-tab.active {
    background: #334155 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}

.board-tab.active i {
    color: #ffffff !important;
}

.tab-count {
    font-size: 0.74rem;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.25);
}

.board-tab:not(.active) .tab-count {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.board-search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.board-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.board-search-input-wrap .search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.board-search-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.48rem 2.2rem 0.48rem 2.3rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    width: 180px;
    transition: all 0.2s;
}

.board-search-input:focus {
    outline: none;
    border-color: #475569;
    width: 220px;
}

.search-clear-btn {
    position: absolute;
    right: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.board-search-btn {
    padding: 0.48rem 0.95rem;
    border-radius: 9999px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.board-search-btn:hover {
    background: #cbd5e1;
    color: #1e293b;
}

/* 3. 상단 고정 공지사항 섹션 */
.board-pinned-section {
    margin-bottom: 1.5rem;
}

.pinned-section-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}

.board-card-pinned {
    border-color: #cbd5e1 !important;
    border-left: 4px solid #475569 !important;
    background: var(--bg-card) !important;
}

/* 4. 게시글 카드 그리드 */
.board-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.board-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.22s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.board-card:hover {
    transform: translateY(-3px);
    border-color: #94a3b8;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.card-top-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.badge-post-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.badge-post-cat i {
    color: #64748b;
}

.badge-cat-notice { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.badge-cat-feedback { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.badge-cat-bug { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.badge-cat-qna { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }

.badge-pinned {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-size: 0.72rem;
    font-weight: 700;
}

.post-time {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    line-height: 1.4;
    word-break: break-all;
}

.post-preview {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 1rem;
    flex: 1;
    word-break: break-all;
}

.card-bottom-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
}

.author-admin-icon {
    color: #64748b;
}

.badge-admin-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-size: 0.68rem;
    font-weight: 700;
}

.badge-user-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    font-size: 0.68rem;
    font-weight: 600;
}

.post-stats {
    display: flex;
    gap: 0.6rem;
}

/* 5. 페이징 네비게이션 */
.board-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-numbers {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.page-link, .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.page-num.active {
    background: #334155;
    border-color: #334155;
    color: #ffffff;
}

.page-link:hover, .page-num:hover:not(.active) {
    border-color: #94a3b8;
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* 빈 상태 */
.board-empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 20px;
    color: var(--text-muted);
}

.board-empty-state .empty-icon {
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   게시글 상세 화면 (Board Detail)
   ========================================================================== */
.detail-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.btn-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-detail-back:hover {
    color: #6366f1;
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-detail-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-detail-action:hover {
    color: var(--text-primary);
    border-color: #6366f1;
}

.btn-detail-delete:hover {
    color: #ef4444;
    border-color: #ef4444;
}

.board-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.detail-category-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.detail-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 1rem;
    line-height: 1.35;
    word-break: break-all;
}

.detail-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.meta-author {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.admin-avatar {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.user-avatar {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.author-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.meta-info {
    display: flex;
    gap: 0.9rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.detail-body {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 2.2;
    word-break: break-word;
    white-space: normal;
}

/* ==========================================================================
   게시판 안내서 / 매뉴얼 전용 스타일링 (라이트 & 다크 모드 완벽 가독성)
   ========================================================================== */
.manual-intro-card {
    background: rgba(88, 129, 87, 0.08);
    border: 1px solid rgba(88, 129, 87, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 0;
    margin-bottom: 8px;
    max-width: 680px;
}
html[data-theme="light"] .manual-intro-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.manual-intro-title {
    font-size: 0.94rem;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0 0 2px 0;
}
html[data-theme="dark"] .manual-intro-title,
:root:not([data-theme="light"]) .manual-intro-title {
    color: #60a5fa;
}
.manual-intro-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}
html[data-theme="light"] .manual-intro-desc {
    color: #475569;
}

/* 목차 박스 */
.manual-toc-box {
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 0 12px 0;
    max-width: 680px;
}
html[data-theme="light"] .manual-toc-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.manual-toc-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-bottom: 3px;
}
html[data-theme="light"] .manual-toc-title {
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
}

.manual-toc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 8px;
    margin: 0;
}
@media (max-width: 640px) {
    .manual-toc-grid {
        grid-template-columns: 1fr;
    }
}
.manual-toc-grid br {
    display: none !important;
}

.manual-toc-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease;
}
html[data-theme="light"] .manual-toc-item {
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
html[data-theme="light"] .manual-toc-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.manual-toc-item .num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #1e3a8a;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}
html[data-theme="dark"] .manual-toc-item .num-badge,
:root:not([data-theme="light"]) .manual-toc-item .num-badge {
    background: #3b82f6;
}

/* 대분류 헤더 (넘버링 번호 - 폰트색 조금 더 짙은 네이비) */
.manual-h1 {
    font-size: 1.08rem;
    font-weight: 800;
    color: #1e3a8a;
    border-bottom: 2px solid #1e3a8a;
    padding-bottom: 3px;
    margin-top: 18px;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}
html[data-theme="dark"] .manual-h1,
:root:not([data-theme="light"]) .manual-h1 {
    color: #60a5fa;
    border-bottom-color: rgba(96, 165, 250, 0.4);
}

/* 중분류 헤더 (가나다 넘버링 - 완전한 검정색) */
.manual-h2 {
    font-size: 0.96rem;
    font-weight: 800;
    color: #000000;
    margin-top: 8px;
    margin-bottom: 4px;
}
html[data-theme="dark"] .manual-h2,
:root:not([data-theme="light"]) .manual-h2 {
    color: #f1f5f9;
}

/* 본문 목록 리스트 (수직 간격 1.5배 확대) */
.manual-list {
    margin: 4px 0 8px 0;
    padding-left: 18px;
    line-height: 2.3;
}
.manual-list li {
    margin: 4px 0;
    font-size: 0.92rem;
}

/* 섹션 구분선 */
.manual-divider {
    border: none;
    border-top: 1px dashed rgba(148, 163, 184, 0.3);
    margin: 12px 0;
}

/* 키보드 키캡 */
.manual-kbd {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-bottom: 2px solid #94a3b8;
    border-radius: 4px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 0.84em;
    font-weight: 700;
    color: #b45309;
    vertical-align: middle;
}
html[data-theme="dark"] .manual-kbd,
:root:not([data-theme="light"]) .manual-kbd {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    border-bottom-color: rgba(255, 255, 255, 0.35);
    color: #fbbf24;
}

/* 본문 텍스트 명도 보정 (라이트 모드) */
html[data-theme="light"] .detail-body {
    color: #334155;
}
html[data-theme="light"] .detail-body strong {
    color: #0f172a;
}
html[data-theme="light"] .detail-body .text-green {
    color: #059669 !important;
}
html[data-theme="light"] .detail-body .text-red {
    color: #dc2626 !important;
}
html[data-theme="light"] .detail-body .text-blue {
    color: #2563eb !important;
}
html[data-theme="light"] .detail-body .text-purple {
    color: #7c3aed !important;
}
html[data-theme="light"] .detail-body .text-amber {
    color: #d97706 !important;
}

/* 댓글 섹션 */
.board-comment-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem 2rem;
}

.comment-section-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-write-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.75rem;
}

.comment-author-badge {
    margin-bottom: 0.5rem;
}

.comment-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 0.75rem;
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
}

.comment-textarea:focus {
    outline: none;
    border-color: #475569;
}

.comment-submit-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.6rem;
}

.btn-comment-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    background: #475569;
    color: #ffffff;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-comment-submit:hover {
    background: #334155;
}

.comment-login-guide {
    text-align: center;
    padding: 1.8rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    margin-bottom: 1.75rem;
    color: var(--text-muted);
}

.btn-comment-login {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.45rem 1rem;
    background: #6366f1;
    color: #ffffff !important;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.comment-admin-reply {
    background: rgba(245, 158, 11, 0.05);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.25);
    margin: 0.6rem 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.comment-user-info {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
}

.comment-admin-badge {
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
    font-size: 0.72rem;
    font-weight: 700;
}

.comment-time {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.btn-comment-del {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-comment-del:hover {
    color: #ef4444;
}

.comment-body {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ==========================================================================
   게시글 작성/수정 화면 (Board Write)
   ========================================================================== */
.board-write-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.write-card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.2rem;
}

.write-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.write-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.board-write-form .form-group {
    margin-bottom: 1.3rem;
}

.board-write-form .form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.category-radio-group {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.cat-radio-label input {
    display: none;
}

.cat-radio-box {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-radio-label input:checked + .cat-radio-box,
.cat-radio-label.cat-notice input:checked + .cat-radio-box {
    background: #334155 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.checkbox-text {
    font-size: 0.88rem;
    color: var(--text-primary);
}

.form-input, .form-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #475569;
}

/* ==========================================================================
   스마트 리치 텍스트 에디터 (네이버 스마트에디터 스타일 WYSIWYG)
   ========================================================================== */
.editor-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.btn-toggle-html {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-toggle-html:hover,
.btn-toggle-html.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.smart-editor-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease;
}
.smart-editor-container:focus-within {
    border-color: #3b82f6;
}
html[data-theme="light"] .smart-editor-container {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .smart-editor-container:focus-within {
    border-color: #2563eb;
}

/* 상단 서식 툴바 (네이버 스타일) */
.smart-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    user-select: none;
}
html[data-theme="light"] .smart-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tool-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.tool-divider {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 6px;
}
html[data-theme="light"] .tool-divider {
    background: #cbd5e1;
}

.smart-select {
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
html[data-theme="light"] .smart-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

.smart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
html[data-theme="light"] .smart-btn {
    color: #334155;
}
.smart-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
    color: #38bdf8;
}
html[data-theme="light"] .smart-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.smart-btn.active {
    background: #3b82f6;
    color: #ffffff;
}

/* 컬러 피커 래퍼 */
.smart-color-picker-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.smart-color-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    cursor: pointer;
}

/* 본문 contenteditable 편집 영역 */
.smart-editor-body {
    min-height: 210px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 0.98rem;
    line-height: 2.2;
    outline: none;
    overflow-y: auto;
    word-break: break-word;
}
html[data-theme="light"] .smart-editor-body {
    color: #1e293b;
    background: #ffffff;
}

.smart-editor-body:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    font-style: italic;
}

/* 에디터 내부의 매뉴얼 및 가이드 스타일이 실제와 똑같이 표시되도록 지원 */
.smart-editor-body .manual-intro-card,
.smart-editor-body .manual-toc-box,
.smart-editor-body .manual-h1,
.smart-editor-body .manual-h2,
.smart-editor-body .manual-kbd,
.smart-editor-body .manual-list,
.smart-editor-body .manual-divider {
    /* 기존 스타일 그대로 반영 */
}

/* HTML 소스 직접 편집용 textarea */
.smart-html-textarea {
    width: 100%;
    min-height: 210px;
    padding: 14px 16px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: var(--bg-input);
    border: none;
    color: var(--text-primary);
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}
html[data-theme="light"] .smart-html-textarea {
    background: #f8fafc;
    color: #0f172a;
}

.write-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.8rem;
    flex-wrap: wrap;
}

.write-action-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.write-action-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: auto;
}

/* 🎙️ 게시판 음성 녹음 버튼 */
.btn-board-record {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.35rem;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #818cf8;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-board-record:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: #6366f1;
    color: #a5b4fc;
    transform: translateY(-1px);
}

/* 녹음 진행 중 상태 (빨간색 펄스) */
.btn-board-record.recording {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    animation: boardRecordPulse 1.5s infinite;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

@keyframes boardRecordPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.board-record-timer {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

.board-stt-status {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* 라이트 모드 지원 */
html[data-theme="light"] .btn-board-record {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}
html[data-theme="light"] .btn-board-record:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}
html[data-theme="light"] .btn-board-record.recording {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.btn-write-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border-radius: 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-write-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.6rem;
    border-radius: 10px;
    background: #334155;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.btn-write-submit:hover {
    background: #1e293b;
}

/* 📱 모바일 반응형 최적화 */
@media (max-width: 640px) {
    .board-header-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem;
        gap: 1rem;
    }

    .board-header-actions {
        flex-direction: column;
    }

    .btn-board-action {
        width: 100%;
        justify-content: center;
    }

    .board-controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .board-search-form {
        width: 100%;
    }

    .board-search-input-wrap {
        flex: 1;
    }

    .board-search-input {
        width: 100% !important;
    }

    .board-post-grid {
        grid-template-columns: 1fr;
    }

    .board-detail-card,
    .board-comment-section,
    .board-write-card {
        padding: 1.25rem 1rem;
    }

    .write-action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .write-action-left {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .btn-board-record {
        width: 100%;
        justify-content: center;
    }

    .write-action-right {
        width: 100%;
        justify-content: stretch;
    }

    .btn-write-cancel,
    .btn-write-submit {
        flex: 1;
        justify-content: center;
    }
}

/* ==========================================================================
   📱 스마트폰 모바일 상단 헤더 완벽 최적화 (768px 이하)
   - 좁은 화면에서 7개 버튼의 찌그러짐을 제거하고 네이티브 앱 스타일로 컴팩트하게 정돈
   ========================================================================== */
@media (max-width: 768px) {
    .header-inner {
        padding: 0.55rem 0.7rem !important;
    }

    .brand-logo {
        font-size: 1.05rem !important;
        gap: 0.4rem !important;
    }

    .logo-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
    }

    .header-right {
        gap: 0.35rem !important;
    }

    .header-user {
        gap: 0.35rem !important;
    }

    /* 1. 프로필: 모바일에서는 아이디 텍스트(chanp)를 숨기고 동그란 원형 아바타만 깔끔하게 노출 */
    .user-badge {
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .user-badge .user-name-text {
        display: none !important;
    }

    .user-avatar-wrap {
        width: 32px !important;
        height: 32px !important;
        border-width: 1.5px !important;
    }

    /* 2. 관리자 왕관(👑) 및 상단 로그아웃(➔) 버튼은 모바일 헤더에서 숨김 (삼단바 메뉴로 통합) */
    .btn-admin-crown,
    .btn-logout {
        display: none !important;
    }

    /* 3. 공지·의견 버튼: 3줄 찌그러짐을 없애고 32x32 세련된 원형 아이콘 버튼으로 변환 */
    .btn-board-header {
        width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    .btn-board-header .btn-board-text {
        display: none !important;
    }

    .btn-board-header i {
        font-size: 0.95rem !important;
        color: #818cf8 !important;
        margin: 0 !important;
    }

    /* 4. 바로가기 버튼: 모바일에서 컴팩트한 알약 형태로 여백 및 폰트 조절 */
    .btn-shortcut-install {
        padding: 0.35rem 0.62rem !important;
        font-size: 0.78rem !important;
        gap: 0.3rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .btn-shortcut-install i {
        font-size: 0.75rem !important;
    }

    /* 5. 햄버거 메뉴 버튼 */
    .btn-settings-toggle {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }

    /* 6. 모바일에서 휴지통 버튼 텍스트 숨김 (아이콘 및 배지만 표시) */
    .btn-trash-header {
        padding: 0.35rem 0.55rem !important;
    }
    .btn-trash-header .btn-trash-text {
        display: none !important;
    }
}

/* ==============================================================================
   [휴지통 (Trash) 시스템 UI 스타일링]
   ============================================================================== */

/* 1. 상단 헤더 휴지통 버튼 */
.btn-trash-header {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 9999px;
    color: #ef4444;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

html:not([data-theme="light"]) .btn-trash-header {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.btn-trash-header:hover {
    background: rgba(239, 68, 68, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.15);
}

.trash-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

/* 2. 휴지통 모달 팝업 레이아웃 */
.trash-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.trash-modal-dialog {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg, 0 20px 25px -5px rgba(0, 0, 0, 0.1));
    overflow: hidden;
    animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.trash-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* 휴지통 전체 비우기 버튼 (무채색 아웃라인) */
.btn-trash-empty-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.65rem;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: var(--text-secondary, #94a3b8);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-trash-empty-all:hover {
    background: #475569;
    border-color: #475569;
    color: #ffffff;
}

html[data-theme="light"] .btn-trash-empty-all {
    border-color: #cbd5e1;
    color: #64748b;
}

html[data-theme="light"] .btn-trash-empty-all:hover {
    background: #475569;
    color: #ffffff;
}

/* 안내 배너 (차분한 무채색 톤) */
.trash-guide-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.65rem 0.85rem;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.78rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.45;
    margin-bottom: 0.85rem;
}

.trash-guide-banner i {
    color: var(--text-muted, #94a3b8);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.trash-guide-banner strong {
    color: var(--text-primary, #0f172a);
}

.trash-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow-y: auto;
    max-height: 55vh;
    padding-right: 0.25rem;
}

/* 3. 휴지통 내 메모 카드 */
.trash-item-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md, 8px);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: all 0.15s ease;
}

html:not([data-theme="light"]) .trash-item-card {
    background: #1e293b;
    border-color: #334155;
}

.trash-item-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.trash-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.trash-item-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.trash-cat-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

html:not([data-theme="light"]) .trash-cat-badge {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

/* D-Day 뱃지 (무채색 계통) */
.trash-days-left {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
}

html:not([data-theme="light"]) .trash-days-left {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}

.trash-date {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
}

.trash-item-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0;
    word-break: break-word;
}

.trash-item-preview {
    font-size: 0.82rem;
    color: var(--text-secondary, #475569);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-line;
}

.trash-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 0.35rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}

/* [복구 버튼] - 차분한 무채색 솔리드(Solid Gray) 스타일 */
.btn-trash-restore {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.65rem;
    background: #334155;
    border: 1px solid #475569;
    color: #f8fafc;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-trash-restore:hover {
    background: #475569;
    border-color: #64748b;
    color: #ffffff;
}

html[data-theme="light"] .btn-trash-restore {
    background: #334155;
    border-color: #1e293b;
    color: #ffffff;
}

html[data-theme="light"] .btn-trash-restore:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

/* [영구 삭제 버튼] - 차분한 무채색 아웃라인(Outline Gray) 스타일 */
.btn-trash-permanent {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.65rem;
    background: transparent;
    border: 1px solid #475569;
    color: #94a3b8;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-trash-permanent:hover {
    background: #1e293b;
    border-color: #64748b;
    color: #f1f5f9;
}

html[data-theme="light"] .btn-trash-permanent {
    background: transparent;
    border-color: #cbd5e1;
    color: #64748b;
}

html[data-theme="light"] .btn-trash-permanent:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.trash-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted, #94a3b8);
}

.trash-empty-icon {
    font-size: 2.8rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

/* ==========================================================================
   📚 관리자 지식 보관소 (Admin Knowledge Base) - 가독성 중심 깔끔한 문서 스타일
   ========================================================================== */
.admin-doc-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 1.8rem 1.25rem 4rem;
}

/* 상단 헤더 & 네비게이션 */
.admin-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.admin-list-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}

.admin-list-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.btn-doc-write {
    display: inline-block;
    padding: 0.45rem 0.95rem;
    background: var(--primary);
    color: #ffffff !important;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.btn-doc-write:hover {
    background: var(--primary-hover);
}

/* 필터 및 검색 바 */
.admin-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-simple-tabs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
}

.admin-tab-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    background: transparent;
}

.admin-tab-item:hover {
    color: var(--text-primary);
    background: var(--bg-input);
}

.admin-tab-item.active {
    color: var(--text-primary);
    background: var(--bg-card);
    font-weight: 700;
    border: 1px solid var(--border-color);
}

.tab-badge {
    font-size: 0.74rem;
    opacity: 0.8;
}

.admin-search-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.admin-search-input {
    padding: 0.38rem 0.7rem;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.85rem;
    width: 160px;
}

.admin-search-btn {
    padding: 0.38rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.admin-search-reset {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: underline;
    margin-left: 0.2rem;
}

/* 관리자 목록 테이블 */
.admin-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: var(--bg-input);
    padding: 0.75rem 1rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.93rem;
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(88, 129, 87, 0.05);
}

.table-cat-badge {
    display: inline-block;
    padding: 0.18rem 0.45rem;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.admin-title-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.admin-title-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.admin-empty-box {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

/* 상세 보기 (A4 보고서 / 기술 위키 스타일) */
.admin-doc-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.btn-doc-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-doc-link:hover {
    color: var(--text-primary);
}

.admin-doc-actions {
    display: flex;
    gap: 0.4rem;
}

.btn-doc-action {
    display: inline-block;
    padding: 0.32rem 0.7rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.84rem;
    text-decoration: none;
    cursor: pointer;
}

.btn-doc-action:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-doc-delete {
    color: #ef4444;
}

.btn-doc-delete:hover {
    border-color: #ef4444;
}

.admin-doc-article {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.2rem 2.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

@media (max-width: 640px) {
    .admin-doc-article {
        padding: 1.4rem 1.1rem;
    }
}

.admin-doc-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.doc-meta-badge {
    padding: 0.18rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--primary);
}

.doc-meta-item {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.admin-doc-title {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-primary);
    margin: 0;
    word-break: keep-all;
}

.admin-doc-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0 1.8rem;
}

/* 📖 가독성 최우선 마크다운 본문 타이포그래피 (폰트 크기 확대 적용) */
.admin-doc-body {
    font-size: 1.08rem;
    line-height: 1.88;
    color: var(--text-primary);
    word-break: break-word;
}

.admin-doc-body p {
    margin: 0 0 1.3rem;
}

.admin-doc-body h1 {
    font-size: 1.55rem;
    font-weight: 700;
    margin: 2.4rem 0 1rem;
    color: var(--text-primary);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-doc-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2.1rem 0 0.85rem;
    color: var(--text-primary);
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-doc-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.7rem 0 0.7rem;
    color: var(--text-primary);
}

.admin-doc-body h4 {
    font-size: 1.08rem;
    font-weight: 600;
    margin: 1.3rem 0 0.55rem;
    color: var(--text-primary);
}

.admin-doc-body ul,
.admin-doc-body ol {
    margin: 0.7rem 0 1.4rem 1.6rem;
    padding: 0;
}

.admin-doc-body li {
    margin-bottom: 0.45rem;
    line-height: 1.78;
}

.admin-doc-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.admin-doc-body strong,
.admin-doc-body b {
    font-weight: 700;
    color: var(--text-primary);
}

.admin-doc-body blockquote {
    margin: 1.4rem 0;
    padding: 0.9rem 1.25rem;
    border-left: 3px solid var(--primary);
    background: var(--bg-input);
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
}

.admin-doc-body blockquote p:last-child {
    margin-bottom: 0;
}

/* 표(Table) 스타일 - 가독성 및 정갈함 최우선 */
.admin-doc-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.98rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.admin-doc-body th {
    background: var(--bg-input);
    padding: 0.85rem 1.1rem;
    font-weight: 700;
    text-align: left;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.admin-doc-body td {
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    line-height: 1.65;
}

.admin-doc-body tr:nth-child(even) td {
    background: rgba(128, 128, 128, 0.03);
}

/* 코드 블록 */
.admin-doc-body pre {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 1.1rem 1.3rem;
    overflow-x: auto;
    margin: 1.35rem 0;
}

.admin-doc-body pre code {
    color: #e2e8f0;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.92rem;
    line-height: 1.65;
}

.admin-doc-body p code,
.admin-doc-body li code {
    background: var(--bg-input);
    color: var(--primary);
    padding: 0.18rem 0.4rem;
    border-radius: 4px;
    font-size: 0.92rem;
    font-family: Consolas, Monaco, monospace;
    border: 1px solid var(--border-color);
}

/* ✍️ 관리자 문서 수정/작성 에디터 스타일 (간결 & 큰 폰트) */
.admin-edit-article {
    margin-top: 0.5rem;
}

.admin-edit-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-edit-group {
    margin-bottom: 1.4rem;
}

.admin-edit-label {
    display: block;
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.admin-edit-select {
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    width: 100%;
    max-width: 320px;
    outline: none;
    transition: var(--transition);
}

.admin-edit-select:focus {
    border-color: var(--primary);
}

.admin-edit-input-title {
    padding: 0.85rem 1.1rem;
    font-size: 1.35rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    width: 100%;
    line-height: 1.45;
    outline: none;
    box-sizing: border-box;
    transition: var(--transition);
}

.admin-edit-input-title:focus {
    border-color: var(--primary);
}

.admin-edit-textarea {
    padding: 1.1rem 1.25rem;
    font-size: 1.08rem;
    line-height: 1.82;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
    resize: vertical;
    min-height: 440px;
    outline: none;
    box-sizing: border-box;
    transition: var(--transition);
}

.admin-edit-textarea:focus {
    border-color: var(--primary);
}

.admin-edit-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}



