/* ========================================================
   🥕 당근 & 번개 실시간 시세 AI 센터 - Toss / Apple Design System
   모바일 전용 네이티브 화면 전환 & 피드 뷰 완벽 지원
   ======================================================== */

:root {
    --primary: #3182f6;
    /* Toss Blue */
    --primary-hover: #1b64da;
    --primary-light: #e8f3ff;
    --primary-subtle: #f2f7ff;

    --accent-carrot: #ff6f0f;
    /* Daangn Orange */
    --accent-bunjang: #ef4444;
    /* Bunjang Red */
    --accent-deal: #f04452;
    /* Toss Red Alert */
    --accent-green: #04b069;
    /* Toss Vibrant Green */
    --accent-indigo: #6366f1;
    /* Apple/AI Indigo */

    --bg-app: #f8f9fa;
    /* Toss Light Background */
    --bg-card: #ffffff;
    --bg-subtle: #f2f4f6;
    /* Subtle Gray Fill */
    --bg-hover: #eef0f3;

    --text-primary: #191f28;
    /* Toss Deep Charcoal */
    --text-secondary: #6b7684;
    /* Toss Subtitle Gray */
    --text-tertiary: #8b95a1;
    /* Toss Muted Gray */
    --text-disabled: #b0b8c1;

    --border-color: #e5e8eb;
    /* Toss 1px Crisp Border */
    --border-focus: #3182f6;
    --border-subtle: #f2f4f6;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
}

/* ========================================================
   🌙 다크 모드 (Dark Theme) 토스/애플 스타일 야간 모드
   ======================================================== */
[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #1e293b;
    --primary-subtle: #0f172a;

    --accent-carrot: #ff8533;
    --accent-bunjang: #f87171;
    --accent-deal: #fb7185;
    --accent-green: #10b981;
    --accent-indigo: #818cf8;

    --bg-app: #0f172a;
    --bg-card: #1e293b;
    --bg-subtle: #334155;
    --bg-hover: #475569;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-disabled: #64748b;

    --border-color: #334155;
    --border-focus: #3b82f6;
    --border-subtle: #1e293b;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] body {
    background-color: var(--bg-app);
    color: var(--text-primary);
}

[data-theme="dark"] .app-header {
    background: rgba(30, 41, 59, 0.95);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .sidebar {
    background: #182234;
    border-right-color: var(--border-color);
}

[data-theme="dark"] .keyword-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .keyword-card:hover {
    background: var(--bg-subtle);
}

[data-theme="dark"] .keyword-card.active {
    background: #1e3a8a;
    border-color: #3b82f6;
}

[data-theme="dark"] .panel-section-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .data-table th {
    background: #182234;
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .data-table td {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .data-table tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .clean-select,
[data-theme="dark"] .filter-select-mini,
[data-theme="dark"] .sidebar-search-input {
    background-color: #182234;
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-box {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .btn-secondary {
    background: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #475569 !important;
}

[data-theme="dark"] .btn-outline {
    background: transparent !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-outline:hover {
    background: #334155 !important;
}

[data-theme="dark"] .btn-ai {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
}

[data-theme="dark"] .btn-ai:hover {
    background: rgba(59, 130, 246, 0.25) !important;
}

[data-theme="dark"] .btn-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
}

[data-theme="dark"] .icon-tool-btn {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .icon-tool-btn:hover {
    background: #475569 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .segmented-tabs {
    background: #182234 !important;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .tab-btn {
    color: var(--text-tertiary);
}

[data-theme="dark"] .tab-btn:hover {
    color: var(--text-primary);
}

[data-theme="dark"] .tab-btn.active {
    background: #334155 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .platform-tab-btn {
    color: var(--text-tertiary);
}

[data-theme="dark"] .platform-tab-btn:hover {
    color: var(--text-primary);
}

[data-theme="dark"] .platform-tab-btn.active {
    background: #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .compact-toggle-pill {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .compact-toggle-pill:hover {
    background: var(--bg-subtle) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .compact-toggle-pill:has(input:checked),
[data-theme="dark"] .compact-toggle-pill.active {
    background: #1e3a8a !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .pagination-page-btns button {
    background: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .pagination-page-btns button:hover:not(:disabled) {
    background: #475569 !important;
}

[data-theme="dark"] .empty-deals-box {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .deal-card-premium {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .deal-card-premium:hover {
    border-color: #475569 !important;
    box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .ai-deal-report-box {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .ai-advice-subcard {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ai-subcard-text strong {
    color: #f8fafc !important;
}

[data-theme="dark"] .ai-reason-headline {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .ai-verdict-pill.verdict-missing {
    background: #334155 !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .ai-verdict-pill.verdict-neutral {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-deal-outline {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .btn-deal-outline:hover {
    background: #475569 !important;
    border-color: #64748b !important;
    color: #ffffff !important;
}

[data-theme="dark"] .card-grid-item {
    border-color: #334155 !important;
}

[data-theme="dark"] .table-viewport-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table-pagination-footer {
    background: var(--bg-card) !important;
    border-top-color: var(--border-color) !important;
}

[data-theme="dark"] .settings-box-panel {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .spec-matrix-card {
    background: #182234 !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .spec-matrix-card:hover {
    background: #1e293b !important;
    border-color: var(--primary) !important;
}

[data-theme="dark"] .mobile-bottom-nav,
[data-theme="dark"] .apple-glass-nav {
    background: rgba(15, 23, 42, 0.92) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .sidebar-login-prompt {
    background: #182234 !important;
    border-color: #334155 !important;
}

/* Base Reset & Box Sizing */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

html,
body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.45;
    display: flex;
    flex-direction: column;
}

/* ========================================================
   1. 최상단 네비게이션 헤더 (Apple/Toss 스타일)
   ======================================================== */
.app-header {
    height: 52px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 100;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    min-width: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mobile-toggle-btn {
    display: none;
    background: #f2f4f6;
    border: none;
    border-radius: 8px;
    padding: 0.3rem 0.55rem;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-toggle-btn:hover {
    background: #e5e8eb;
}

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

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    white-space: nowrap;
}

.brand-symbol-chip {
    background: var(--primary);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* 중앙 세그먼트 탭 네비게이션 (데스크탑) */
.header-center {
    display: flex;
    align-items: center;
    min-width: 0;
}

.segmented-tabs {
    display: inline-flex;
    background: var(--bg-subtle);
    padding: 3px;
    border-radius: var(--radius-md);
    gap: 2px;
    white-space: nowrap;
}

.tab-btn {
    padding: 0.38rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem;
    flex-shrink: 0;
}

.tab-label-text {
    white-space: nowrap !important;
    word-break: keep-all !important;
}

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

.tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tab-badge {
    background: #fee2e2;
    color: var(--accent-deal);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-pill);
    white-space: nowrap !important;
    flex-shrink: 0;
}

/* 우측 액션 & 상태 */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.scheduler-pill-box {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--bg-subtle);
    padding: 2px 4px 2px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.status-indicator-pill {
    font-size: 0.75rem;
    font-weight: 700;
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.live-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 0 0 rgba(4, 176, 105, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(4, 176, 105, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(4, 176, 105, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(4, 176, 105, 0);
    }
}

.icon-tool-btn {
    background: #f2f4f6;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.32rem 0.48rem;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

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

.btn-new-kw {
    white-space: nowrap;
}

/* ========================================================
   2. 본문 2단 레이아웃 (Sidebar + Main Workspace)
   ======================================================== */
.app-layout {
    display: flex;
    flex: 1;
    height: calc(100vh - 52px);
    overflow: hidden;
    min-width: 0;
}

/* 좌측 사이드바: 키워드 마스터 리스트 (240px 슬림형) */
.sidebar {
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 0;
}

.sidebar-top-bar {
    padding: 0.75rem 1rem 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-top-heading {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.kw-counter-badge {
    background: var(--bg-subtle);
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-pill);
}

.sidebar-search-wrap {
    padding: 0 0.85rem 0.5rem 0.85rem;
}

.sidebar-search-input {
    width: 100%;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.82rem;
    outline: none;
    background: var(--bg-app);
    transition: all 0.15s ease;
}

.sidebar-search-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.keyword-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0.65rem 0.75rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

/* 키워드 카드 */
.keyword-card {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.keyword-card:hover {
    background: var(--bg-subtle);
}

.keyword-card.active {
    background: var(--primary-light);
    color: var(--primary-hover);
    border-color: transparent;
}

.keyword-card .kw-name {
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    gap: 0.35rem;
}

.keyword-card .kw-name span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.keyword-card.active .kw-name span:first-child {
    color: var(--primary-hover);
}

.keyword-card .kw-meta {
    font-size: 0.74rem;
    color: var(--text-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
}

.keyword-card.active .kw-meta {
    color: #4b8df2;
}

/* 우측 메인 작업 영역 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.85rem 1.25rem;
    background: var(--bg-app);
    min-width: 0;
}

.empty-view-state {
    text-align: center;
    margin: auto;
    padding: 3rem 1.5rem;
    max-width: 420px;
}

.empty-view-icon {
    font-size: 2.8rem;
    margin-bottom: 0.75rem;
}

.empty-view-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

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

.detail-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-width: 0;
}

/* ========================================================
   3. 1행: 키워드 헤더 & 액션 툴바
   ======================================================== */
.workspace-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    flex-shrink: 0;
    gap: 0.75rem;
    min-width: 0;
}

.header-info-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.mobile-back-btn {
    display: none;
    align-items: center;
    gap: 0.25rem;
    background: #f2f4f6;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-back-btn:hover {
    background: #e5e8eb;
}

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

.keyword-main-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

#detailTitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 260px;
}

.exclude-tags-inline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.75rem;
    min-width: 0;
}

.exclude-tags-inline strong {
    color: var(--text-tertiary);
    font-weight: 600;
}

.header-controls-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.clean-select {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    height: 32px;
}

/* ========================================================
   4. 2행: 핵심 시세 지표 스트립 (세로 스택, 글자 이탈 100% 방지)
   ======================================================== */
.metrics-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    margin-bottom: 0.65rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    gap: 0.75rem;
    min-width: 0;
}

.metric-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.2rem 0.6rem;
    border-right: 1px solid var(--border-color);
    min-width: 0;
    overflow: hidden;
}

.metric-item:last-child {
    border-right: none;
}

.metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.metric-value {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    margin: 2px 0 1px 0;
    min-width: 0;
}

.metric-meta {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.text-accent {
    color: var(--primary) !important;
}

.text-success {
    color: var(--accent-green) !important;
}

.text-indigo {
    color: var(--accent-indigo) !important;
}

/* ========================================================
   5. 3행: 탭 뷰포트 컨테이너 (남은 화면 100% 채움)
   ======================================================== */
.workspace-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 0;
    min-width: 0;
}

.tab-content {
    display: none !important;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    min-width: 0;
}

.tab-content.active-tab-pane {
    display: flex !important;
}

.tab-scroll-pane {
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
}

/* ========================================================
   6. [탭 1] 매물 목록 뷰 - 통합 필터 툴바
   ======================================================== */
.articles-pane-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    min-width: 0;
}

.unified-filter-toolbar {
    height: 38px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
    flex-shrink: 0;
    gap: 0.5rem;
    min-width: 0;
}

.filter-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    min-width: 0;
}

.filter-toolbar-left::-webkit-scrollbar {
    display: none;
}

.mini-platform-segments {
    display: inline-flex;
    background: var(--bg-subtle);
    padding: 2px;
    border-radius: 8px;
    gap: 1px;
    flex-shrink: 0;
}

.platform-tab-btn {
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.platform-tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.platform-tab-btn.active.tab-daangn {
    color: var(--accent-carrot);
}

.platform-tab-btn.active.tab-bunjang {
    color: var(--accent-bunjang);
}

.compact-toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.6rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    height: 30px;
    white-space: nowrap;
    flex-shrink: 0;
}

.compact-toggle-pill:has(input:checked) {
    background: var(--primary-light);
    color: var(--primary-hover);
    border-color: var(--primary);
}

.compact-toggle-pill input {
    cursor: pointer;
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
}

.active-range-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-carrot);
    height: 28px;
    white-space: nowrap;
    flex-shrink: 0;
}

.range-chip-del {
    background: none;
    border: none;
    cursor: pointer;
    color: #c2410c;
    font-weight: 800;
    font-size: 0.75rem;
    line-height: 1;
}

.filter-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.filter-select-mini {
    padding: 0.28rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text-secondary);
    outline: none;
    cursor: pointer;
    height: 30px;
}

.search-mini-field input {
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    height: 30px;
    width: 130px;
    transition: width 0.2s ease;
}

.search-mini-field input:focus {
    width: 170px;
    border-color: var(--primary);
}

.article-total-count {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-tertiary);
    padding: 0.2rem 0.4rem;
}

/* 용량 필터 가로 스크롤 칩 바 */
.storage-chips-row {
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.35rem;
    margin-bottom: 0.35rem;
    flex-shrink: 0;
    scrollbar-width: none;
}

.storage-chips-row::-webkit-scrollbar {
    display: none;
}

/* ========================================================
   🏢 매물 뷰 모드 토글 (리스트형 vs 카드형)
   ======================================================== */
.view-mode-toggle-group {
    display: inline-flex;
    align-items: center;
    background: var(--bg-subtle, #f1f5f9);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
}

[data-theme="dark"] .view-mode-toggle-group {
    background: #1e293b;
    border-color: #334155;
}

.btn-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-secondary, #64748b);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.btn-view-toggle svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.btn-view-toggle:hover {
    color: var(--text-primary, #0f172a);
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .btn-view-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
}

.btn-view-toggle.active {
    background: #ffffff;
    color: var(--primary, #2563eb);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .btn-view-toggle.active {
    background: #0f172a;
    color: #60a5fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-view-toggle.active svg {
    opacity: 1;
    stroke: currentColor;
}

/* 뷰 모드 통합 컨테이너 */
.articles-view-container {
    width: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 1) 리스트 모드 (기본 테이블) */
.articles-view-container.mode-list .desktop-table-wrapper {
    display: block;
}

.articles-view-container.mode-list .articles-cards-grid {
    display: none !important;
}

.articles-view-container.mode-list .mobile-feed-wrapper {
    display: none;
}

/* 2) 카드 모드 (그리드 카드) - 스크롤 지원 및 잘림 방지 */
.articles-view-container.mode-card {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.articles-view-container.mode-card .desktop-table-wrapper {
    display: none !important;
}

.articles-view-container.mode-card .mobile-feed-wrapper {
    display: none !important;
}

.articles-view-container.mode-card .articles-cards-grid {
    display: grid !important;
}

/* ========================================================
   🎴 풀커버 포토 & 투명 정보 오버레이 카드 뷰 (옷 & 디테일 100% 노출)
   ======================================================== */
.articles-cards-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 1.25rem;
    padding: 0.35rem 0.35rem 2.5rem 0.2rem;
    width: 100%;
}

.article-grid-card {
    position: relative;
    height: 440px;
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s;
    cursor: zoom-in;
    user-select: none;
}

.article-grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.35);
}

/* 1. 카드 전체를 가득 채우는 풀커버 사진 */
.grid-card-media-full {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    background: #1e293b;
}

.grid-card-img-full {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.article-grid-card:hover .grid-card-img-full {
    transform: scale(1.06);
}

/* 제품/옷을 가리지 않도록 비네팅/어두운 필터 완전 제거 */
.grid-card-vignette {
    display: none;
}

/* 2. 상단 플로팅 뱃지 */
.grid-card-top-floating {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.grid-card-badges-left,
.grid-card-badges-right {
    display: flex;
    gap: 4px;
    align-items: center;
}

.grid-card-zoom-glass {
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.70rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: zoom-in;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: all 0.2s ease;
}

.grid-card-zoom-glass:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: #ffffff;
    transform: scale(1.06);
}

/* 3. 설명 뒷배경 완전 투명화 -> 제품/옷이 뒷배경에 가려지지 않고 100% 보이게 처리 */
.grid-card-glass-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    margin-top: auto;
    padding: 12px 14px 12px;
    background: transparent; /* 뒷배경 완전 투명 */
    backdrop-filter: none;   /* 블러 완전 제거 */
    -webkit-backdrop-filter: none;
    border-top: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: none;
}

.article-grid-card:hover .grid-card-glass-overlay {
    background: transparent;
}

/* 텍스트는 제품 위에서 선명하게 읽히도록 고대비 text-shadow 적용 */
.glass-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    background: transparent;
}

.grid-card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #38bdf8; /* 밝고 눈에 띄는 스카이블루 */
    letter-spacing: -0.02em;
    text-shadow: 0 1px 3px #000000, 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.95);
}

.price-original-struck {
    font-size: 0.82rem;
    color: #ffffff;
    opacity: 0.75;
    text-decoration: line-through;
    text-shadow: 0 1px 3px #000;
}

.tag-price-drop {
    background: rgba(220, 38, 38, 0.88);
    color: #ffffff;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.70rem;
    font-weight: 700;
    text-shadow: none;
}

.glass-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    background: transparent;
}

.glass-chips-row .badge {
    background: rgba(0, 0, 0, 0.6) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 2px 6px;
}

.glass-card-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px #000000, 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.95);
}

.glass-card-desc {
    font-size: 0.76rem;
    color: #f1f5f9;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px #000000, 0 2px 5px rgba(0, 0, 0, 0.9);
}

.glass-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.73rem;
    color: #e2e8f0;
    padding-top: 4px;
    border-top: none;
    text-shadow: 0 1px 3px #000000, 0 1px 5px rgba(0, 0, 0, 0.9);
}

.glass-meta-region {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 68%;
}

.glass-meta-region .region-prov-tag {
    background: rgba(37, 99, 235, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 1px 5px;
    font-size: 0.68rem;
    border-radius: 4px;
}

.glass-meta-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* 4. 액션 버튼 바 (깔끔한 반투명 필 버튼) */
.glass-actions-row {
    padding-top: 2px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr 1fr;
    gap: 5px;
    background: transparent;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    border: none;
}

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

.btn-chat-daangn {
    background: rgba(255, 111, 15, 0.88);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-chat-daangn:hover {
    background: #ff6f0f;
    transform: scale(1.02);
}

.btn-chat-bunjang {
    background: rgba(239, 68, 68, 0.88);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-chat-bunjang:hover {
    background: #ef4444;
    transform: scale(1.02);
}

.btn-chat-joongna {
    background: rgba(34, 197, 94, 0.88);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-chat-joongna:hover {
    background: #22c55e;
    transform: scale(1.02);
}

.btn-card-ai {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 6px 4px;
    background: rgba(37, 99, 235, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-card-ai:hover {
    background: #2563eb;
    transform: scale(1.02);
}

.btn-card-nego {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 6px 4px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-card-nego:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: #ffffff;
}

/* 찜 및 숨김 버튼 */
.btn-card-fav,
.btn-card-hide {
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-card-fav.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
}

.btn-card-fav:hover,
.btn-card-hide:hover {
    background: rgba(0, 0, 0, 0.88);
    transform: scale(1.08);
}

/* 데스크탑 매물 데이터 테이블 */
.desktop-table-wrapper {
    display: block;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.table-container-fixed {
    width: 100%;
    max-width: 100%;
}

.data-table {
    width: 100%;
    min-width: 740px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.82rem;
}

.data-table th,
.data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.table-title-cell {
    white-space: normal !important;
    word-break: break-word !important;
}

.table-chips-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    margin-bottom: 4px;
}

.table-chips-row .badge {
    margin-right: 0 !important;
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 4px;
}

.table-title-line {
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.38;
}

.table-article-link {
    color: var(--text-primary);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    white-space: normal;
    transition: color 0.15s ease;
}

.table-article-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.table-content-snippet {
    font-size: 0.74rem;
    color: var(--text-tertiary);
    line-height: 1.35;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    white-space: normal;
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: #fbfcfd;
    z-index: 10;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* 하단 슬림 페이지네이션 바 (가운데 정렬) */
.table-pagination-footer {
    position: relative;
    height: 42px;
    display: flex;
    justify-content: center;
    /* 페이지 버튼 완벽 가운데 정렬 */
    align-items: center;
    padding: 0 0.85rem;
    margin-top: 0.35rem;
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.pagination-summary {
    position: absolute;
    left: 0.85rem;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.pagination-page-btns {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.pagination-page-btns button {
    min-width: 30px;
    height: 30px;
    padding: 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: #f2f4f6;
    color: #333d4b;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-page-btns button:hover:not(:disabled) {
    background: #e5e8eb;
    color: #191f28;
}

.pagination-page-btns button:active:not(:disabled) {
    transform: scale(0.95);
}

.pagination-page-btns button.btn-primary,
.pagination-page-btns button.active {
    background: #3182f6 !important;
    color: #ffffff !important;
    border-color: #3182f6 !important;
    box-shadow: 0 2px 6px rgba(49, 130, 246, 0.25);
    font-weight: 700;
}

.pagination-page-btns button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================================
   📱 모바일 전용 토스/당근 네이티브 피드 뷰 (모바일 전용)
   ======================================================== */
.mobile-feed-wrapper {
    display: none;
    flex-direction: column;
    gap: 0.65rem;
    overflow: visible;
    padding-bottom: 2rem;
    width: 100%;
}

.mobile-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.mobile-feed-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b95a1;
}

.mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e8eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: miniSpin 0.7s linear infinite;
    display: inline-block;
}

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

.mobile-feed-end {
    text-align: center;
    padding: 1.5rem 0.5rem 2rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b95a1;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    margin-top: 0.5rem;
}

.mobile-feed-sentinel {
    height: 1px;
    width: 100%;
    pointer-events: none;
    opacity: 0;
}

.mobile-feed-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    display: flex;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease;
}

.mobile-feed-card:active {
    background: #f8fafc;
    transform: scale(0.99);
}

.mobile-card-media {
    width: 72px;
    height: 72px;
    position: relative;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-subtle);
}

.mobile-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    color: var(--text-tertiary);
}

.mobile-tag {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.tag-daangn {
    background: var(--accent-carrot);
    color: #ffffff;
}

.tag-bunjang {
    background: var(--accent-bunjang);
    color: #ffffff;
}

.mobile-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-card-title-line {
    margin-bottom: 2px;
}

.mobile-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.mobile-card-sub {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-status-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    margin-left: 2px;
}

.tag-active {
    background: #d1fae5;
    color: #065f46;
}

.tag-reserved {
    background: #fef3c7;
    color: #92400e;
}

.tag-done {
    background: var(--bg-subtle);
    color: var(--text-tertiary);
}

.mobile-card-price-line {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 3px;
}

.mobile-card-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.mobile-drop-tag {
    font-size: 0.68rem;
    font-weight: 800;
    color: #dc2626;
    background: #fee2e2;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
}

.mobile-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-top: 2px;
}

.mobile-card-specs {
    display: flex;
    gap: 0.2rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.mobile-spec-pill {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    white-space: nowrap;
}

.dealer-pill {
    background: #fee2e2;
    color: #991b1b;
}

.ai-pill {
    background: #ede9fe;
    color: #6d28d9;
    font-weight: 700;
}

.mobile-card-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
    align-items: center;
}

.mobile-btn-action {
    padding: 0.24rem 0.55rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-daangn {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.btn-daangn:hover {
    background: #ffedd5;
    color: #c2410c;
    border-color: #fdba74;
}

.btn-bunjang {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
}

.btn-bunjang:hover {
    background: #ffe4e6;
    color: #be123c;
    border-color: #fda4af;
}

/* ========================================================
   📱 모바일 전용 하단 탭 바 (애플 거울모드 / 글래스모피즘 네비게이션)
   ======================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 58px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(24px) saturate(190%) contrast(100%);
    -webkit-backdrop-filter: blur(24px) saturate(190%) contrast(100%);
    border-top: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.05), 0 -8px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0.5px rgba(255, 255, 255, 0.9);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.apple-glass-nav {
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(24px) saturate(190%) contrast(100%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(190%) contrast(100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.05), 0 -8px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0.5px rgba(255, 255, 255, 0.9) !important;
}

.bottom-nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #8b95a1;
    /* Toss / Apple neutral inactive slate */
    cursor: pointer;
    gap: 3px;
    position: relative;
    transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
    transform: scale(0.92);
}

.bottom-nav-item .nav-svg-icon {
    width: 22px;
    height: 22px;
    stroke: #8b95a1;
    stroke-width: 1.85;
    fill: none;
    transition: stroke 0.15s ease, transform 0.15s ease;
}

.bottom-nav-item.active .nav-svg-icon {
    stroke: var(--primary) !important;
    stroke-width: 2.3;
    transform: scale(1.06);
}

.bottom-nav-item .nav-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #8b95a1;
    transition: color 0.15s ease;
    white-space: nowrap !important;
    word-break: keep-all !important;
}

.bottom-nav-item.active {
    color: var(--primary) !important;
}

.bottom-nav-item.active .nav-label {
    color: var(--primary) !important;
    font-weight: 700;
}

.bottom-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: #ff3b30;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.35);
    min-width: 14px;
    text-align: center;
    line-height: 12px;
}

/* ========================================================
   7. [탭 2] 실시간 급매물 (애플 / 토스 디자인 시스템)
   ======================================================== */
.pane-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.pane-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 1.25rem;
    padding: 0.35rem 0.35rem 2.5rem 0.2rem;
    width: 100%;
}

.empty-deals-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1.5rem;
    text-align: center;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-xl);
    grid-column: 1 / -1;
}

.deal-card-premium {
    position: relative;
    height: 440px;
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s;
    cursor: zoom-in;
    user-select: none;
}

.deal-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.35);
}

.deal-media-box {
    width: 210px;
    min-width: 210px;
    max-width: 210px;
    height: auto;
    min-height: 100%;
    align-self: stretch;
    background: var(--bg-subtle);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.deal-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.deal-card-premium:hover .deal-media-img {
    transform: scale(1.03);
}

.deal-media-top-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

.deal-platform-pill {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    backdrop-filter: blur(10px);
}

.deal-platform-pill.daangn {
    background: rgba(255, 111, 15, 0.92);
}

.deal-platform-pill.bunjang {
    background: rgba(220, 38, 38, 0.92);
}

.deal-discount-pill {
    background: #ef4444;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.deal-card-body {
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    justify-content: space-between;
    gap: 0.45rem;
}

.deal-card-core {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.deal-card-title {
    font-size: 0.90rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.38;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.deal-sub-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.deal-spec-chips-row {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.deal-spec-chip {
    font-size: 0.70rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 5px;
}

.deal-spec-chip.storage {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.deal-spec-chip.battery {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
}

.deal-spec-chip.grade {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ede9fe;
}

.deal-pricing-block {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 1px;
    flex-wrap: wrap;
}

.deal-main-price {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
}

.deal-price-unit {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 2px;
}

.deal-price-sub-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    white-space: normal;
    flex-wrap: wrap;
    line-height: 1.4;
}

.deal-avg-market {
    color: var(--text-tertiary);
    text-decoration: line-through;
    white-space: normal;
    word-break: break-word;
}

.deal-saved-highlight {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.deal-card-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meta-dot {
    color: var(--text-tertiary);
}

/* ========================================================
   🌟 애플/토스 스타일 Codex AI 정밀 진단 리포트 박스
   ======================================================== */
.ai-deal-report-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ai-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-report-badge-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 800;
    color: #4f46e5;
    letter-spacing: -0.01em;
}

.ai-spark-svg {
    color: #4f46e5;
    flex-shrink: 0;
}

.ai-verdict-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.ai-verdict-pill.verdict-recommend {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.ai-verdict-pill.verdict-quick {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.ai-verdict-pill.verdict-wear {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.ai-verdict-pill.verdict-missing {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.ai-verdict-pill.verdict-caution {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ai-verdict-pill.verdict-neutral {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.ai-reason-body {
    display: flex;
    flex-direction: column;
}

.ai-reason-headline {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.78rem;
    color: #1e293b;
    line-height: 1.48;
    font-weight: 500;
    word-break: keep-all;
    word-wrap: break-word;
}

.ai-reason-headline span:not(.ai-reason-dot) {
    flex: 1;
    min-width: 0;
}

.ai-reason-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6366f1;
    margin-top: 6px;
    flex-shrink: 0;
}

.ai-advice-subcard {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.74rem;
    color: #334155;
    line-height: 1.42;
    word-break: keep-all;
    word-wrap: break-word;
}

.ai-advice-subcard .ai-subcard-text {
    flex: 1;
    min-width: 0;
    line-height: 1.42;
}

.ai-advice-subcard span {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: keep-all;
}

.ai-subcard-icon {
    color: #059669;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-subcard-text strong {
    color: #0f172a;
    font-weight: 700;
    margin-right: 3px;
}

/* 카드 하단 액션 버튼 바 */
.deal-card-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.1rem;
    height: 34px;
}

.btn-deal-action,
.btn-deal-outline,
.btn-deal-primary {
    flex: 1;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 0.65rem;
    white-space: nowrap;
    user-select: none;
}

.btn-deal-outline:active,
.btn-deal-primary:active {
    transform: scale(0.97);
}

.btn-deal-outline {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.btn-deal-outline:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.btn-deal-primary.daangn-action {
    background: #ff6f0f;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 111, 15, 0.24);
}

.btn-deal-primary.daangn-action:hover {
    background: #ea580c;
    box-shadow: 0 4px 12px rgba(255, 111, 15, 0.32);
}

.btn-deal-primary.bunjang-action {
    background: #e11d48;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.24);
}

.btn-deal-primary.bunjang-action:hover {
    background: #be123c;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.32);
}

/* ========================================================
   8. [탭 3] 스펙 매트릭스 & 차트
   ======================================================== */
.panel-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.spec-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.65rem;
}

.spec-matrix-card {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.spec-matrix-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.spec-matrix-card.active-filter {
    background: var(--primary-light);
    border-color: var(--primary);
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.chart-card {
    margin-bottom: 0;
}

.chart-sub-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ========================================================
   9. [탭 5] 설정 & 텔레그램 연동 그리드
   ======================================================== */
.settings-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 1080px;
}

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

/* ========================================================
   10. 공용 컴포넌트: Buttons, Badges, Modals, Toast
   ======================================================== */
.btn {
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}

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

/* Toss Signature Blue */
.btn-primary {
    background: #3182f6;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(49, 130, 246, 0.22);
}

.btn-primary:hover {
    background: #2272eb;
    box-shadow: 0 4px 10px rgba(49, 130, 246, 0.28);
}

.btn-primary:active {
    background: #1b64da;
    box-shadow: 0 1px 3px rgba(49, 130, 246, 0.2);
}

/* Toss Subtle Neutral Gray */
.btn-secondary {
    background: #f2f4f6;
    color: #333d4b;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: #e5e8eb;
    color: #191f28;
}

.btn-secondary:active {
    background: #dbe0e5;
}

/* Apple Intelligence Soft Tint */
.btn-ai {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.btn-ai:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-ai:active {
    background: #bfdbfe;
}

/* Toss Soft Danger Tint */
.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-danger:active {
    background: #fca5a5;
}

.btn-sm {
    padding: 0.28rem 0.62rem;
    font-size: 0.76rem;
    border-radius: 8px;
}

/* Badges */
.badge {
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.badge-online {
    background: #d1fae5;
    color: #065f46;
}

.badge-subtle {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-deal {
    background: #dc2626;
    color: #ffffff;
}

.badge-peak {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fdba74;
}

.badge-daangn {
    background: #ffedd5;
    color: var(--accent-carrot);
    border: 1px solid #fdba74;
    font-weight: 800;
}

.badge-bunjang {
    background: #fee2e2;
    color: var(--accent-bunjang);
    border: 1px solid #fca5a5;
    font-weight: 800;
}

.badge-lowest {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #f87171;
    font-weight: 800;
}

.badge-price-drop {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
    font-weight: 800;
}

.badge-dealer {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid #cbd5e1;
}

.badge-battery {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.badge-retail-origin {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 1.5px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.grid-retail-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(15, 23, 42, 0.85);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.deal-retail-sub {
    font-size: 0.76rem;
    color: #0369a1;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 2.5px 8px;
    border-radius: 5px;
    margin-top: 4px;
    line-height: 1.35;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    margin-right: 0.2rem;
}

.tag-exclude {
    background: #fee2e2;
    color: #991b1b;
}

.tag-subtle {
    background: var(--bg-subtle);
    color: var(--text-tertiary);
}

/* Forms */
.form-group {
    margin-bottom: 0.85rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
}

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

/* 🏷️ 테이블 및 카드 인라인 플랫폼 바로가기 버튼 */
.btn-platform-action {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0.22rem 0.52rem;
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-platform-daangn {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.btn-platform-daangn:hover {
    background: #ffedd5;
    color: #c2410c;
    border-color: #fdba74;
}

.btn-platform-bunjang {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
}

.btn-platform-bunjang:hover {
    background: #ffe4e6;
    color: #be123c;
    border-color: #fda4af;
}

.btn-arrow-svg {
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.btn-platform-action:hover .btn-arrow-svg {
    transform: translate(1px, -1px);
}

/* 🏷️ 테이블/모바일 네고 복사 버튼 */
.btn-table-nego,
.btn-nego {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f2f4f6;
    color: #4e5968;
    border: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.22rem 0.52rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-table-nego:hover,
.btn-nego:hover {
    background: #e5e8eb;
    color: #191f28;
}

.btn-table-nego:active,
.btn-nego:active {
    background: #dbe0e5;
    transform: scale(0.97);
}

/* 🏷️ 테이블 AI 분석 버튼 & 뱃지 */
.btn-table-ai {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.22rem 0.52rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-table-ai:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

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

.badge-ai-grade {
    display: inline-flex;
    align-items: center;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.2rem 0.52rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.badge-ai-grade:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-ai-grade:active {
    transform: scale(0.97);
}

/* 📍 지역 및 등록시간 스타일 (미확인 방지 & 깔끔한 정렬) */
.table-region-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.region-prov-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 5px;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.2);
    line-height: 1.25;
    white-space: nowrap;
    flex-shrink: 0;
}

[data-theme="dark"] .region-prov-tag {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.3);
}

.region-dong-text {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-time-text {
    font-size: 0.70rem;
    color: var(--text-tertiary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 3px;
}

.table-meta-svg {
    flex-shrink: 0;
    opacity: 0.65;
}

.deal-meta-svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.deal-meta-region {
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.deal-meta-time {
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.mobile-sub-region {
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mobile-sub-time {
    color: var(--text-tertiary);
}

.meta-dot {
    color: var(--text-disabled);
    font-size: 0.75rem;
    user-select: none;
}

.price-original-struck {
    font-size: 0.74rem;
    color: var(--text-disabled);
    text-decoration: line-through;
}

/* Toast */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #191f28;
    color: #ffffff;
    padding: 0.75rem 1.15rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-notification.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* 🔔 실시간 급매/가격인하 플로팅 토스트 배너: 상단 헤더 가리지 않도록 우측 하단 배치 */
.live-alert-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    z-index: 10001;
    pointer-events: none;
    max-width: 420px;
    width: calc(100vw - 32px);
}

.live-alert-toast {
    pointer-events: auto;
    background: var(--bg-surface);
    border: 1.5px solid rgba(255, 111, 15, 0.45);
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 111, 15, 0.15);
    overflow: hidden;
    cursor: pointer;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}

.live-alert-toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.live-alert-toast.live-toast-fade-out {
    animation: toastSlideOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(60px) scale(0.92);
    }
}

.live-toast-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    position: relative;
}

.live-toast-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.live-toast-fallback {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: rgba(255, 111, 15, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.live-toast-content {
    flex: 1;
    min-width: 0;
}

.live-toast-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.live-toast-type-pill {
    background: linear-gradient(135deg, #ff6f0f, #ff3b30);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: -0.3px;
}

.live-toast-time {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.live-toast-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.live-toast-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-toast-price {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--primary);
}

.live-toast-badge-disc {
    background: #fee2e2;
    color: #ef4444;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.live-toast-cta {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.live-toast-close-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.live-toast-close-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

/* Shortcuts */
.btn-lowest-shortcut {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-weight: 600;
    font-size: 0.74rem;
    padding: 0.28rem 0.55rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-lowest-shortcut:hover {
    background: #fee2e2;
    color: #991b1b;
}

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

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    z-index: 140;
}

.mobile-crawl-btn {
    display: none;
}

.badge-text-mobile {
    display: none;
}

.badge-text-full {
    display: inline;
}

.desktop-only-btn {
    display: inline-flex;
}

.sidebar-top-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-sidebar-add-kw {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.28rem 0.58rem;
    border-radius: 8px;
}

/* ========================================================
   📱 모바일 전용 토스/애플 스타일 화면 전환 & 뷰포트 규칙 (<= 820px)
   ======================================================== */
@media (max-width: 820px) {
    html {
        height: auto !important;
        min-height: 100% !important;
        overflow-x: hidden !important;
        overflow-y: scroll !important;
        /* 브라우저 윈도우 스크롤 강제 활성화 */
        -webkit-overflow-scrolling: touch;
    }

    body {
        height: auto !important;
        min-height: 100% !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        /* body 내부 스크롤 락 해제 */
    }

    .app-header {
        height: 52px;
        padding: 0 0.85rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .header-center {
        display: none !important;
        /* 상단 복잡한 세그먼트 탭 숨김 */
    }

    .segmented-tabs {
        display: none !important;
    }

    /* 모바일 헤더 우측: 불필요한 아이콘들(테마, 알림벨) 모두 제거하고 [가동중 + 사용자 pill]만 깔끔하게 */
    .header-right {
        display: flex !important;
        align-items: center;
        gap: 0.45rem;
    }

    /* 모바일에서 잡다한 아이콘 도구 완전 제거 */
    #btnSoundToggle,
    #btnPushToggle,
    #btnThemeToggle,
    .notif-bell-wrapper,
    .mobile-crawl-btn,
    .desktop-only-btn {
        display: none !important;
    }

    #authHeaderArea {
        display: inline-flex !important;
        align-items: center;
        flex-shrink: 0;
    }

    .auth-user-pill {
        padding: 0.28rem 0.65rem !important;
        font-size: 0.76rem !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.3rem !important;
        background: var(--bg-subtle) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: var(--radius-pill) !important;
    }

    .auth-user-pill .header-username {
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    .btn-logout {
        padding: 2px 6px !important;
        font-size: 0.68rem !important;
        border-radius: 4px !important;
        margin-left: 2px !important;
    }

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

    .scheduler-pill-box {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .status-indicator-pill {
        font-size: 0.74rem !important;
        padding: 0.25rem 0.5rem !important;
        white-space: nowrap;
    }

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

    .badge-text-mobile {
        display: inline !important;
        font-weight: 700;
    }

    /* 하단 애플 거울모드 네비게이션은 모바일에서 상시 고정 표시 */
    .mobile-bottom-nav {
        display: flex !important;
    }

    .app-layout {
        height: auto !important;
        min-height: calc(100vh - 52px) !important;
        flex-direction: column !important;
        overflow: visible !important;
        position: relative !important;
    }

    /* 1. 기본 상태: 모바일 키워드 선택 화면 (Full Screen List) */
    .sidebar {
        position: relative !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: calc(100vh - 52px) !important;
        z-index: 10 !important;
        box-shadow: none !important;
        border-right: none !important;
        display: flex !important;
        overflow: visible !important;
        padding-bottom: 85px !important;
        /* 하단 탭 바 60px 여백 확보 */
    }

    .sidebar-top-bar {
        padding: 1rem 1rem 0.65rem 1rem;
    }

    .sidebar-top-heading {
        font-size: 1rem !important;
        font-weight: 800 !important;
        color: var(--text-primary) !important;
    }

    .sidebar-search-wrap {
        padding: 0 1rem 0.75rem 1rem;
    }

    .sidebar-search-input {
        padding: 0.55rem 0.85rem;
        font-size: 0.88rem;
    }

    .keyword-list {
        overflow: visible !important;
        height: auto !important;
        padding: 0.25rem 1rem 2rem 1rem;
        gap: 0.5rem;
    }

    .keyword-card {
        padding: 0.85rem 1rem !important;
        border-radius: 12px !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: var(--shadow-sm);
    }

    .keyword-card:active {
        background: #f8fafc !important;
        transform: scale(0.99);
    }

    .keyword-card .kw-name {
        font-size: 0.98rem !important;
        font-weight: 800 !important;
    }

    .keyword-card .kw-meta {
        font-size: 0.78rem !important;
        margin-top: 2px;
    }

    .mobile-kw-chevron {
        font-size: 1.25rem;
        color: var(--text-tertiary);
        font-weight: 700;
        line-height: 1;
    }

    /* 상세 작업 영역은 키워드 선택 전까지 숨김 */
    .main-content {
        display: none !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0.65rem 0.75rem 85px 0.75rem !important;
        /* 하단 탭 바 75px 여백 확보 */
    }

    /* 2. 키워드 선택 후: 상세 뷰로 전환 (Screen Push Transition) */
    body.mobile-detail-open .sidebar,
    #appLayout.mobile-detail-open .sidebar {
        display: none !important;
    }

    body.mobile-detail-open .main-content,
    #appLayout.mobile-detail-open .main-content {
        display: flex !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        animation: slideInFromRight 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-back-btn {
        display: inline-flex !important;
    }

    /* 3. 데스크탑 테이블 숨김, 모바일 리스트/카드 뷰 모드 반응형 전환 */
    .desktop-table-wrapper {
        display: none !important;
    }

    .articles-view-container.mode-list .mobile-feed-wrapper {
        display: flex !important;
        height: auto !important;
        overflow: visible !important;
        padding-bottom: 85px !important;
    }

    .articles-view-container.mode-list .articles-cards-grid {
        display: none !important;
    }

    .articles-view-container.mode-card .mobile-feed-wrapper {
        display: none !important;
    }

    /* 모바일에서는 하단 번호 페이지네이션 숨김 (무한 스크롤 적용) */
    .table-pagination-footer {
        display: none !important;
    }

    /* 모바일 상세 뷰 헤더 정리 - 마진과 패딩을 주어 글자 겹침 및 이탈 방지 */
    .workspace-header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        margin-bottom: 0.75rem;
    }

    .header-info-group {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.65rem;
    }

    .mobile-back-btn {
        display: inline-flex !important;
        flex-shrink: 0;
        padding: 0.35rem 0.65rem !important;
        font-size: 0.8rem !important;
    }

    .keyword-title-column {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        min-width: 0;
    }

    .keyword-title-row {
        display: flex;
        align-items: center;
        gap: 0.45rem;
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: hidden;
    }

    .keyword-main-title {
        font-size: 1.15rem !important;
        font-weight: 800 !important;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        line-height: 1.25;
        min-width: 0;
        overflow: hidden;
    }

    #detailTitle {
        max-width: 170px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }

    /* 모바일에서는 중복되는 5분 주기 배지 및 제외단어 없음 안내는 숨겨서 1줄로 단정하게 정리 */
    #detailIntervalBadge,
    #detailExcludeTags {
        display: none !important;
    }

    .header-controls-group {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        margin-top: 0.15rem;
    }

    .header-controls-group .btn {
        flex: 1;
        justify-content: center;
        padding: 0.42rem 0.65rem;
        font-size: 0.78rem;
        font-weight: 700;
        border-radius: 8px;
    }

    /* 모바일 인라인 시세 지표 바 - 넉넉한 내부 패딩과 마진, 가로 스크롤 부드럽게 */
    .metrics-inline-bar {
        display: flex;
        align-items: center;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        gap: 0.55rem;
        font-size: 0.76rem;
        padding: 0.35rem 0.65rem;
        border-radius: 8px;
        margin: 0.1rem 0;
    }
    .metrics-inline-bar::-webkit-scrollbar {
        display: none;
    }

    /* 모바일 필터 툴바 2단 정리 - 적절한 마진과 패딩 부여 */
    .unified-filter-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        height: auto;
        margin-bottom: 0.65rem;
    }

    .filter-toolbar-left {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .filter-toolbar-left::-webkit-scrollbar {
        display: none;
    }

    .mini-platform-segments {
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
        display: inline-flex;
        gap: 2px;
    }
    .mini-platform-segments::-webkit-scrollbar {
        display: none;
    }

    .platform-tab-btn {
        padding: 0.32rem 0.55rem;
        font-size: 0.76rem;
        white-space: nowrap;
    }

    .btn-filter-drawer-toggle {
        padding: 0.32rem 0.65rem;
        font-size: 0.76rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .filter-toolbar-right {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        padding-bottom: 2px;
    }

    .filter-select-mini {
        font-size: 0.76rem;
        padding: 0.32rem 0.55rem;
        flex-shrink: 0;
    }

    .search-mini-field {
        flex: 1;
        min-width: 0;
    }

    .search-mini-field input {
        width: 100% !important;
        font-size: 0.78rem;
        padding: 0.32rem 0.6rem;
        border-radius: 6px;
    }

    .article-total-count {
        display: none !important;
    }

    /* 모바일에서도 리스트/카드형 전환 토글 탭 상시 노출 */
    .view-mode-toggle-group {
        display: inline-flex !important;
        flex-shrink: 0;
        margin-left: auto;
        border-radius: 8px;
        padding: 2px;
    }

    .btn-view-toggle {
        padding: 4px 8px !important;
        font-size: 0.74rem !important;
        font-weight: 700 !important;
    }

    /* 카테고리 / 용량 칩 바 모바일 마진 정리 */
    .storage-chips-row {
        gap: 0.45rem;
        margin-bottom: 0.65rem;
        padding: 0.1rem 0 0.35rem 0;
    }

    .chip-item {
        padding: 0.3rem 0.65rem;
        font-size: 0.76rem;
    }

    /* 모바일 카드 뷰: 위아래 적절한 여백과 정보 영역 패딩, 텍스트 글자 벗어남 방지 */
    .articles-view-container.mode-card .articles-cards-grid {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 1.1rem;
        padding-bottom: 95px !important;
    }

    .articles-view-container.mode-card .articles-cards-grid .article-grid-card {
        height: 420px !important;
        min-height: 420px !important;
        border-radius: 16px;
    }

    .articles-view-container.mode-card .grid-card-glass-overlay {
        padding: 14px 16px 14px !important;
        gap: 7px !important;
        /* 어두운 그라데이션을 은은하게 깔아주어 글자가 제품 사진 위에서 전혀 벗어나거나 묻히지 않게 처리 */
        background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.65) 60%, transparent 100%) !important;
    }

    .articles-view-container.mode-card .glass-card-title {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
    }

    .articles-view-container.mode-card .glass-card-desc {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
        color: #e2e8f0 !important;
    }

    .articles-view-container.mode-card .glass-actions-row {
        gap: 7px !important;
        margin-top: 3px !important;
    }

    .articles-view-container.mode-card .btn-card-action {
        padding: 8px 6px !important;
        font-size: 0.78rem !important;
        border-radius: 8px !important;
    }

    .detail-workspace {
        height: auto !important;
        overflow: visible !important;
    }

    .workspace-viewport {
        height: auto !important;
        overflow: visible !important;
    }

    .tab-content {
        height: auto !important;
        overflow: visible !important;
    }

    .tab-content.active-tab-pane {
        display: block !important;
    }

    .tab-scroll-pane {
        height: auto !important;
        overflow: visible !important;
        padding-right: 0 !important;
    }

    .deals-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.1rem !important;
        height: auto !important;
        overflow: visible !important;
        padding-bottom: 95px !important;
    }

    .deals-grid .deal-card-premium {
        height: 420px !important;
        min-height: 420px !important;
        border-radius: 16px !important;
    }

    .deals-grid .grid-card-glass-overlay {
        padding: 14px 16px 14px !important;
        gap: 7px !important;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.65) 60%, transparent 100%) !important;
    }

    .deals-grid .glass-card-title {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
    }

    .deals-grid .glass-card-desc {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
        color: #e2e8f0 !important;
    }

    .deals-grid .glass-actions-row {
        gap: 7px !important;
        margin-top: 3px !important;
    }

    .deals-grid .btn-card-action {
        padding: 8px 6px !important;
        font-size: 0.78rem !important;
        border-radius: 8px !important;
    }

    .deal-pricing-block {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }

    .articles-pane-layout {
        height: auto !important;
        overflow: visible !important;
    }

    .charts-grid {
        grid-template-columns: 1fr !important;
        height: auto !important;
        overflow: visible !important;
    }

    .settings-layout-grid {
        grid-template-columns: 1fr !important;
        height: auto !important;
        overflow: visible !important;
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(18px);
    }

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

/* ==========================================================================
   🖼️ 사진 확대 라이트박스 뷰어 (Apple / Toss 스타일 프리미엄 글래스모피즘 모달)
   ========================================================================== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 15, 29, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
    animation: lightboxFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.lightbox-container {
    position: relative;
    max-width: 920px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    cursor: default;
    animation: lightboxPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes lightboxPopIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }

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

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.25rem;
    background: rgba(30, 41, 59, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.lightbox-platform-badge {
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.lightbox-platform-badge.daangn {
    background: #ff6f0f;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 111, 15, 0.35);
}

.lightbox-platform-badge.bunjang {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.lightbox-title-box {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.lightbox-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.lightbox-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: #38bdf8;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.lightbox-header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.lightbox-btn-article {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.46rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transition: all 0.15s ease;
}

.lightbox-btn-article:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
    color: #ffffff;
}

.lightbox-btn-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.lightbox-btn-close:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transform: scale(1.06);
}

.lightbox-body {
    background: #020617;
    flex: 1;
    min-height: 280px;
    max-height: calc(88vh - 130px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.25rem;
}

.lightbox-img-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.lightbox-img {
    max-width: 100%;
    max-height: calc(88vh - 160px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
    user-select: none;
}

.lightbox-footer {
    padding: 0.75rem 1.25rem;
    background: rgba(15, 23, 42, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.lightbox-tip-text {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.45;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lightbox-tip-bulb {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.lightbox-footer-mobile-link {
    display: none;
    font-size: 0.82rem;
    font-weight: 700;
    color: #38bdf8;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

/* 🖼️ 실시간 급매 카드 이미지 클릭 & 줌 인터랙션 */
.deal-media-box {
    cursor: zoom-in;
}

.deal-media-zoom-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    opacity: 0.88;
    transition: all 0.2s ease;
    z-index: 3;
    pointer-events: none;
}

.deal-media-box:hover .deal-media-zoom-overlay {
    opacity: 1;
    transform: scale(1.05);
    background: rgba(15, 23, 42, 0.9);
}

/* 🖼️ 매물 목록 테이블 썸네일 클릭 & 줌 인터랙션 (1:1 비율 행/열 꽉찬 정사각 썸네일) */
.data-table td.table-img-cell,
.data-table td:nth-child(2) {
    padding: 0.4rem 0.45rem;
}

.table-img-container {
    position: relative;
    width: 72px;
    height: 72px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    cursor: zoom-in;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.table-img-container:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
}

.table-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.table-no-img {
    width: 72px;
    height: 72px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-tertiary);
    border: 1px dashed var(--border-color);
}

.table-img-container:hover .table-img-thumb {
    transform: scale(1.12);
}

.table-img-hover-badge {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.table-img-container:hover .table-img-hover-badge {
    opacity: 1;
}

/* 🖼️ 모바일 피드 카드 썸네일 줌 뱃지 */
.mobile-card-media {
    cursor: zoom-in;
}

.mobile-media-zoom-pill {
    position: absolute;
    bottom: 3px;
    right: 3px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 4px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.58rem;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

/* 모바일 전용 반응형 라이트박스 */
@media (max-width: 768px) {
    .lightbox-overlay {
        padding: 0.65rem;
    }

    .lightbox-container {
        max-height: 94vh;
        border-radius: 16px;
    }

    .lightbox-header {
        padding: 0.75rem 1rem;
    }

    .lightbox-title-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .lightbox-title {
        font-size: 0.88rem;
        max-width: calc(100vw - 140px);
    }

    .lightbox-price {
        font-size: 0.92rem;
    }

    .lightbox-btn-article {
        display: none !important;
    }

    .lightbox-footer-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .lightbox-footer-mobile-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0.6rem;
        font-size: 0.88rem;
        text-align: center;
    }

    .lightbox-tip-text {
        font-size: 0.74rem;
    }

    .lightbox-body {
        padding: 0.75rem;
        min-height: 220px;
        max-height: calc(88vh - 160px);
    }
}

/* ========================================================
   🏛️ 중고나라 플랫폼 뱃지 및 테마
   ======================================================== */
.badge-joongna,
.tag-joongna,
.deal-platform-pill.joongna,
.platform-badge.platform-joongna {
    background: #e8f0fe !important;
    color: #1a73e8 !important;
    border: 1px solid #cce0ff !important;
    font-weight: 700;
}

[data-theme="dark"] .badge-joongna,
[data-theme="dark"] .tag-joongna,
[data-theme="dark"] .deal-platform-pill.joongna,
[data-theme="dark"] .platform-badge.platform-joongna {
    background: #1e3a8a !important;
    color: #93c5fd !important;
    border-color: #2563eb !important;
}

.tab-joongna.active {
    background: #1a73e8 !important;
    color: #ffffff !important;
}

.btn-platform-joongna {
    background: #1a73e8;
    color: #ffffff;
}

.btn-platform-joongna:hover {
    background: #1557b0;
    color: #ffffff;
}

/* 🎯 목표 스펙 타겟팅 배지 (보라-인디고 하이라이트) */
.badge-target-spec {
    background: linear-gradient(135deg, #ede9fe, #f5f3ff) !important;
    color: #6d28d9 !important;
    border: 1px solid #ddd6fe !important;
    font-weight: 800 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
[data-theme="dark"] .badge-target-spec {
    background: linear-gradient(135deg, #3b0764, #4c1d95) !important;
    color: #ddd6fe !important;
    border-color: #6d28d9 !important;
}

.badge-target-matched {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
    font-weight: 800 !important;
}
[data-theme="dark"] .badge-target-matched {
    background: #064e3b !important;
    color: #6ee7b7 !important;
    border-color: #059669 !important;
}

/* ========================================================
   ⚠️ 사기/미끼 경고 및 안전결제 배지
   ======================================================== */
.badge-danger-fraud {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
    font-weight: 800 !important;
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

[data-theme="dark"] .badge-danger-fraud {
    background: #450a0a !important;
    color: #fca5a5 !important;
    border-color: #991b1b !important;
}

.badge-safepay,
.deal-safepay-badge {
    background: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
    font-weight: 700 !important;
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

[data-theme="dark"] .badge-safepay,
[data-theme="dark"] .deal-safepay-badge {
    background: #064e3b !important;
    color: #6ee7b7 !important;
    border-color: #047857 !important;
}

/* ========================================================
   📍 내 동네 매물 직거래 추천 배지 & 필터 버튼
   ======================================================== */
.badge-my-region {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
    font-weight: 800 !important;
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

[data-theme="dark"] .badge-my-region {
    background: #14532d !important;
    color: #86efac !important;
    border-color: #15803d !important;
}

.my-region-pill-box {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1px 3px;
    gap: 2px;
}

.btn-my-region {
    border: none !important;
    background: transparent !important;
    font-size: 0.76rem !important;
    padding: 3px 8px !important;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    border-radius: var(--radius-pill);
}

.btn-my-region.active {
    background: #059669 !important;
    color: #ffffff !important;
}

.btn-region-edit {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    padding: 2px 4px;
    border-radius: 4px;
}

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

/* ========================================================
   💰 리셀 / 되팔기 예상 차익 (Flip Margin) 배지 & 최근 거래완료가 기준
   ======================================================== */
.badge-flip-margin,
.deal-flip-margin-pill {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.74rem;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.deal-flip-basis-tag {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.67rem;
    font-weight: 700;
    color: #f0fdf4;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.deal-recent-completed-sub {
    font-size: 0.68rem;
    margin-left: 4px;
    color: #059669;
    font-weight: 700;
}

[data-theme="dark"] .deal-recent-completed-sub {
    color: #34d399;
}

.article-flip-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #059669;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

[data-theme="dark"] .article-flip-badge {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(52, 211, 153, 0.4);
    color: #34d399;
}

/* ========================================================
   🔗 최근 거래완료 매물 원문 바로가기 링크
   ======================================================== */
.deal-recent-completed-link,
.article-completed-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #059669 !important;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.69rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.deal-recent-completed-link:hover,
.article-completed-shortcut:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #059669;
    color: #047857 !important;
    transform: translateY(-1px);
}

[data-theme="dark"] .deal-recent-completed-link,
[data-theme="dark"] .article-completed-shortcut {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(52, 211, 153, 0.45);
    color: #34d399 !important;
}

[data-theme="dark"] .deal-recent-completed-link:hover,
[data-theme="dark"] .article-completed-shortcut:hover {
    background: rgba(16, 185, 129, 0.32);
    border-color: #34d399;
    color: #6ee7b7 !important;
}

/* 딜 카드 / 마이페이지 차익 뱃지 내부 미니 바로가기 링크 */
.deal-flip-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #f0fdf4 !important;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.67rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.deal-flip-link-btn:hover {
    background: rgba(0, 0, 0, 0.52);
    border-color: #ffffff;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* ========================================================
   ★ 찜(관심) & 🚫 숨김 버튼
   ======================================================== */
.btn-card-fav,
.btn-table-fav {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 3px 7px;
    font-size: 0.85rem;
    line-height: 1;
    transition: all 0.15s ease;
}

.btn-card-fav:hover,
.btn-table-fav:hover {
    color: #eab308;
    border-color: #facc15;
    background: rgba(234, 179, 8, 0.1);
}

.btn-card-fav.active,
.btn-table-fav.active {
    color: #eab308 !important;
    background: rgba(234, 179, 8, 0.15) !important;
    border-color: #eab308 !important;
    font-weight: 800;
}

.btn-card-hide,
.btn-table-hide {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 3px 6px;
    font-size: 0.75rem;
    line-height: 1;
    transition: all 0.15s ease;
}

.btn-card-hide:hover,
.btn-table-hide:hover {
    color: #dc2626;
    border-color: #f87171;
    background: rgba(220, 38, 38, 0.1);
}

/* ========================================================
   💬 원클릭 바로 대화 (Direct Chat) 버튼
   ======================================================== */
.btn-direct-chat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-chat-daangn {
    background: #ff6f0f;
    color: #ffffff;
}

.btn-chat-daangn:hover {
    background: #ea580c;
    color: #ffffff;
}

.btn-chat-bunjang {
    background: #ef4444;
    color: #ffffff;
}

.btn-chat-bunjang:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-chat-joongna {
    background: #1a73e8;
    color: #ffffff;
}

.btn-chat-joongna:hover {
    background: #1557b0;
    color: #ffffff;
}

/* 날짜별 시세 변동 추이 차트 카드 */
.full-width-chart {
    grid-column: 1 / -1;
}

/* ========================================================
   👤 사용자 계정 인증 & 헤더 프로필 & 모달 UI
   ======================================================== */
.auth-header-area {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 111, 15, 0.1);
    color: var(--primary-color, #ff6f0f);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 111, 15, 0.25);
    white-space: nowrap;
}

[data-theme="dark"] .auth-user-pill {
    background: rgba(255, 111, 15, 0.15);
    border-color: rgba(255, 111, 15, 0.35);
}

.auth-user-pill .user-avatar-badge {
    font-size: 0.85rem;
}

.auth-user-pill .header-username {
    font-weight: 700;
}

.btn-xs {
    padding: 2px 7px;
    font-size: 0.72rem;
    border-radius: 4px;
}

.btn-logout {
    margin-left: 4px;
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-logout:hover {
    background: rgba(255, 111, 15, 0.2);
}

.btn-login-open {
    font-weight: 600;
    white-space: nowrap;
}

/* Auth Modal Container */
.auth-modal-box {
    max-width: 420px;
    width: 90%;
}

.auth-tabs {
    display: flex;
    background: var(--bg-hover, #f1f5f9);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    gap: 4px;
}

[data-theme="dark"] .auth-tabs {
    background: #1e293b;
}

.auth-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    background: var(--bg-card, #ffffff);
    color: var(--primary-color, #ff6f0f);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .auth-tab-btn.active {
    background: #334155;
    color: #f97316;
}

.auth-error-msg {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ========================================================
   13. 마이페이지 (My Page) UI 컴포넌트
   ======================================================== */
.mypage-scroll-pane {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 1080px;
    margin: 0 auto;
    width: 100%;
}

.mypage-profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 1rem;
}

.mypage-profile-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mypage-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(49, 130, 246, 0.15), rgba(255, 111, 15, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border: 2px solid var(--border-color);
}

.mypage-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mypage-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.mypage-subtext {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0.2rem 0 0 0;
}

.mypage-profile-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.mypage-stat-pill {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.mypage-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.mypage-stat-val {
    font-size: 1.15rem;
    font-weight: 800;
}

/* 마이페이지 서브탭 */
.mypage-subnav {
    display: flex;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.mypage-subtab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 14px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.mypage-subtab-btn:hover {
    color: var(--text-primary);
}

.mypage-subtab-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .mypage-subtab-btn.active {
    background: #1e293b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* 마이페이지 찜한 매물 그리드 */
.mypage-fav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.mypage-fav-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s ease;
}

.mypage-fav-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.mypage-fav-thumb-box {
    position: relative;
    width: 100%;
    height: 160px;
    background: var(--bg-subtle);
    overflow: hidden;
}

.mypage-fav-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.mypage-fav-card:hover .mypage-fav-thumb {
    transform: scale(1.04);
}

.mypage-fav-platform-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.mypage-fav-deal-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

.mypage-fav-body {
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.4rem;
}

.mypage-fav-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mypage-fav-kw-chip {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--primary);
}

.mypage-fav-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mypage-fav-specs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.mypage-fav-price-row {
    margin-top: auto;
    padding-top: 0.4rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.mypage-fav-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.mypage-fav-actions {
    display: flex;
    border-top: 1px solid var(--border-color);
    background: var(--bg-subtle);
}

.mypage-fav-btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    transition: background 0.15s ease;
    text-decoration: none;
}

.mypage-fav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mypage-fav-btn.btn-unfav {
    color: #ef4444;
}

.mypage-fav-btn.btn-unfav:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* 마이페이지 빈 상태 */
.mypage-empty-box {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

.mypage-empty-box .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.6rem;
}

.mypage-empty-box .empty-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.mypage-empty-box .empty-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto;
}


/* 🏷️ 동일 제품 판매중 평균가 배지 및 다면 시세 비교 분석 */
.badge-active-avg {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
    border-radius: 4px;
    padding: 1.5px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .badge-active-avg {
    background: rgba(109, 40, 217, 0.2);
    color: #c4b5fd;
    border-color: rgba(167, 139, 250, 0.35);
}

/* ✅ 동일 제품 판매완료(실거래) 평균가 배지 */
.badge-completed-avg {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 1.5px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .badge-completed-avg {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.35);
}

.grid-completed-avg-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(6, 78, 59, 0.85);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.45);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.grid-active-avg-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(15, 23, 42, 0.85);
    color: #c4b5fd;
    border: 1px solid rgba(167, 139, 250, 0.45);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.deal-active-avg-sub {
    font-size: 0.78rem;
    color: #6d28d9;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    margin-bottom: 2px;
}

[data-theme="dark"] .deal-active-avg-sub {
    color: #c4b5fd;
}

/* 4각 다면 시세 분석 그리드 (모달) */
.modal-price-analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 1.15rem;
}

@media (max-width: 640px) {
    .modal-price-analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.modal-price-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.modal-price-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.modal-price-card .stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
}

.modal-price-card .stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 3px;
    white-space: nowrap;
}

.modal-price-card .stat-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-price-card.card-current {
    border-color: #fdba74;
    background: linear-gradient(180deg, rgba(254, 215, 170, 0.18) 0%, var(--bg-card) 100%);
}
.modal-price-card.card-current .stat-value {
    color: #ea580c;
}

.modal-price-card.card-active {
    border-color: #ddd6fe;
    background: linear-gradient(180deg, rgba(221, 214, 254, 0.22) 0%, var(--bg-card) 100%);
}
.modal-price-card.card-active .stat-value {
    color: #7c3aed;
}

.modal-price-card.card-completed {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, rgba(187, 247, 208, 0.22) 0%, var(--bg-card) 100%);
}
.modal-price-card.card-completed .stat-value {
    color: #16a34a;
}

.modal-price-card.card-retail {
    border-color: #bae6fd;
    background: linear-gradient(180deg, rgba(186, 230, 253, 0.22) 0%, var(--bg-card) 100%);
}
.modal-price-card.card-retail .stat-value {
    color: #0284c7;
}

[data-theme="dark"] .modal-price-card.card-current {
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.08);
}
[data-theme="dark"] .modal-price-card.card-active {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.08);
}
[data-theme="dark"] .modal-price-card.card-completed {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
}
[data-theme="dark"] .modal-price-card.card-retail {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.08);
}

/* ========================================================
   🔔 실시간 알림 센터 & 알림 히스토리 기록함 스타일
   ======================================================== */
.notif-bell-wrapper {
    position: relative;
    display: inline-flex;
}

.notif-bell-btn {
    position: relative;
}

.notif-badge-pill {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f04452;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
    box-shadow: 0 2px 4px rgba(240, 68, 82, 0.4);
    animation: pulseNotif 2.2s infinite;
    pointer-events: none;
}

#notifBellIcon {
    pointer-events: none;
}

@keyframes pulseNotif {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.notif-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-width: 92vw;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInDropdown 0.16s ease-out;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.notif-dropdown-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.notif-unread-count-badge {
    background: rgba(49, 130, 246, 0.12);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

.notif-dropdown-actions {
    display: flex;
    gap: 0.35rem;
}

.notif-filter-chips {
    display: flex;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}
.notif-filter-chips::-webkit-scrollbar {
    display: none;
}

.notif-chip {
    padding: 0.25rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.notif-chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notif-chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.notif-list-container {
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-card);
}

.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.notif-item:hover {
    background: var(--bg-hover);
}

.notif-item.unread {
    background: rgba(49, 130, 246, 0.04);
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

.notif-thumb-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-subtle);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

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

.notif-thumb-fallback {
    font-size: 1.4rem;
}

.notif-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.notif-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.notif-badges-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.notif-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
}

.notif-tag-deal {
    background: #fee2e2;
    color: #dc2626;
}

.notif-tag-lowest {
    background: #ffedd5;
    color: #ea580c;
}

.notif-tag-drop {
    background: #f3e8ff;
    color: #7c3aed;
}

.notif-tag-target {
    background: #dbeafe;
    color: #2563eb;
}

.notif-tag-platform {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.notif-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.notif-title {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.notif-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.15rem;
}

.notif-price-area {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.notif-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-discount-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ef4444;
}

.notif-del-btn {
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.notif-del-btn:hover {
    opacity: 1;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.notif-dropdown-footer {
    display: flex;
    justify-content: center;
    padding: 0.55rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-subtle);
}

.notif-empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-tertiary);
}

.notif-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.4rem;
    opacity: 0.5;
}

/* 마이페이지 알림 그리드 및 카드 */
.mypage-notif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.85rem;
}

.mypage-notif-card {
    display: flex;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mypage-notif-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mypage-notif-card.unread {
    border-color: rgba(49, 130, 246, 0.4);
    background: linear-gradient(180deg, rgba(49, 130, 246, 0.03) 0%, var(--bg-card) 100%);
}

.mypage-notif-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-subtle);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

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

/* 다크모드 대응 */
[data-theme="dark"] .notif-dropdown-panel {
    background: #182234;
    border-color: #334155;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .notif-dropdown-header {
    background: #182234;
    border-bottom-color: #334155;
}

[data-theme="dark"] .notif-filter-chips {
    background: #0f172a;
    border-bottom-color: #334155;
}

[data-theme="dark"] .notif-chip {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .notif-chip.active {
    background: var(--primary);
    color: #ffffff;
}

[data-theme="dark"] .notif-list-container {
    background: #182234;
}

[data-theme="dark"] .notif-item {
    border-bottom-color: #243044;
}

[data-theme="dark"] .notif-item:hover {
    background: #1e293b;
}

[data-theme="dark"] .notif-item.unread {
    background: rgba(49, 130, 246, 0.08);
}

[data-theme="dark"] .notif-dropdown-footer {
    background: #0f172a;
    border-top-color: #334155;
}

[data-theme="dark"] .notif-tag-deal {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

[data-theme="dark"] .notif-tag-lowest {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

[data-theme="dark"] .notif-tag-drop {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

[data-theme="dark"] .notif-tag-target {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

[data-theme="dark"] .mypage-notif-card {
    background: #182234;
    border-color: #334155;
}

[data-theme="dark"] .mypage-notif-card:hover {
    background: #1e293b;
}

/* ==========================================================================
   ✨ 방안 A: 미니멀 클린 레이아웃 (당근/토스식 클린 상단 바 & 슬릭 서랍)
   ========================================================================== */
.keyword-title-column {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 auto;
}

.keyword-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.metrics-inline-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.65rem;
    width: fit-content;
    max-width: 100%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    white-space: nowrap;
    overflow-x: auto;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.metric-pill-label {
    color: var(--text-tertiary);
    font-weight: 500;
}

.metric-pill-val {
    font-weight: 700;
    color: var(--text-primary);
}

.metric-pill-divider {
    color: var(--border-color);
    font-weight: bold;
    user-select: none;
}

/* 상세 필터 토글 버튼 */
.btn-filter-drawer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    height: 32px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-filter-drawer-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.btn-filter-drawer-toggle.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-active-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary-color);
    border-radius: 999px;
}

.drawer-arrow-icon {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

/* 접이식 상세 필터 서랍 */
.advanced-filter-drawer {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    animation: drawerSlideDown 0.18s ease-out;
}

@keyframes drawerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drawer-inner-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.drawer-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.drawer-group-title {
    min-width: 95px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.drawer-group-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.drawer-select {
    height: 30px;
    padding: 0 0.6rem;
    font-size: 0.78rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.drawer-pills-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

[data-theme="dark"] .metrics-inline-bar {
    background: #182234;
    border-color: #243044;
}

[data-theme="dark"] .advanced-filter-drawer {
    background: #151d2a;
    border-color: #243044;
}

[data-theme="dark"] .drawer-select {
    background: #1e293b;
    border-color: #334155;
}

/* ==========================================================================
   💬 테이블 액션 스택 레이아웃 (채팅 버튼 상단, 네고/숨김 하단 정렬)
   ========================================================================== */
.table-action-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.table-action-stack .btn-direct-chat {
    width: 100%;
    max-width: 114px;
    justify-content: center;
    padding: 6px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.table-action-subrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.table-action-subrow .btn-table-nego {
    width: 100%;
    max-width: 114px;
    height: 24px;
    padding: 0 8px;
    font-size: 0.74rem;
    font-weight: 600;
}

/* ==========================================================================
   💬 대화(채팅) & ❤️ 관심(좋아요) 수치 뱃지 (스펙 뱃지 오른편 인라인 배치)
   ========================================================================== */
.badge-engagement-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 3px;
}

.badge-chat-stat,
.badge-like-stat {
    display: inline-flex;
    align-items: center;
    padding: 1.5px 5px;
    border-radius: 4px;
    font-size: 0.69rem;
    font-weight: 600;
    line-height: 1;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.badge-chat-stat {
    color: #4b5563;
}

.badge-like-stat {
    color: #ef4444;
}

[data-theme="dark"] .badge-chat-stat,
[data-theme="dark"] .badge-like-stat {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .badge-chat-stat {
    color: #94a3b8;
}

[data-theme="dark"] .badge-like-stat {
    color: #f87171;
}
