:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* 상단 통합 내비게이션 바 */
.top-nav {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

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

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.85rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-menu a:hover {
    color: var(--primary);
    background-color: #eff6ff;
}

.nav-menu a.active {
    color: var(--primary);
    background-color: #eff6ff;
    font-weight: 600;
}

.btn-logout {
    color: #ef4444 !important;
}

.btn-logout:hover {
    background-color: #fef2f2 !important;
}

/* 메인 컨테이너 */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

.welcome-section {
    margin-bottom: 2rem;
}

.welcome-header-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.welcome-header-row h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0;
}

.weather-compact-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}
.weather-compact-badge:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}
.weather-compact-temp {
    color: #0284c7;
    font-weight: 700;
}
.weather-compact-desc {
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e2e8f0;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    margin-left: 0.1rem;
}

/* 📲 PWA 웹앱 설치 버튼 스타일 */
.btn-pwa-install {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 0.35rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}
.btn-pwa-install:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}
.unav-m-install-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 0.65rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    transition: all 0.2s;
}
.unav-m-install-btn:hover {
    background: #1d4ed8;
}

.welcome-section p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* 🚨 실시간 속보 한줄 롤링 티커 & 호버 전체목록 드롭다운 */
.breaking-banner-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: 12px;
    padding: 0.55rem 0.95rem;
    margin-top: 0.75rem;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
    transition: all 0.2s ease;
    z-index: 50;
    min-height: 46px;
    box-sizing: border-box;
}
.breaking-banner-bar:hover {
    border-color: #fca5a5;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.15);
}
.breaking-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fef2f2;
    color: #dc2626;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    margin-right: 0.75rem;
    flex-shrink: 0;
}
.breaking-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: breaking-pulse 1.8s infinite;
}
@keyframes breaking-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.breaking-ticker-viewport {
    flex: 1;
    height: 28px;
    line-height: 28px;
    overflow: hidden;
    position: relative;
    min-width: 0;
    box-sizing: border-box;
}
.breaking-ticker-track {
    position: relative;
    transition: transform 0.45s cubic-bezier(0.2, 0, 0, 1);
    will-change: transform;
}
.breaking-ticker-item {
    height: 28px;
    line-height: 28px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}
.breaking-ticker-item:hover {
    color: #dc2626;
}
.breaking-item-media {
    color: #64748b;
    font-size: 0.75rem;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.breaking-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.breaking-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    margin-left: 0.75rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.breaking-more-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}
.breaking-arrow {
    font-size: 0.95rem;
    line-height: 1;
}

/* 마우스 오버 시 전체 목록 드롭다운 레이어 */
.breaking-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    pointer-events: none;
    max-height: 380px;
    display: flex;
    flex-direction: column;
}
.breaking-banner-bar:hover .breaking-dropdown-panel,
.breaking-dropdown-panel:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.breaking-dropdown-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    background: #fff5f5;
    border-bottom: 1px solid #fee2e2;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
.breaking-dropdown-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #991b1b;
}
.breaking-dropdown-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: #dc2626;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #ffffff;
    border: 1px solid #fecaca;
}
.breaking-dropdown-link:hover {
    background: #fee2e2;
}
.breaking-dropdown-items {
    padding: 0.4rem 0.5rem;
    overflow-y: auto;
    max-height: 300px;
}
.breaking-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.84rem;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f8fafc;
}
.breaking-dropdown-item:last-child {
    border-bottom: none;
}
.breaking-dropdown-item:hover {
    background: #fff5f5;
    color: #dc2626;
}
.breaking-dropdown-item-title {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.breaking-dropdown-item-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #64748b;
    flex-shrink: 0;
}

/* 카드 그리드 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    border: 1px solid var(--border);
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.card-icon {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.925rem;
    margin-bottom: 1.25rem;
}

.card-summary {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 0.5rem;
    padding: 0.85rem;
    font-size: 0.9rem;
    color: #334155;
    margin-top: 0;
    margin-bottom: 1.25rem;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 혈압 & 투약 현황 라인 */
.summary-line {
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.summary-line.med-line {
    margin-bottom: 0;
    color: #475569;
    font-size: 0.84rem;
}
.badge-med {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* 자산 카드 컴팩트 요약 스타일 */
.asset-main-line {
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.4rem;
}
.asset-total-badge {
    color: #059669;
    font-size: 1.05rem;
    font-weight: 700;
}
.asset-sub-line {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0 !important;
    overflow: hidden;
}
.asset-ticker-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}
.stock-kor-name {
    color: #334155;
    font-weight: 600;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stock-price {
    color: #0f172a;
    font-weight: 700;
}
.stock-diff.up {
    color: #ef4444;
    font-size: 0.78rem;
    font-weight: 700;
}
.stock-diff.down {
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 700;
}

.card-link-btn {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    margin-top: auto;
}

/* 카드별 강조 컬러 */
.card-blood:hover h3 { color: #e11d48; }
.card-asset:hover h3 { color: #059669; }
.card-news:hover h3 { color: #2563eb; }
.card-memo:hover h3 { color: #d97706; }

/* 로그인 페이지 스타일 */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #09090b;
}

.login-card {
    background-color: #ffffff;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    border-radius: 1.25rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #334155;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-options {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
}

.checkbox-label input {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.btn-primary:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.error-msg {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

/* 모바일 반응형 최적화 */
@media (max-width: 640px) {
    .nav-container {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    .nav-menu {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }
    .container {
        padding: 1.25rem 0.85rem;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    .card-grid {
        grid-template-columns: 100%;
        gap: 1rem;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .service-card {
        padding: 1.15rem 1rem;
        border-radius: 0.85rem;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .card-desc {
        font-size: 0.85rem;
        margin-bottom: 0.85rem;
        word-break: keep-all;
    }
    .card-summary {
        min-height: auto;
        padding: 0.7rem 0.75rem;
        margin-bottom: 0.85rem;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .welcome-section {
        margin-bottom: 1.25rem;
        width: 100%;
        min-width: 0;
    }
    .welcome-section h2 {
        font-size: 1.35rem;
    }
    .stock-kor-name {
        max-width: 115px;
    }
    .news-market-bar {
        gap: 0.35rem;
        width: 100%;
        min-width: 0;
    }
    .news-market-chip {
        padding: 0.4rem 0.5rem;
        min-width: 0;
    }
    .news-market-chip .market-price {
        font-size: 0.85rem;
    }
    .news-market-chip .market-diff {
        font-size: 0.7rem;
    }
    .breaking-banner-bar {
        padding: 0.4rem 0.65rem !important;
        margin-top: 0.45rem !important;
        border-radius: 9px !important;
        min-height: 40px !important;
        box-sizing: border-box !important;
    }
    .breaking-badge {
        padding: 0.2rem 0.45rem !important;
        font-size: 0.78rem !important;
        gap: 0.3rem !important;
        margin-right: 0.45rem !important;
        flex-shrink: 0 !important;
    }
    .breaking-badge-text-full { display: none !important; }
    .breaking-badge-text-mobile { display: inline !important; }
    .breaking-ticker-viewport {
        height: 26px !important;
        line-height: 26px !important;
        box-sizing: border-box !important;
    }
    .breaking-ticker-item {
        height: 26px !important;
        line-height: 26px !important;
        font-size: 0.88rem !important;
        font-weight: 600 !important;
        box-sizing: border-box !important;
    }
    .breaking-more-btn {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.76rem !important;
        margin-left: 0.4rem !important;
        gap: 0.2rem !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    .breaking-more-text-full { display: none !important; }
    .breaking-more-text-mobile { display: inline !important; }
    .breaking-dropdown-panel {
        max-height: 260px;
    }
}

/* 🩸 혈압 카드 확장 위젯 스타일 */
.bp-stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
}
.bp-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
    color: #334155;
    padding: 0.2rem 0;
    border-bottom: 1px dashed #e2e8f0;
}
.bp-stat-row:last-child {
    border-bottom: none;
}
.bp-stat-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
    font-weight: 500;
}
.bp-stat-val {
    font-weight: 700;
    color: #0f172a;
}
.badge-pill {
    background: #fef2f2;
    color: #e11d48;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
}
.badge-pill.safe {
    background: #ecfdf5;
    color: #059669;
}
.card-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.5rem;
    flex-wrap: wrap;
}
.btn-quick-med {
    flex: 1;
    min-width: 160px;
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: #ffffff;
    border: none;
    padding: 0.55rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    box-shadow: 0 2px 4px rgba(225, 29, 72, 0.2);
}
.btn-quick-med:hover {
    background: linear-gradient(135deg, #be123c 0%, #9f1239 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(225, 29, 72, 0.3);
}
.btn-quick-med:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-hospital-sub {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 0.35rem 0.65rem;
    border-radius: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}
.btn-hospital-sub:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

/* 📰 뉴스 브리핑 위젯 스타일 */
.btn-news-sub {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 0.35rem 0.65rem;
    border-radius: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}
.btn-news-sub:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

/* 시장 지표 미니 칩 바 (상하 2줄 반응형 레이아웃) */
.news-market-bar {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.news-market-chip {
    flex: 1 1 0%;
    min-width: 0; /* flex 자식 넘침 원천 방지 */
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 0.5rem 0.65rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    box-sizing: border-box;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.news-market-chip:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}
.news-market-chip:hover .market-name {
    color: #2563eb;
}
.news-market-chip .market-name {
    color: #64748b;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}
.news-market-chip .market-val-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.news-market-chip .market-price {
    font-weight: 800;
    font-size: 0.92rem;
    color: #0f172a;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.news-market-chip .market-diff {
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.1rem 0.25rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.news-market-chip .market-diff.up {
    color: #ef4444;
    background: #fef2f2;
}
.news-market-chip .market-diff.down {
    color: #2563eb;
    background: #eff6ff;
}

/* 관심분야 실시간 주요 뉴스 컨테이너 */
.card-news {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.news-summary-box {
    min-height: 140px;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.news-rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px dashed #e2e8f0;
    min-width: 0;
    width: 100%;
}
.news-rec-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.news-rec-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
.news-rec-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: inherit;
    padding: 0.35rem 0.4rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.news-rec-item:hover {
    background-color: #e2e8f0;
}
.news-cat-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.news-rec-text {
    font-size: 0.83rem;
    color: #1e293b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 0%;
    min-width: 0;
}
.news-rec-media {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}
.news-rec-loading {
    color: #94a3b8;
    font-size: 0.82rem;
    text-align: center;
    padding: 1.5rem 0;
}

/* ==============================================================================
   📰 [신규] 뉴스 브리핑 / 네이버 뉴스 스타일 실시간 주요 기사 피드 카드
   ============================================================================== */
.news-feed-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.55rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.news-feed-card:last-child {
    margin-bottom: 0;
}
.news-feed-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.08);
}
.news-feed-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
}
.news-feed-text {
    flex: 1 1 0%;
    min-width: 0;
}
.news-feed-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-break: keep-all !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}
.news-feed-title:hover {
    color: #2563eb !important;
}
.news-feed-thumb {
    flex-shrink: 0 !important;
    width: 80px !important;
    height: 64px !important;
    border-radius: 0.75rem !important;
    overflow: hidden !important;
    background-color: #f1f5f9 !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
.news-feed-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.25s ease;
}
.news-feed-card:hover .news-feed-thumb img {
    transform: scale(1.05);
}
.news-feed-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.76rem;
    color: #64748b;
    min-width: 0;
    width: 100%;
}
.news-feed-meta-left {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    overflow: hidden;
}
.news-feed-media {
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-feed-dot {
    color: #cbd5e1;
    user-select: none;
}
.news-feed-time {
    color: #94a3b8;
    white-space: nowrap;
}
.news-feed-link {
    font-size: 0.74rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    background: #eff6ff;
    transition: all 0.15s ease;
}
.news-feed-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* 다크모드 대응 */
.dark-mode .news-feed-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dark-mode .news-feed-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.2);
}
.dark-mode .news-feed-title {
    color: #f8fafc;
}
.dark-mode .news-feed-title:hover {
    color: #60a5fa;
}
.dark-mode .news-feed-thumb {
    background-color: #0f172a;
    border-color: #334155;
}
.dark-mode .news-feed-meta {
    border-top-color: #334155;
    color: #94a3b8;
}
.dark-mode .news-feed-media {
    color: #cbd5e1;
}
.dark-mode .news-feed-link {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
}
.dark-mode .news-feed-link:hover {
    background: rgba(37, 99, 235, 0.25);
    color: #bfdbfe;
}

/* ==============================================================================
   💡 [신규] 아이디어 & 빠른 메모 (Memo Section) 스타일
   ============================================================================== */
.memo-section {
    margin-top: 2.5rem;
    margin-bottom: 3.5rem;
}

.memo-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.memo-header-title-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.memo-header-title-box h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.memo-header-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.memo-count-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
}

/* 1. 빠른 작성기 (Composer) */
.memo-composer-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.memo-composer-card:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.1);
}

.memo-input-title {
    width: 100%;
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.6rem;
    padding: 0.2rem 0;
    background: transparent;
}

.memo-input-title::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.memo-input-content {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #334155;
    resize: vertical;
    min-height: 72px;
    line-height: 1.55;
    background: transparent;
    font-family: inherit;
    box-sizing: border-box;
}

.memo-input-content::placeholder {
    color: #94a3b8;
}

.memo-composer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.memo-options-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 카테고리 라디오 칩 */
.memo-category-chips {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.memo-chip-label {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.memo-chip-label:hover {
    background: #e2e8f0;
}

.memo-chip-input {
    display: none;
}

.memo-chip-input:checked + .memo-chip-label {
    background: #eff6ff;
    color: var(--primary);
    border-color: #bfdbfe;
}

/* 색상 선택기 */
.memo-color-picker {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

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

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

.memo-color-input {
    display: none;
}

.memo-color-input:checked + .memo-color-dot {
    border-color: #3b82f6;
    transform: scale(1.18);
}

/* 핀 고정 체크 */
.memo-pin-check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.memo-pin-check-label input {
    cursor: pointer;
    accent-color: var(--primary);
}

/* 등록 버튼 */
.btn-memo-submit {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.45rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background-color 0.15s, transform 0.1s;
}

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

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

/* 2. 필터 바 & 검색창 */
.memo-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.memo-filter-tabs {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    padding: 2px 2px 6px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.memo-filter-tabs::-webkit-scrollbar {
    display: none;
    height: 0;
}

.memo-tab-btn {
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    color: #64748b;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.memo-tab-btn:hover {
    background: #f8fafc;
    color: var(--text-main);
}

.memo-tab-btn.active {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
}

.memo-search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.35rem 0.75rem;
    gap: 0.4rem;
    width: 220px;
    max-width: 100%;
    transition: border-color 0.15s;
}

.memo-search-box:focus-within {
    border-color: var(--primary);
}

.memo-search-input {
    border: none;
    outline: none;
    font-size: 0.82rem;
    width: 100%;
    color: var(--text-main);
    background: transparent;
}

/* 3. 메모 포스트잇 그리드 */
.memo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.memo-card {
    border-radius: 0.85rem;
    padding: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    min-height: 160px;
    word-break: break-word;
}

.memo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.memo-card.pinned {
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.memo-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
    gap: 0.5rem;
}

.memo-card-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.7);
    color: #334155;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.memo-card-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.memo-card:hover .memo-card-actions {
    opacity: 1;
}

.memo-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.3rem;
    font-size: 0.95rem;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, transform 0.1s;
    line-height: 1;
}

.memo-action-btn:hover {
    background: rgba(0, 0, 0, 0.07);
}

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

.memo-action-btn.btn-pin.is-active {
    color: #d97706;
}

.memo-card-body {
    flex: 1 1 auto;
    margin-bottom: 0.85rem;
}

.memo-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.memo-card-content {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
}

.memo-card-content p {
    margin: 0 0 0.35rem 0;
}

.memo-card-content p:last-child {
    margin-bottom: 0;
}

.memo-card-content ul, .memo-card-content ol {
    margin: 0.35rem 0;
    padding-left: 1.35rem;
}

.memo-card-content li {
    margin-bottom: 0.2rem;
}

.memo-card-content a {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-all;
}

/* 체크리스트 항목 스타일 */
.memo-card-content li[data-list="checked"],
.memo-card-content li[data-list="unchecked"] {
    list-style-type: none;
    position: relative;
    padding-left: 1.4rem;
    cursor: pointer;
    user-select: none;
}

.memo-card-content li[data-list="checked"]::before {
    content: "☑";
    position: absolute;
    left: 0;
    top: 0;
    color: #2563eb;
    font-size: 1.05rem;
    font-weight: bold;
}

.memo-card-content li[data-list="checked"] {
    text-decoration: line-through;
    color: #94a3b8;
}

.memo-card-content li[data-list="unchecked"]::before {
    content: "☐";
    position: absolute;
    left: 0;
    top: 0;
    color: #64748b;
    font-size: 1.05rem;
    font-weight: bold;
}

.memo-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: #64748b;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* 빈 상태 */
.memo-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: #ffffff;
    border: 1px dashed var(--border);
    border-radius: 1rem;
    color: #94a3b8;
    grid-column: 1 / -1;
}

.memo-empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.6rem;
    display: block;
}

.memo-empty-state p {
    font-size: 0.95rem;
    margin: 0;
}

/* 4. 메모 수정 모달 (기본 숨김, .is-open 시에만 최상위 플렉스 표시) */
.memo-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 9999999 !important; /* 상단 unav-header(99999) 및 전체 UI보다 최상위 보장 */
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
}

.memo-modal-backdrop.is-open {
    display: flex !important;
    animation: memoFadeIn 0.2s ease-out;
}

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

.memo-modal-dialog {
    background: #ffffff;
    border-radius: 1rem;
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - 2rem);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    z-index: 10000000;
    animation: memoSlideUp 0.25s ease-out;
}

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

.memo-modal-header {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.memo-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.memo-modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem;
    border-radius: 0.25rem;
}

.memo-modal-close-btn:hover {
    color: #334155;
    background: #f1f5f9;
}

.memo-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem;
    max-height: calc(100dvh - 140px);
}

.memo-modal-footer {
    flex-shrink: 0;
    padding: 0.85rem 1.25rem;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.btn-memo-cancel {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 0.5rem;
    cursor: pointer;
}

.btn-memo-cancel:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

@media (max-width: 640px) {
    .memo-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .memo-composer-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .memo-options-group {
        justify-content: space-between;
    }
    .btn-memo-submit {
        width: 100%;
        justify-content: center;
    }
    .memo-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        width: 100%;
    }
    .memo-filter-tabs {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }
    .memo-search-box {
        width: 100%;
    }
    .memo-grid {
        grid-template-columns: 1fr;
    }
    .memo-modal-backdrop {
        padding: 0.5rem !important;
        align-items: center !important;
    }
    .memo-modal-dialog {
        max-height: calc(100dvh - 1rem) !important;
        max-height: calc(100vh - 1rem) !important;
        border-radius: 0.75rem !important;
    }
    .memo-modal-body {
        padding: 0.85rem !important;
        max-height: calc(100dvh - 120px) !important;
    }
    #editMemoQuill .ql-editor {
        min-height: 120px !important;
        max-height: 220px !important;
    }
}

/* ==============================================================================
   🔍 통합 퀵 검색 (Ctrl+K) Command Palette 스타일
   ============================================================================== */
.quick-search-trigger-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.75rem 1.1rem;
    margin: 0.9rem 0 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
.quick-search-trigger-bar:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    box-shadow: 0 4px 14px -2px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}
.quick-search-trigger-bar:active {
    transform: translateY(0);
}
.quick-search-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #64748b;
    font-size: 0.95rem;
    overflow: hidden;
}
.quick-search-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}
.quick-search-placeholder {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.quick-search-shortcut {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.quick-search-kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    font-family: inherit;
}
.quick-search-plus {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
}

/* 퀵 검색 모달 백드롭 및 컨테이너 */
.qs-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 1rem 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.qs-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}
.qs-modal-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 640px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    transform: scale(0.96) translateY(-10px);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.qs-modal-backdrop.active .qs-modal-dialog {
    transform: scale(1) translateY(0);
}

/* 상단 검색 인풋 헤더 */
.qs-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}
.qs-header-icon {
    font-size: 1.25rem;
    color: #3b82f6;
    flex-shrink: 0;
}
.qs-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-weight: 500;
    color: #0f172a;
    background: transparent;
    padding: 0.3rem 0;
}
.qs-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}
.qs-clear-btn {
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.qs-clear-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.qs-close-kbd {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
}

/* 카테고리 탭 */
.qs-tabs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    scrollbar-width: none;
}
.qs-tabs::-webkit-scrollbar {
    display: none;
}
.qs-tab {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: all 0.15s;
}
.qs-tab:hover {
    border-color: #cbd5e1;
    color: #1e293b;
}
.qs-tab.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}
.qs-tab-badge {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 0.1rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
}
.qs-tab.active .qs-tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* 결과 영역 */
.qs-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
    max-height: calc(80vh - 150px);
}
.qs-body::-webkit-scrollbar {
    width: 6px;
}
.qs-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* 카테고리 섹션 */
.qs-section {
    margin-bottom: 1.1rem;
}
.qs-section-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* 아이템 카드 */
.qs-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.qs-item:hover, .qs-item.focused {
    background: #f1f5f9;
    border-color: #e2e8f0;
}
.qs-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.qs-item-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    flex: 1;
    word-break: break-word;
}
.qs-item-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
    flex-shrink: 0;
}
.qs-item-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.qs-item-meta {
    font-size: 0.74rem;
    color: #94a3b8;
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.qs-highlight {
    background-color: #fef08a;
    color: #854d0e;
    font-weight: 700;
    border-radius: 2px;
    padding: 0 2px;
}

/* 초기 상태: 빠른 서비스 바로가기 */
.qs-empty-state {
    padding: 1.5rem 0.5rem;
    text-align: center;
}
.qs-empty-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 1rem;
}
.qs-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.65rem;
}
.qs-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 0.6rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s;
}
.qs-quick-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateY(-2px);
}
.qs-quick-icon {
    font-size: 1.5rem;
}
.qs-quick-label {
    font-size: 0.82rem;
    font-weight: 600;
}

/* 결과 없음 / 로딩 */
.qs-no-results {
    padding: 3rem 1rem;
    text-align: center;
    color: #64748b;
}
.qs-no-results-icon {
    font-size: 2.5rem;
    margin-bottom: 0.6rem;
}
.qs-no-results-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}
.qs-no-results-sub {
    font-size: 0.82rem;
    color: #94a3b8;
}

/* 하단 키보드 안내 푸터 */
.qs-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.74rem;
    color: #64748b;
}
.qs-footer-keys {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.qs-footer-key-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.qs-footer-kbd {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
}

@media (max-width: 640px) {
    .qs-modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }
    .qs-modal-dialog {
        max-width: 100%;
        max-height: 90vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    .quick-search-shortcut {
        display: none;
    }
    .qs-footer-keys {
        display: none;
    }
}

/* ==========================================================================
   📱 모바일 대시보드 위젯 & 퀵 액션 허브 스타일 (2026-10-16 v4 개편)
   ========================================================================== */
.quick-action-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0 0.75rem 0;
    margin-bottom: 0.75rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.quick-action-strip::-webkit-scrollbar {
    display: none;
}
.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.18s ease;
    cursor: pointer;
    flex-shrink: 0;
}
.quick-action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.quick-action-btn:active {
    transform: translateY(0);
}
.quick-action-btn.btn-accent {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.quick-action-btn.btn-accent:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* 오늘 요약 & D-Day 스마트 위젯 허브 */
.today-summary-hub {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.today-widget-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0.95rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 104px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}
.today-widget-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}
.today-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}
.today-widget-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.today-widget-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    letter-spacing: -0.01em;
}
.today-widget-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.today-widget-val-main {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}
.today-widget-val-sub {
    font-size: 0.76rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* 뱃지 색상 클래스들 */
.badge-state-ok { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-state-warn { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-state-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-state-info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* 위젯 인라인 복약 버튼 */
.btn-widget-quick-med {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.6rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: #ffffff;
    background: #059669;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: background 0.15s ease;
}
.btn-widget-quick-med:hover {
    background: #047857;
}

/* 대한고혈압학회(KSH) 기준 6단계 뱃지 스타일 */
.bp-badge-normal { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.bp-badge-elevated { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.bp-badge-pre { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.bp-badge-stage1 { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.bp-badge-stage2 { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; font-weight: 700; }
.bp-badge-low { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* 혈압 기준표 미니 버튼 */
.btn-bp-guide-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-bp-guide-trigger:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* 혈압 판정 기준표 모달 스타일 (기본 display: none !important 원천 보장) */
.bp-modal-backdrop,
#bpGuideModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 10000000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
}
.bp-modal-backdrop.active,
#bpGuideModal.active {
    display: flex !important;
}
.bp-modal-dialog {
    background: #ffffff;
    border-radius: 1rem;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.bp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}
.bp-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.bp-modal-close {
    background: none;
    border: none;
    font-size: 1.35rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    line-height: 1;
}
.bp-modal-close:hover {
    background: #f1f5f9;
    color: #334155;
}
.bp-modal-body {
    padding: 1.25rem;
}
.bp-guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}
.bp-guide-table th, .bp-guide-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}
.bp-guide-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
}
.bp-guide-table tr:hover {
    background: #1f1f23;
}
.bp-guide-notice-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 0.85rem;
    font-size: 0.78rem;
    color: #166534;
    line-height: 1.5;
}

/* 메모 카드 최근 메모 리스트 */
.memo-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.memo-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    color: #334155;
    transition: background 0.15s ease;
}
.memo-recent-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.memo-item-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.memo-item-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
    flex-shrink: 0;
}

/* 모바일 640px 이하 반응형 및 텍스트 2~3줄 줄바꿈 원천 차단 */
@media (max-width: 640px) {
    .container {
        padding: 1rem 0.75rem 5.5rem 0.75rem !important; /* 하단 티커바 겹침 방지 보장 */
        overflow-x: hidden;
    }
    .welcome-header-row {
        gap: 0.4rem;
        flex-wrap: wrap;
        align-items: center;
        margin-bottom: 0.35rem;
    }
    .welcome-header-row h2 {
        font-size: 1.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .weather-compact-badge {
        padding: 0.25rem 0.55rem;
        font-size: 0.78rem;
        white-space: nowrap;
        gap: 0.25rem;
    }
    .btn-pwa-install {
        padding: 0.25rem 0.55rem;
        font-size: 0.78rem;
        white-space: nowrap;
        gap: 0.25rem;
    }
    .quick-action-strip {
        gap: 0.35rem;
        margin-bottom: 0.85rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .quick-action-strip::-webkit-scrollbar {
        display: none;
    }
    .quick-action-btn {
        padding: 0.45rem 0.4rem;
        font-size: 0.76rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .today-summary-hub {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.55rem;
        margin-bottom: 1rem;
    }
    .today-widget-card {
        padding: 0.7rem 0.65rem;
        min-height: 88px;
    }
    .today-widget-title {
        font-size: 0.74rem;
        white-space: nowrap;
    }
    .today-widget-val-main {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .today-widget-val-sub {
        font-size: 0.72rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .bp-stat-row {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.82rem;
    }
    .bp-stat-val {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .service-card {
        padding: 1rem 0.85rem;
    }
}

/* 초소형 모바일 (380px 이하) 컴팩트 최적화 */
@media (max-width: 380px) {
    .today-summary-hub {
        grid-template-columns: 1fr;
    }
    .welcome-header-row h2 {
        font-size: 1.15rem;
    }
}



