/* ==========================================================================
   1. 초기화 및 기본 설정 (Reset & Base)
   ========================================================================== */
:root {
    /* ── PRIMARY (브랜드) ── */
    --primary: #406CB4;
    --primary-deep: #1e3a6e;
    --primary-light: #6b9fd4;
    --primary-soft: #EEF4FF;
    /* primary 톤의 매우 연한 배경 (배지/하이라이트용) */

    /* ── NEUTRAL (소프트 메디컬 톤) ── */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    --surface-page: #F9F9F9;
    --surface-card: #FFFFFF;
    --surface-subtle: #f8fafc;
    --border-default: #e2e8f0;
    --border-soft: #eef2f6;

    /* ── SEMANTIC STATUS — bg / ink / solid (소프트 파스텔 + 선명 accent)
       결석·케어 UI, tag-pill, 상태 뱃지 공용. design_system §03 참고 */
    --semantic-success-bg: #E6FBF2;
    --semantic-success-ink: #0f9a58;
    --semantic-success-solid: #1cc275;
    --semantic-success-border: #b8efd4;

    --semantic-info-bg: #E3F2FD;
    --semantic-info-ink: #1565C0;
    --semantic-info-solid: #2196F3;
    --semantic-info-border: #BBDEFB;

    --semantic-warning-bg: #FFF8E3;
    --semantic-warning-ink: #f2a537;
    --semantic-warning-solid: #fac53b;
    --semantic-warning-border: #fce8a8;

    --semantic-danger-bg: #FEF2F1;
    --semantic-danger-ink: #c04a45;
    --semantic-danger-solid: #f6817d;
    --semantic-danger-border: #f9c4c1;

    --semantic-purple-bg: #f4f0fe;
    --semantic-purple-ink: #7e5cdb;
    --semantic-purple-solid: #9C27B0;
    --semantic-purple-border: #E1BEE7;

    --semantic-pink-bg: #fce7f3;
    --semantic-pink-ink: #be185d;
    --semantic-pink-solid: #ec4899;
    --semantic-pink-border: #fbcfe8;

    /* 원재료 역산 · 단백 donut / 바 톤 */
    --ing-protein-animal: #fac53b;
    --ing-protein-animal-soft: #fff7ed;
    --ing-protein-animal-ink: #c2410c;
    --ing-protein-plant: #84cc16;
    --ing-protein-plant-soft: #ecfccb;
    --ing-protein-plant-ink: #4d7c0f;
    --ing-protein-other: #60a5fa;
    --ing-protein-other-soft: #eff6ff;
    --ing-tone-meat: #ea580c;
    --ing-tone-meat-soft: #ffedd5;
    --ing-tone-poultry: #fb923c;
    --ing-tone-poultry-soft: #fff7ed;
    --ing-tone-starch: #facc15;
    --ing-tone-starch-soft: #fef9c3;
    --ing-tone-fat: #38bdf8;
    --ing-tone-fat-soft: #e0f2fe;
    --ing-tone-mineral: #a78bfa;
    --ing-tone-mineral-soft: #ede9fe;
    --ing-tone-fish: #2dd4bf;
    --ing-tone-fish-soft: #ccfbf1;
    --ing-tone-plant: #86efac;
    --ing-tone-plant-soft: #dcfce7;

    /* 분석 인사이트 — 중립 행 배경 */
    --insight-row-bg: #f8fafc;
    --insight-row-border: #eef2f6;

    /* tag-pill 별칭 (blue = 브랜드 primary) */
    --tag-blue-bg: var(--primary-soft);
    --tag-blue-ink: var(--primary);
    --tag-green-bg: var(--semantic-success-bg);
    --tag-green-ink: var(--semantic-success-ink);
    --tag-amber-bg: var(--semantic-warning-bg);
    --tag-amber-ink: var(--semantic-warning-ink);
    --tag-red-bg: var(--semantic-danger-bg);
    --tag-red-ink: var(--semantic-danger-ink);
    --tag-purple-bg: var(--semantic-purple-bg);
    --tag-purple-ink: var(--semantic-purple-ink);
    --tag-gray-bg: var(--surface-subtle);
    --tag-gray-ink: var(--text-tertiary);

    /* ✨ MACRO PASTEL — 칼로리 출처/단·지·탄 등 영양 카테고리 시각화 토큰 */
    --macro-prot: #fda4af;
    --macro-fat: #fcd34d;
    --macro-carb: #86efac;
    --macro-prot-soft: #ffe4e6;
    --macro-fat-soft: #fef3c7;
    --macro-carb-soft: #dcfce7;
    --macro-prot-ink: #9f1239;
    --macro-fat-ink: #92400e;
    --macro-carb-ink: #166534;

    /* ✨ 고밥연 둥글기 시스템 (Border Radius) 
       규칙: `외부 컨테이너 라디우스 = 내부 요소 라디우스 × 2` (또는 +4~8px) 를 권장 */
    --radius-xs: 4px;
    /* 뱃지, 체크박스 등 작은 요소 */
    --radius-sm: 8px;
    /* 내부 버튼, 썸네일, 입력창 등 */
    --radius-md: 12px;
    /* 기본 버튼, 작은 카드 */
    --radius-lg: 16px;
    /* 섹션 카드, 외부 컨테이너, 모달 창 */
    --radius-xl: 24px;
    /* 거대한 카드 영역, 바텀 시트 팝업 */
    --radius-full: 9999px;
    /* 완전한 알약 형태, 원형 (프로필 사진 등) */

    /* ✨ 타이포 웨이트 — 400(기본) · 600(강조) 두 단계만 사용 */
    --font-weight-normal: 400;
    --font-weight-emphasis: 600;
}

*,
::after,
::before {
    box-sizing: border-box;
}

article,
aside,
dialog,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section {
    display: block;
}

html {
    overflow-x: hidden;
    /* 가로 스크롤 완전 차단 */
}

body {
    background-color: var(--surface-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* 가로 스크롤 방지 */
    margin: 0;
    /* 브라우저 기본 마진 */
    font-weight: var(--font-weight-normal, 400);
}

strong,
b {
    font-weight: var(--font-weight-emphasis, 600);
}

/* ==========================================================================
   2. 전체 레이아웃 구조 (Layout Structure)
   ========================================================================== */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.container {
    width: 100%;
    margin: 0 auto;
    background-color: transparent;
}

/* 메인 콘텐츠 영역 (PC 기본) */
.mainContent {
    background-color: transparent;
    max-width: 1080px; /* ✅ 디자인 시스템 표준인 1080px로 통일 */
    width: 100%;
    margin: 0 auto;
    /* 중앙 정렬 */
    padding: 0 40px 80px 40px;
    /* 상 우 하 좌 패딩 */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 상단 헤더 (PC에서는 숨김) */
#siteHeader {
    display: none;
}

/* ==========================================================================
   3. PC 상단 메뉴 디자인 (PC Navbar) - Modified from Sidebar
   ========================================================================== */
.pc-sidebar {
    width: 100%;
    height: 70px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.sidebar-logo {
    margin-bottom: 0px;
    text-align: left;
    display: flex;
    align-items: center;
}

.sidebar-logo img {
    height: 50px;
    width: auto;
}

/* 사이드바 메뉴 래퍼 */
.sidebar-menu {
    display: flex;
    flex-direction: row;
    gap: 30px;
    flex: 1;
    min-height: 0;
    margin-bottom: 0px;
    justify-content: center;
    align-items: center;
}

/* 탑바 드롭다운 아이템 */
.nav-item {
    position: relative;
    display: inline-block;
}

.nav-link {
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: #475569;
    padding: 24px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-item:hover>.nav-link,
.nav-item.active>.nav-link {
    color: #406CB4;
}

.nav-arrow {
    font-size: 10px;
    color: #94a3b8;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #fff;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    z-index: 1001;
}

.nav-item:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-dropdown-menu a i {
    width: 20px;
    text-align: center;
    color: #94a3b8;
}

.nav-dropdown-menu a:hover {
    background: #f8fafc;
    color: #406CB4;
}

.nav-dropdown-menu a:hover i {
    color: #406CB4;
}

/* 사이드바 하단 프로필 (우측 배치) */
.sidebar-profile {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-profile .info {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    line-height: 1.3;
}

.sidebar-profile .name {
    font-weight: bold;
    color: #333;
}

.sidebar-profile .logout {
    color: #999;
    font-size: 12px;
    text-decoration: underline;
}

/* ==========================================================================
   4. 폼(Form) 및 버튼 스타일
   ========================================================================== */
/* 타이포그래피 */
.mainContent h1 {
    font-size: 56px;
    font-weight: 800;
}

.mainContent h2 {
    font-size: 20px;
    font-weight: 600;
}

.mainContent h3 {
    font-size: 25px;
    font-weight: 600;
}

.mainContent p {
    font-size: 16px;
    line-height: 1.6;
    color: #434343;
}

.txt-color-blue {
    color: #406CB4 !important;
}

/* 버튼 공통 - buttons.css가 우선되도록 최소화 */
button {
    font-family: inherit;
}

/* ==========================================================================
   4-1. Key-Value Data Row (.kv-row, .kv-label, .kv-val)
   ========================================================================== */
.kv-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kv-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.kv-label {
    color: #64748b;
    font-weight: 500;
}

.kv-val {
    font-weight: 700;
    color: #1e293b;
}

/* ==========================================================================
   4-2. List Item Card (.list-item-card)
   ========================================================================== */
.list-item-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #F8FAFC;
    border-radius: var(--radius-lg);
    border: 1px solid #E2E8F0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
}

.list-item-card:hover {
    border-color: #406CB4;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(64, 108, 180, 0.1);
}

.list-item-icon-wrap {
    position: relative;
    margin-right: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.list-item-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: #EEF4FF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.list-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-item-icon-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #406CB4;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.list-item-info {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-desc {
    font-size: 13px;
    color: #64748b;
}

.list-item-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

/* ==========================================================================
   4-3. 선택형 리스트 카드 UX (.selectable-card)
   ========================================================================== */
.selectable-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.selectable-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* ✅ 선택된 상태: 배경색 전체를 변경하여 명확하게 구분 */
.selectable-card.selected {
    background: #406CB4;
    border-color: #406CB4;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(64, 108, 180, 0.2);
}

.selectable-card.selected .text-muted,
.selectable-card.selected .card-desc {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ==========================================================================
   4-2. 큰 선택형 박스 카드 (.select-card)
   ========================================================================== */
.select-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.select-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.select-card.selected {
    border-color: #406CB4;
    background: #406CB4;
    box-shadow: 0 6px 16px rgba(64, 108, 180, 0.25);
}

.select-card span {
    font-weight: 700;
    color: #64748b;
}

.select-card.selected span {
    color: #fff;
}

/* ==========================================================================
   4-2c. 태그 알약 (.tag-pill) — :root --tag-* / --semantic-* 토큰 기반
        상태 라벨/카테고리/배지 등. 변형: blue/green/amber/red/gray/purple/outline
   ========================================================================== */
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.tag-pill i {
    font-size: 10px;
}

.tag-pill.blue {
    background: var(--tag-blue-bg);
    color: var(--tag-blue-ink);
}

.tag-pill.green {
    background: var(--tag-green-bg);
    color: var(--tag-green-ink);
}

.tag-pill.amber {
    background: var(--tag-amber-bg);
    color: var(--tag-amber-ink);
}

.tag-pill.red {
    background: var(--tag-red-bg);
    color: var(--tag-red-ink);
}

.tag-pill.gray {
    background: var(--tag-gray-bg);
    color: var(--tag-gray-ink);
}

.tag-pill.purple {
    background: var(--tag-purple-bg);
    color: var(--tag-purple-ink);
}

.tag-pill.outline {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-tertiary);
}

/* ==========================================================================
   4-2d. 시맨틱 상태 서피스 (.cfl-status-*) — bg + ink + border 토큰 기반
        결석·케어·건강 지표 카드 등 소프트 메디컬 UI
   ========================================================================== */
.cfl-status-safe {
    background: var(--semantic-success-bg);
    color: var(--semantic-success-ink);
    border-color: var(--semantic-success-border);
}

.cfl-status-info {
    background: var(--semantic-info-bg);
    color: var(--semantic-info-ink);
    border-color: var(--semantic-info-border);
}

.cfl-status-warning {
    background: var(--semantic-warning-bg);
    color: var(--semantic-warning-ink);
    border-color: var(--semantic-warning-border);
}

.cfl-status-danger {
    background: var(--semantic-danger-bg);
    color: var(--semantic-danger-ink);
    border-color: var(--semantic-danger-border);
}

.cfl-status-purple {
    background: var(--semantic-purple-bg);
    color: var(--semantic-purple-ink);
    border-color: var(--semantic-purple-border);
}

.cfl-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.cfl-status-badge.is-safe { background: var(--semantic-success-bg); color: var(--semantic-success-ink); }
.cfl-status-badge.is-info { background: var(--semantic-info-bg); color: var(--semantic-info-ink); }
.cfl-status-badge.is-warning { background: var(--semantic-warning-bg); color: var(--semantic-warning-ink); }
.cfl-status-badge.is-danger { background: var(--semantic-danger-bg); color: var(--semantic-danger-ink); }
.cfl-status-badge.is-purple { background: var(--semantic-purple-bg); color: var(--semantic-purple-ink); }
.cfl-status-badge.is-unknown { background: var(--surface-subtle); color: var(--text-tertiary); }

.cfl-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
}

.cfl-status-icon.is-info { background: var(--semantic-info-bg); color: var(--semantic-info-solid); }
.cfl-status-icon.is-success { background: var(--semantic-success-bg); color: var(--semantic-success-solid); }
.cfl-status-icon.is-warning { background: var(--semantic-warning-bg); color: var(--semantic-warning-solid); }
.cfl-status-icon.is-danger { background: var(--semantic-danger-bg); color: var(--semantic-danger-solid); }
.cfl-status-icon.is-purple { background: var(--semantic-purple-bg); color: var(--semantic-purple-solid); }
.cfl-status-icon.is-primary { background: var(--primary-soft); color: var(--primary); }
.cfl-status-icon.is-pink { background: var(--semantic-pink-bg); color: var(--semantic-pink-solid); }

.cfl-segbar {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 22px;
}

.cfl-segbar__tick {
    flex: 1;
    height: 8px;
    border-radius: 2px;
    background: var(--border-default);
    transition: height 0.2s, background 0.2s;
}

.cfl-segbar__tick.is-on { height: 16px; }

.cfl-segbar--safe .cfl-segbar__tick.is-on { background: var(--semantic-success-solid); }
.cfl-segbar--info .cfl-segbar__tick.is-on { background: var(--semantic-info-solid); }
.cfl-segbar--warning .cfl-segbar__tick.is-on { background: var(--semantic-warning-solid); }
.cfl-segbar--danger .cfl-segbar__tick.is-on { background: var(--semantic-danger-solid); }
.cfl-segbar--purple .cfl-segbar__tick.is-on { background: var(--semantic-purple-solid); }
.cfl-segbar--gray .cfl-segbar__tick.is-on { background: var(--text-muted); }

/* ==========================================================================
   4-3. 칩 버튼 (.chip-btn)
   ========================================================================== */
.chip-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-full);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chip-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.chip-btn.selected {
    background: #406CB4;
    color: #fff;
    border-color: #406CB4;
    box-shadow: 0 4px 12px rgba(64, 108, 180, 0.2);
}

/* ==========================================================================
   4-3b. 필터 칩 공통 (care_meal_add 기준)
        mq-chip + cat-chip + sort-chip 동일 규격
   ========================================================================== */
.mq-chips,
.scroll-chip-container,
.cat-bar,
#catBarLarge,
#feedCaseChips,
#feedShareFilters,
#catBarSmall {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mq-chips::-webkit-scrollbar,
.scroll-chip-container::-webkit-scrollbar,
.cat-bar::-webkit-scrollbar,
#catBarLarge::-webkit-scrollbar,
#feedCaseChips::-webkit-scrollbar,
#feedShareFilters::-webkit-scrollbar,
#catBarSmall::-webkit-scrollbar {
    display: none;
}

.mq-chips,
.scroll-chip-container {
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    box-sizing: border-box;
}

#catBarLarge,
#feedCaseChips,
#feedShareFilters,
#catBarSmall {
    width: 100%;
    padding: 12px 16px;
    margin: 0 0 10px;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.cat-bar {
    width: 100%;
    padding: 12px 16px;
    margin: 0 0 10px;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.mq-chip,
.sort-chip,
.cat-bar .cat-chip,
#catBarLarge .cat-chip,
#feedCaseChips .cat-chip,
#feedShareFilters .cat-chip,
#catBarSmall .cat-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    font-size: 12px;
    font-weight: var(--font-weight-emphasis, 600);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    box-shadow: none;
    transform: none;
}

.mq-chip:hover,
.sort-chip:hover,
.cat-bar .cat-chip:hover,
#catBarLarge .cat-chip:hover,
#feedCaseChips .cat-chip:hover,
#feedShareFilters .cat-chip:hover,
#catBarSmall .cat-chip:hover {
    border-color: #d1d5db;
    background: #fff;
    color: #64748b;
    box-shadow: none;
    transform: none;
}

.mq-chip.active,
.sort-chip.active,
.cat-bar .cat-chip.active,
#catBarLarge .cat-chip.active,
#feedCaseChips .cat-chip.active,
#feedShareFilters .cat-chip.active,
#catBarSmall .cat-chip.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #406CB4;
    box-shadow: none;
}

.cat-bar .cat-chip.all:not(.active),
#catBarLarge .cat-chip.all:not(.active),
#feedCaseChips .cat-chip.all:not(.active),
#feedShareFilters .cat-chip.all:not(.active),
#catBarSmall .cat-chip.all:not(.active) {
    background: #fff;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .mq-chips,
    .scroll-chip-container,
    .cat-bar,
    #catBarLarge,
    #feedCaseChips,
    #feedShareFilters,
    #catBarSmall {
        margin-left: 0;
        margin-right: 0;
        padding-left: 16px;
        padding-right: 16px;
    }

    /* 검색 도구바·결과 헤더는 모바일에서 콘텐츠 컨테이너 패딩이 0이라
       자체적으로 좌우 16px 안전 여백이 필요 */
    .mq-toolbar,
    .mq-result-header {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ==========================================================================
   4-3c. 상단 세그먼트 탭 공통 (care_meal_add 기준)
        .mq-tabs/.mq-tab + .fe-tabs/.fe-tab 동일 룩앤필
   ========================================================================== */
.mq-tabs,
.fe-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.mq-tab,
.fe-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 8px;
    font-size: 14px;
    font-weight: var(--font-weight-emphasis, 600);
    line-height: 1.35;
    color: #94a3b8;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.mq-tab.active,
.fe-tab.active {
    color: #1e293b;
}

.mq-tab.active::after,
.fe-tab.active::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #406CB4;
}

.fe-tab i {
    font-size: 13px;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.fe-tab.active i,
.fe-tab:hover i {
    color: #406CB4;
}

.mq-tab:focus-visible,
.fe-tab:focus-visible {
    outline: 2px solid #406CB4;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .mq-tab,
    .fe-tab {
        padding: 14px 6px;
    }

    .fe-tab i {
        font-size: 12px;
    }
}

/* 탭 패널 기본 상단 여백 — 탭과 콘텐츠가 붙지 않도록 단일 소스에서 보장 */
.mq-tab-panel,
.fe-tab-panel {
    padding-top: 16px;
}

/* 탭 바로 아래 기간·필터 칩 — 상단 탭과 분리 (mdq-panel 등 padding-top:0 덮어쓰기 보완) */
.mq-tab-panel > .mq-chips--below-tabs:first-of-type,
.mq-tab-panel > .mq-chips--below-tabs {
    margin-top: 12px;
}

.mq-tab-panel > .mq-chips--below-tabs + .mq-chips {
    margin-top: 10px;
}

.mq-tab-panel.mdq-panel--stats,
.mq-tab-panel.mq-panel--stats {
    padding-top: 12px;
}

/* ==========================================================================
   트렌드 히트맵 셀 (smart_diet · care_drug_add · care_meal_add 공통)
   ========================================================================== */
.cfl-heatmap-row,
.heatmap-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    gap: 5px;
}

.cfl-heatmap-cell,
.heatmap-cell,
.mdq-heatmap-cell {
    border-radius: 10px;
    padding: 7px 4px 6px;
    text-align: center;
    transition: transform 0.1s;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 0;
}

.cfl-heatmap-cell:hover,
.heatmap-cell:hover,
.mdq-heatmap-cell:hover {
    transform: scale(1.04);
}

.cfl-heatmap-cell__date,
.heatmap-cell-date {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.75;
    margin-bottom: 3px;
    line-height: 1.1;
}

.cfl-heatmap-cell__val,
.heatmap-cell-val {
    font-size: 11px;
    font-weight: var(--font-weight-emphasis, 600);
    line-height: 1.2;
}

/* 밥·약 통계 탭 히트맵 통일 (약 페이지 색감 + 셀 소형) */
.mq-stats-body .cfl-heatmap-row,
.mq-stats-body .heatmap-row,
.mdq-panel--stats .mdq-heatmap-cells {
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    gap: 4px;
}

.mq-stats-body .cfl-heatmap-cell,
.mq-stats-body .heatmap-cell,
.mdq-panel--stats .mdq-heatmap-cell {
    min-height: 44px;
    padding: 5px 3px 4px;
    border-radius: 8px;
}

.mq-stats-body .cfl-heatmap-cell__date,
.mq-stats-body .cfl-heatmap-cell__val,
.mdq-panel--stats .cfl-heatmap-cell__date,
.mdq-panel--stats .cfl-heatmap-cell__val {
    font-size: 9px;
    margin-bottom: 2px;
}

.mq-stats-body .cfl-heatmap-cell__val,
.mdq-panel--stats .cfl-heatmap-cell__val {
    font-size: 10px;
    font-weight: 800;
    opacity: 1;
}

.mq-stats-heatmap--90 .cfl-heatmap-row,
.mq-stats-heatmap--90 .heatmap-row,
.mdq-heatmap-cells--90 {
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
}

.mq-stats-heatmap--90 .cfl-heatmap-cell__date,
.mdq-heatmap-cells--90 .cfl-heatmap-cell__date {
    font-size: 8px;
}

.mq-stats-heatmap--90 .cfl-heatmap-cell__val,
.mdq-heatmap-cells--90 .cfl-heatmap-cell__val {
    font-size: 9px;
}

.cfl-heatmap-cell.is-empty,
.mdq-heatmap-cell.is-empty {
    background: #f1f5f9;
    color: #94a3b8;
}

.cfl-heatmap-cell.is-done,
.mdq-heatmap-cell.is-done {
    background: #d1fae5;
    color: #065f46;
}

.cfl-heatmap-cell.is-partial,
.mdq-heatmap-cell.is-partial {
    background: #fef3c7;
    color: #92400e;
}

.cfl-heatmap-cell.is-missed,
.mdq-heatmap-cell.is-missed {
    background: #fee2e2;
    color: #991b1b;
}

.mq-stats-block {
    margin-bottom: 14px;
}

.mq-stats-block-title {
    font-size: 13px;
    font-weight: var(--font-weight-emphasis, 600);
    color: #1e293b;
    margin-bottom: 10px;
}

.mq-stats-summary-box {
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    line-height: 1.65;
    color: #64748b;
}

.mq-stats-summary-box strong {
    color: #1e293b;
}

.cfl-nutrient-heatmap-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cfl-nutrient-heatmap-row:last-child {
    margin-bottom: 0;
}

.cfl-nutrient-heatmap-label {
    width: 56px;
    font-size: 11px;
    font-weight: var(--font-weight-emphasis, 600);
    color: #64748b;
    flex-shrink: 0;
}

.mq-stats-foot-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #406cb4;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.mq-stats-foot-link:hover {
    background: #e2e8f0;
}

/* 탭 컨테이너 직후에 오는 콘텐츠가 패널이 아닌 경우(예: section-card 등)에도
   동일한 16px 분리 여백을 자동 적용 */
.mq-tabs + *:not(.mq-tab-panel),
.fe-tabs + *:not(.fe-tab-panel) {
    margin-top: 16px;
}

/* ==========================================================================
   4-3z. 뒤로가기 버튼 (.mq-back) — 페이지 좌상단 공통
        디자인시스템 표준 / care_meal_add 기준 통일
        호환 alias: .cc-back, .dm-back-btn, .header-back-btn
   ========================================================================== */
.mq-back,
.cc-back,
.dm-back-btn,
.header-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-size: 15px;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mq-back:hover,
.cc-back:hover,
.dm-back-btn:hover,
.header-back-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.mq-back:active,
.cc-back:active,
.dm-back-btn:active,
.header-back-btn:active {
    transform: scale(0.96);
}

.mq-back:focus-visible,
.cc-back:focus-visible,
.dm-back-btn:focus-visible,
.header-back-btn:focus-visible {
    outline: 2px solid #406CB4;
    outline-offset: 2px;
}

/* ==========================================================================
   4-3y. 케어 크롬리스 셸 + 헤더 (care_meal_add / care_drug_add 공통)
   ========================================================================== */
.mq-body {
    margin: 0;
    background: #fff;
}

.mq-shell {
    min-height: 100vh;
}

.mq-root {
    --mq-primary: #406CB4;
    --mq-text: #1e293b;
    --mq-muted: #64748b;
    --mq-border: #e2e8f0;
    --mq-bg: #f8fafc;
    min-height: 100vh;
    background: #fff;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--mq-text);
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   뒤로가기가 있는 헤더 (.mq-header-back)
   - 크롬리스 케어(밥/약 기록) · 제품상세 등 단일 백 액션 화면
   - 마크업: include components/mq_header_back.php 권장 (h1 사용 금지)
   - 호환 alias: .mq-topbar, .mq-page-topbar / .mq-title, .mq-page-topbar__title
   -------------------------------------------------------------------------- */
.mq-header-back,
.mq-topbar,
.mq-page-topbar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 8px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: #ffffff;
    border-bottom: 1px solid var(--mq-border, #e2e8f0);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Flutter WebView: body가 SafeArea로 이미 상태바 inset 적용됨 → env(safe-area) 중복 방지
   (모바일 브라우저·PC 반응형에서는 env만 적용, 앱 ?app=1 만 10px 고정) */
.mq-header-back--in-app,
html.html-in-app .mq-header-back,
html.html-in-app .mq-topbar,
html.html-in-app .mq-page-topbar,
body.in-app .mq-header-back,
body.in-app .mq-topbar,
body.in-app .mq-page-topbar {
    padding-top: 10px !important;
}

.mq-header-back__back {
    flex-shrink: 0;
}

.mq-header-back__title,
.mq-topbar .mq-title,
.mq-topbar h1.mq-title,
.mq-page-topbar__title {
    display: block;
    font-size: 17px;
    font-weight: var(--font-weight-emphasis, 600);
    line-height: 1.25;
    letter-spacing: -0.2px;
    color: var(--mq-text, #1e293b);
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mq-header-back__pet,
.mq-pet-select {
    max-width: 140px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--mq-border, #e2e8f0);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    color: var(--mq-text, #1e293b);
    flex-shrink: 0;
    font-family: inherit;
}

/* 헤더 펫 아바타 선택 — smart_diet .pet-selector-item 와 동일 패턴 (컴팩트) */
.mq-header-back__pets,
.mq-pet-avatars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
    max-width: min(54vw, 240px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* 테두리·체크 뱃지가 스크롤 가장자리에서 잘리지 않도록 */
    padding: 2px 8px 0;
    scroll-padding-inline: 8px;
    margin: 0 -2px;
}

.mq-pet-avatars::-webkit-scrollbar {
    display: none;
}

.mq-pet-avatar-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    font: inherit;
    color: inherit;
    min-width: 0;
}

.mq-pet-avatar-item--readonly {
    cursor: default;
    pointer-events: none;
}

.mq-pet-avatar-item.is-active {
    opacity: 1;
}

.mq-pet-avatar-item:active:not(.mq-pet-avatar-item--readonly) {
    transform: scale(0.96);
}

.mq-pet-avatar-item__circle {
    position: relative;
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #f1f5f9;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.mq-pet-avatar-item.is-active .mq-pet-avatar-item__circle {
    border-color: var(--mq-primary, #406CB4);
    box-shadow: 0 2px 8px rgba(64, 108, 180, 0.22);
}

.mq-pet-avatar-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mq-pet-avatar-item__check {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--mq-primary, #406CB4);
    color: #fff;
    border: 2px solid #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    line-height: 1;
    pointer-events: none;
}

.mq-pet-avatar-item.is-active .mq-pet-avatar-item__check {
    display: inline-flex;
}

.mq-pet-avatar-item__name {
    max-width: 52px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.2px;
    color: #94a3b8;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mq-pet-avatar-item.is-active .mq-pet-avatar-item__name {
    color: var(--mq-text, #1e293b);
}

/* JS 호환용 숨김 select — 기존 change 리스너 유지 */
.mq-pet-select-sr {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.mq-pet-select--label {
    border: none;
    padding-left: 0;
    max-width: none;
}

/* 헤더 펫 select — 전역 input/select 100% 규칙 예외 */
.mq-header-back__pet.mq-pet-select,
.mq-pet-select {
    width: auto;
    max-width: 140px;
    height: auto;
    min-height: 36px;
    padding: 8px 28px 8px 10px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   크롬리스 폼 (.mq-form) — care_meal_add / care_drug_add 바텀시트·입력
   input/select 기본: 본 문서 §4 폼 규칙(46px)과 동일, 페이지별 재정의 금지
   -------------------------------------------------------------------------- */
.mq-form .mq-field,
.mq-root .mq-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    min-width: 0;
}

.mq-form .mq-field > label,
.mq-root .mq-field > label {
    font-size: 12px;
    font-weight: 700;
    color: var(--mq-muted, #64748b);
}

.mq-form .mq-field-row,
.mq-root .mq-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mq-form .mq-field-row .mq-field,
.mq-root .mq-field-row .mq-field {
    margin-bottom: 0;
}

.mq-form .mq-field input[type="text"],
.mq-form .mq-field input[type="number"],
.mq-form .mq-field input[type="date"],
.mq-form .mq-field select,
.mq-form .mq-field textarea,
.mq-root .mq-field input[type="text"],
.mq-root .mq-field input[type="number"],
.mq-root .mq-field input[type="date"],
.mq-root .mq-field select,
.mq-root .mq-field textarea {
    width: 100%;
    padding: 0 12px;
    border: 1px solid var(--mq-border, #e2e8f0);
    border-radius: var(--radius-sm, 8px);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    background: #fff;
    color: var(--mq-text, #1e293b);
    box-sizing: border-box;
    font-family: inherit;
}

.mq-form .mq-field input[type="text"],
.mq-form .mq-field input[type="number"],
.mq-form .mq-field input[type="date"],
.mq-form .mq-field select,
.mq-root .mq-field input[type="text"],
.mq-root .mq-field input[type="number"],
.mq-root .mq-field input[type="date"],
.mq-root .mq-field select {
    height: 46px;
}

.mq-form .mq-field textarea,
.mq-root .mq-field textarea {
    min-height: 120px;
    padding: 10px 12px;
    border-radius: var(--radius-md, 12px);
    line-height: 1.55;
    resize: vertical;
}

.mq-form .mq-field input:focus,
.mq-form .mq-field select:focus,
.mq-form .mq-field textarea:focus,
.mq-root .mq-field input:focus,
.mq-root .mq-field select:focus,
.mq-root .mq-field textarea:focus {
    outline: none;
    border-color: var(--mq-primary, #406CB4);
}

.mq-form .mq-field textarea::placeholder,
.mq-root .mq-field textarea::placeholder {
    color: var(--mq-muted, #94a3b8);
    opacity: 1;
}

/* 세그먼트 토글 (시간별/카테고리, 보조제/병원약) */
.mq-seg {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 3px;
    background: var(--mq-bg, #f8fafc);
    border: 1px solid var(--mq-border, #e2e8f0);
    border-radius: 12px;
    gap: 0;
    flex-shrink: 0;
}

.mq-form .mq-field > .mq-seg,
.mq-root .mq-field > .mq-seg {
    align-self: flex-start;
}

.mq-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--mq-muted, #94a3b8);
    line-height: 1.4;
}

.mq-seg-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mq-muted, #94a3b8);
    border-radius: 9px;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.mq-seg-btn.active {
    background: #fff;
    color: var(--mq-primary, #406CB4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 칩 토글(요일·기간 등) — .mq-chip + hidden checkbox/radio */
.mq-chips--wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
    border: none;
    overflow: visible;
}

.mq-chip-toggle {
    cursor: pointer;
}

.mq-chip-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mq-chip-toggle:has(input:checked) {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #406CB4;
}

.mq-form .radio-group.check-btn,
.mq-root .radio-group.check-btn {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mq-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mq-text, #1e293b);
    cursor: pointer;
    margin-bottom: 8px;
}

.mq-check-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--mq-primary, #406CB4);
}

.mq-form-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--mq-border, #e2e8f0);
}

/* 크롬리스 내부: 헤더·탭·검색 고정, 본문 스크롤 */
.mq-root > .mq-header-back,
.mq-root > .mq-topbar,
.mq-root > .mq-tabs,
.mq-root > .mq-search-row {
    flex-shrink: 0;
}

.mq-root > .mq-tab-panel,
.mq-root > .mdq-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 크롬리스 케어 + footer2: dock 위에 하단 액션·FAB */
.mq-body--footer2 .mq-bottom-stack {
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 9080;
}

.mq-body--footer2 .mdq-fab {
    bottom: calc(90px + env(safe-area-inset-bottom));
    z-index: 9085;
}

.mq-body--footer2 .mq-root > .mq-tab-panel,
.mq-body--footer2 .mq-root > .mdq-panel {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.mq-body--footer2 .mq-main {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

.mq-body--footer2 .mdq-panel[data-panel='cabinet'] {
    padding-bottom: calc(168px + env(safe-area-inset-bottom));
}

.mq-root #mqRecentMain {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mq-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* PC(≥992px): 중앙 카드 팝업 — care_meal_add / care_drug_add 공통 */
@media (min-width: 992px) {
    .mq-shell {
        min-height: 100vh;
        background: rgba(15, 23, 42, 0.35);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        box-sizing: border-box;
    }

    .mq-root {
        max-width: 440px;
        width: 100%;
        max-height: min(720px, 90vh);
        min-height: 0;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
        border: 1px solid var(--mq-border, #e2e8f0);
        position: relative;
    }

    /* 하단 고정 UI는 카드 폭 안에만 */
    .mq-root .mq-bottom-stack {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
    }

    .mq-root .mdq-fab {
        position: absolute;
        right: 16px;
        bottom: 16px;
        z-index: 25;
    }

    /* 바텀시트(약통 편집 등) — 카드와 동일 폭 */
    .mdq-sheet,
    .mq-bottom-sheet {
        left: 50%;
        right: auto;
        width: min(440px, calc(100vw - 48px));
        max-height: min(88vh, 640px);
        border-radius: 20px 20px 0 0;
        transform: translateX(-50%) translateY(100%);
    }

    .mdq-sheet.open,
    .mq-bottom-sheet.open {
        transform: translateX(-50%) translateY(0);
    }

    /*
     * PC + 전역 header/footer2 허브 페이지
     * design_system I(440px 카드)는 header/footer 없는 크롬리스 전용.
     * mq-body--footer2 는 상단 PC 메뉴 + 본문 허브 폭(980px) 사용.
     */
    body.mq-body--footer2 {
        background: var(--mq-bg, #f8fafc);
    }

    body.mq-body--footer2 .mq-shell {
        min-height: calc(100vh - var(--header2-height, 62px));
        background: transparent;
        display: block;
        padding: 0;
        align-items: stretch;
        justify-content: flex-start;
    }

    body.mq-body--footer2 .mq-root {
        max-width: 980px;
        width: 100%;
        margin: 0 auto;
        max-height: none;
        min-height: calc(100vh - var(--header2-height, 62px));
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    body.mq-body--footer2 .mq-root .mq-bottom-stack {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        width: min(980px, 100%);
        max-width: 980px;
        bottom: 0;
        z-index: 9080;
        border-radius: 0;
    }

    body.mq-body--footer2 .mq-root .mdq-fab {
        position: fixed;
        right: max(24px, calc(50vw - 490px + 16px));
        bottom: calc(24px + env(safe-area-inset-bottom));
        z-index: 9085;
    }

    body.mq-body--footer2 .mdq-sheet,
    body.mq-body--footer2 .mq-bottom-sheet {
        width: min(720px, calc(100vw - 48px));
        max-height: min(88vh, 720px);
    }

    body.mq-body--footer2 .mq-root > .mq-tab-panel,
    body.mq-body--footer2 .mq-root > .mdq-panel {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    body.mq-body--footer2 .mq-main {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    body.mq-body--footer2 .mdq-panel[data-panel='cabinet'] {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   4-3d. 검색 도구바 (mq-toolbar) — 검색 입력 + 아이콘 버튼
        food_explorer / search_hub 공통
   ========================================================================== */
.mq-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 12px;
}

.mq-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0 12px;
    min-height: 48px;
    min-width: 0;
}

.mq-search-wrap:focus-within {
    border-color: #406CB4;
    box-shadow: 0 0 0 3px rgba(64, 108, 180, 0.10);
}

.mq-search-wrap > i {
    color: #94a3b8;
    font-size: 15px;
    flex-shrink: 0;
}

.mq-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    min-width: 0;
    background: transparent;
    font-family: inherit;
}

.mq-search-input::placeholder {
    color: #94a3b8;
}

.mq-icon-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mq-icon-btn:hover {
    border-color: #cbd5e1;
    color: #1e293b;
}

.mq-icon-btn.is-active,
.mq-icon-btn[aria-pressed="true"] {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #406CB4;
}

/* ==========================================================================
   4-3e. 결과 헤더 (mq-result-header) — 결과 수 + 정렬 셀렉트
   ========================================================================== */
.mq-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 8px;
}

.mq-result-header__count {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.mq-result-header__count em {
    font-style: normal;
    color: #406CB4;
}

.mq-sort-select {
    height: 36px;
    padding: 0 28px 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* ==========================================================================
   4-4. 프로그레스 바 (.progress-bar-wrap, .progress-bar)
   ========================================================================== */
.progress-bar-wrap {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #406CB4;
    width: 0%;
    transition: width 0.4s ease;
}

/* ==========================================================================
   4-5. 공통 섹션 카드 (.section-card)
   ========================================================================== */
.section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}

/* ==========================================================================
   4-5b. 표준 섹션 컨테이너 (.mq-section / .mq-section--banner)
   ── 모바일 기본: edge-to-edge (좌우 여백 0, 라디우스 0, 테두리 없음)
   ── --banner: 배너/안내처럼 둥근 카드. 좌우 16px 여백 + 라디우스 + 테두리
   ── PC(≥992px): 두 변형 모두 카드 형태로 통일 (테두리 + 라디우스 + 패딩)
   ── 페이지 전용 컴포넌트(.ns-hero, .ns-card 등)는 이 컨테이너를 둘러싸 사용
   ── 규칙: edge-to-edge(.mq-section 단독)일 때는 페이지에서 별도 radius 부여 금지
   ── 모바일 한정: 다음 섹션과 시각적으로 구분되도록 두꺼운 회색 바텀 스트립을
       자동 부여 (네이버/쿠팡/카카오 스타일). PC에서는 카드 외곽선으로 대체.
   ========================================================================== */
.mq-section {
    background: #ffffff;
    box-sizing: border-box;
    width: 100%;
    border: 0;
    border-radius: 0;
    /* 📏 모바일 edge-to-edge 섹션 구분 스트립 — 다음 섹션과의 시각적 분리
       (PC에서는 아래 미디어쿼리에서 1px 카드 보더로 덮어씀) */
    border-bottom: 8px solid #f1f5f9;
}

/* 마지막 섹션은 하단 스트립 불필요 — 페이지 푸터/액션바와 충돌 방지 */
.mq-section:last-child {
    border-bottom: 0;
}

.mq-section--banner {
    /* 모바일: margin이 폭을 자동으로 깎도록 width:auto.
       width:100% + margin은 가로 오버플로우(우측 잘림)의 원인이 됨 */
    width: auto;
    margin-left: 16px;
    margin-right: 16px;
    /* 둥근 배너는 4면 보더가 필요하므로, 위 .mq-section의 두꺼운 바텀 스트립을
       자동 리셋해 카드 형태가 깨지지 않도록 함 */
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 16px;
}

/* edge-to-edge 섹션 사이 구분 — KPI→브랜드 등과 동일한 8px 회색 바 */
.mq-section-groove {
    display: none;
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    flex-shrink: 0;
    border: 0;
}

@media (max-width: 991px) {
    .mq-section-groove {
        display: block;
    }
}

@media (min-width: 992px) {

    /* PC에서는 둘 다 동일한 카드 형태로 통일 — 모바일 바텀 스트립도 1px 보더로 대체 */
    .mq-section,
    .mq-section--banner {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        border: 1px solid #e2e8f0;
        border-radius: var(--radius-lg);
        padding: 24px;
    }
}

/* ==========================================================================
   4-5a. Guide Callout (NEW STANDARD)
        food_explorer 등 안내형 콜아웃 공통
   ========================================================================== */
.guide-callout,
.fe-search-guide {
    display: block;
    padding: 14px 14px 12px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    color: #475569;
}

.guide-callout__icon,
.fe-search-guide__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #406cb4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.guide-callout__body,
.fe-search-guide__body {
    flex: 1;
    min-width: 0;
}

.guide-callout__title,
.fe-search-guide__title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 7px;
}

.guide-callout__list,
.fe-search-guide__list {
    margin: 0;
    margin-inline-start: 0;
    padding-left: 12px;
    padding-inline-start: 12px;
    list-style: disc;
    list-style-position: outside;
    font-size: 13px;
    line-height: 1.56;
    color: #475569;
}

.guide-callout__list li,
.fe-search-guide__list li {
    display: list-item;
    padding-left: 0;
    margin-bottom: 6px;
}

.guide-callout__body .guide-callout__list,
.fe-search-guide__body .fe-search-guide__list {
    margin-left: 0;
}

.guide-callout__list li:last-child,
.fe-search-guide__list li:last-child {
    margin-bottom: 0;
}

.guide-callout__list li::marker,
.fe-search-guide__list li::marker {
    color: #475569;
}

.guide-callout__list code,
.fe-search-guide__list code {
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    color: #1e3a8a;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1px 6px;
    border-radius: 6px;
}

.guide-callout__list strong,
.fe-search-guide__list strong {
    color: #1f2937;
    font-weight: 700;
}

@media (max-width: 480px) {
    .guide-callout__list,
    .fe-search-guide__list {
        font-size: 12.5px;
    }
}

/* 모바일에서는 콘텐츠 컨테이너 padding이 0인 페이지(food_explorer 등)에서
   가이드 콜아웃이 화면 끝에 붙지 않도록 좌우 16px 안전 여백 */
@media (max-width: 768px) {
    .mq-tab-panel > .guide-callout,
    .fe-tab-panel > .guide-callout {
        margin-left: 16px;
        margin-right: 16px;
    }
}

/* ==========================================================================
   4-5b. Modal (mq-modal) — 안내/도움말/확인용 가벼운 팝업
        .guide-callout 콘텐츠를 그대로 담을 수 있도록 설계.
        오픈: .is-open 토글, ESC/백드롭 클릭으로 닫기 (JS는 페이지에서)
   ========================================================================== */
.mq-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: mqModalFade 0.18s ease-out;
}

.mq-modal.is-open {
    display: flex;
}

.mq-modal__panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    padding: 20px 20px 18px;
    animation: mqModalSlide 0.2s ease-out;
}

.mq-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.mq-modal__close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

@keyframes mqModalFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes mqModalSlide {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 모달 안의 guide-callout는 카드 테두리/그림자/배경을 비워 모달 패널과 통일 */
.mq-modal .guide-callout {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

@media (max-width: 480px) {
    .mq-modal {
        padding: 12px;
    }
    .mq-modal__panel {
        padding: 18px 18px 16px;
    }
}

/* 모바일 화면에서는 가독성을 위해 좌우 여백을 화면 끝까지 펼치고 둥근 테두리 제거 */
@media (max-width: 480px) {
    .section-card {
        padding: 24px 20px;
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 16px;
    }

    /* 탭 직후 section-card는 이중 경계선 방지 */
    .mq-tabs + .section-card,
    .mq-tabs + .mq-tab-panel > .section-card:first-child,
    .fe-tabs + .section-card,
    .fe-tabs + .fe-tab-panel > .section-card:first-child {
        border-top: none;
    }
}

/* 입력 필드 */
.form-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 15px;
}

.form-row dt {
    font-weight: 700;
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 8px;
}

.form-row dd {
    width: 100%;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    height: 46px;
    padding-left: 12px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm); /* ✅ 변수 사용 */
    font-size: 15px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

input::placeholder {
    color: black;
    opacity: 0.3;
}

/* ── 인라인 숫자 + 단위 (케어 팝업·퀵입력 공통) ── */
.cfl-field-box {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 40px;
    padding: 0 14px 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
    overflow: hidden;
}

.cfl-field-box:focus-within {
    border-color: var(--primary, #406cb4);
    box-shadow: 0 0 0 2px rgba(64, 108, 180, 0.12);
}

.cfl-field-box input.cfl-inline-input,
.cfl-field-box input[type="number"].cfl-inline-input,
.cfl-field-box input[type="text"].cfl-inline-input {
    flex: 1 1 0;
    min-width: 0;
    width: auto !important;
    height: auto !important;
    min-height: 0;
    margin: 0;
    padding: 8px 4px 8px 0;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.cfl-field-box input.cfl-inline-input:focus {
    border: none !important;
    box-shadow: none !important;
}

.cfl-field-box input.cfl-inline-input::-webkit-outer-spin-button,
.cfl-field-box input.cfl-inline-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cfl-field-box .cfl-field-unit {
    flex: 0 0 auto;
    padding-left: 2px;
    padding-right: 1px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    line-height: 1.2;
}

/* 시간 등 짧은 값 — 단위(시)가 박스 밖으로 나가지 않게 */
.cfl-field-box--narrow {
    padding-right: 12px;
    padding-left: 8px;
}

.cfl-field-box--narrow input.cfl-inline-input {
    flex: 0 1 auto;
    width: 2.4em !important;
    max-width: calc(100% - 1.75em);
    text-align: center;
    padding-right: 2px;
    padding-left: 0;
}

/* ── 케어 달력 (약 PRN·특수 약물 통계 등) ── */
.cfl-care-cal {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 10px 8px 12px;
}

.cfl-care-cal__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.cfl-care-cal__weekday {
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    padding: 4px 0;
}

.cfl-care-cal__weekday.is-sun {
    color: #f87171;
}

.cfl-care-cal__weekday.is-sat {
    color: #60a5fa;
}

.cfl-care-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px 2px;
}

.cfl-care-cal__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 44px;
    padding: 2px 0 4px;
    border-radius: 8px;
}

.cfl-care-cal__day.is-out {
    opacity: 0.35;
}

.cfl-care-cal__day.is-today {
    background: #eff6ff;
}

.cfl-care-cal__num {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    border-radius: 50%;
    border: 2px solid transparent;
    box-sizing: border-box;
}

.cfl-care-cal__day.has-antiemetic .cfl-care-cal__num {
    background: #fbcfe8;
    border-color: #f9a8d4;
}

.cfl-care-cal__day.has-appetite:not(.has-antiemetic) .cfl-care-cal__num {
    background: #bbf7d0;
    border-color: #86efac;
}

.cfl-care-cal__marks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    min-height: 8px;
    max-width: 100%;
    padding: 0 2px;
    margin-top: 1px;
}

.cfl-care-cal__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cfl-care-cal__dot--0 { background: #a5b4fc; }
.cfl-care-cal__dot--1 { background: #7c6bb8; }
.cfl-care-cal__dot--2 { background: #60a5fa; }
.cfl-care-cal__dot--3 { background: #38bdf8; }

/* 라디오 버튼 그룹 */
.radio-group {
    display: flex;
    gap: 10px;
}

input[type="radio"] {
    display: none;
}

.check-btn label {
    padding: 10px 16px;
    font-size: 15px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    min-width: 80px;
    text-align: center;
    color: #94a3b8;
    display: inline-block;
    transition: all 0.2s;
}

.check-btn input:checked+label {
    border-color: #406CB4;
    color: #406CB4;
    font-weight: bold;
    position: relative;
}

.check-icon {
    display: none;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    fill: #406CB4;
}

input[type="radio"]:checked+label .check-icon {
    display: inline-block;
}

/* 커스텀 체크박스 */
.labelcontainer {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
}

.labelcontainer input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 25px;
    width: 25px;
    background-color: #eee;
}

.labelcontainer:hover input~.checkmark {
    background-color: #ccc;
}

.labelcontainer input:checked~.checkmark {
    background-color: #406CB4;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 9px;
    top: 5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.labelcontainer input:checked~.checkmark:after {
    display: block;
}

/* ==========================================================================
   5. 리스트 & 테이블 (Lists & Tables)
   ========================================================================== */
.list-section {
    width: 100%;
    max-width: 1080px;
    background-color: #f3f4f6;
    padding: 20px;
    border-radius: 12px;
    border: none !important;
}

.list-section table {
    width: 100%;
    border-spacing: 0;
    overflow: hidden;
}

.responsive-table {
    display: table;
    width: 100%;
}

.list-section th {
    background: #4b5563;
    color: #fff;
    padding: 12px 16px;
    text-align: center;
    font-weight: 600;
}

.list-section td {
    padding: 10px;
    text-align: center;
}

.list-section tbody tr:nth-child(odd) {
    background: #fff;
}

.list-section tbody tr:nth-child(even) {
    background: #f4f4f4;
}

/* 상태 뱃지 & 삭제 버튼 */
.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    min-width: 70px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.delete-pill {
    background: #fff;
    color: #406CB4;
    border: 1px solid #406CB4;
}

.delete-pill:hover {
    background: #406CB4;
    color: #fff;
}

/* ==========================================================================
   6. 레시피/푸드/컴포넌트 전용 (Recipe & Components) - ✅ 복구된 부분
   ========================================================================== */
/* 아코디언 */
.accordion-header {
    padding: 20px;
    font-weight: bold;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #e9ebed;
    display: flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    background: #f8fafc;
}

.accordion.active .toggle-icon {
    transform: rotate(180deg);
}

/* 반려동물 등록 박스 */
.registration-box {
    margin: 30px 0;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

#birthdateInput {
    margin-bottom: 12px;
}

/* ==================================================
   🚨 음식 추가 카드 디자인 (깨짐 방지 & 카드형)
   ================================================== */

/* 카드 컨테이너 */
.food-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    transition: all 0.2s;
}

.food-card:hover {
    border-color: #406CB4;
    box-shadow: 0 4px 12px rgba(64, 108, 180, 0.1);
}

/* 1. 헤더 (배지 + 이름 + 삭제버튼) */
.food-card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-right: 20px;
    /* 삭제 버튼 공간 확보 */
}

.food-name {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    word-break: keep-all;
    /* 단어 단위 줄바꿈 */
}

.badge-unchecked {
    flex-shrink: 0;
    /* 배지 크기 고정 */
    padding: 2px 6px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
    /* 텍스트와 줄 맞춤 */
}

.delete-food-card {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.delete-food-card:hover {
    color: #ef4444;
}

/* 2. 메타 정보 (카테고리, 칼로리, 코드) */
.food-card-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.meta-divider {
    color: #cbd5e1;
}

.meta-code {
    margin-left: auto;
    /* 오른쪽 끝으로 밀기 */
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #94a3b8;
    font-family: monospace;
}

/* 3. 입력창 영역 (박스 형태) */
.food-card-inputs {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 10px;
    height: 36px;
    transition: border 0.2s;
}

.input-wrapper:focus-within {
    border-color: #406CB4;
    box-shadow: 0 0 0 2px rgba(64, 108, 180, 0.1);
}

.food-gram-input,
.provide-amount-input {
    border: none;
    width: 100%;
    height: 100%;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    text-align: right;
    padding: 0 4px 0 0;
    background: transparent;
    outline: none;
}

.input-group.main-input .food-gram-input {
    color: #406CB4;
}

/* 섭취량 강조 */

.unit {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.input-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
}

.delete-food-card:hover {
    color: #cc0000;
}

/* 툴팁 (물음표 아이콘) */
.tooltip-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 5px;
}

.tooltip-icon {
    color: #888;
    font-size: 13px;
}

.tooltip-box {
    display: none;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border: 1px solid #ccc;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    z-index: 999;
    font-size: 12px;
    color: #333;
    line-height: 1.4;
}

.tooltip-container:hover .tooltip-box {
    display: block;
}

/* 영양성분 박스 */
.nutrient-grid {
    grid-template-columns: 1fr !important;
    padding: 5px;
}

.nutrient-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 10px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #333;
    width: 100%;
    box-sizing: border-box;
}

.nutrient-header {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 6px;
}

.nutrient-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nutrient-row,
.nutrient-subrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nutrient-row span:first-child {
    font-weight: 600;
}

.nutrient-subrow {
    font-size: 13px;
    color: #555;
    padding-left: 10px;
}

/* 직접 입력 패널 & 배지 */
#manualFoodPanel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#manualFoodPanel.open {
    max-height: 700px;
}

.badge-unchecked {
    position: absolute;
    top: 10px;
    left: 14px;
    background: #e53232;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 5px;
    padding: 2px 10px;
    z-index: 1;
    letter-spacing: 1px;
    display: inline-block;
}

/* 우측 슬라이드 드로어 */
/* #foodDetailDrawer styles removed to use global .drawer full-screen style */

#drawerDim {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1099;
    background: rgba(0, 0, 0, 0.18);
}

#drawerDim.show {
    display: block;
}



/* ==========================================================================
   7. 반응형 설정 (Mobile & Tablet) - 768px 이하
   ========================================================================== */
@media (max-width: 768px) {

    /* 1) 사이드바 숨김 / 헤더(햄버거) 표시 */
    .pc-sidebar {
        display: none !important;
    }

    #siteHeader {
        display: flex !important;
        max-width: 100%;
        position: relative;
        z-index: 100;
    }

    /* 2) 메인 콘텐츠 꽉 채우기 */
    .mainContent {
        margin: 0 !important;
        width: 100% !important;
        padding: 0 16px 100px 16px;
    }

    /* 3) 컨테이너 너비 조정 */
    .container {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 4) 하단 플로팅 메뉴 너비 제한 */
    .bottom-nav {
        width: min(480px, 94vw);
    }

    /* 5) 모든 모바일 화면에서 브랜드 패널(상단 장식) 숨김 처리 (기록/콘텐츠 위주 구성) */
    .brand-panel {
        display: none !important;
    }
}

/* common.css 맨 아래에 복사해서 붙여넣기 */

/* =========================================
   🚨 모바일 헤더 레이아웃 강제 수정 (최종)
   ========================================= */

@media (max-width: 768px) {

    /* 1. 헤더 전체 틀: 양옆으로 찢기 */
    /* PHP 인라인 스타일을 덮어쓰기 위해 !important 사용 */
    #siteHeader>div {
        display: flex !important;
        justify-content: space-between !important;
        /* 좌우 끝으로 배치 */
        align-items: center !important;
        position: relative !important;
        /* 타이틀의 기준점 */
        width: 100% !important;
    }

    /* 2. 가운데 타이틀: 무조건 화면 정중앙에 고정 */
    .header-title {
        position: absolute !important;
        /* 공중부양 시킴 */
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        /* 정확한 중앙 정렬 */

        width: auto !important;
        max-width: 60% !important;
        /* 너무 길어지면 양옆 침범 방지 */
        text-align: center !important;
        white-space: nowrap !important;
        z-index: 10;
        /* 다른 요소보다 위에 오도록 */
        margin: 0 !important;
        /* 불필요한 여백 제거 */
    }

    /* 3. 왼쪽 프로필: 닉네임 텍스트 숨기고 이미지만 표시 */
    .header-profile-info {
        display: none !important;
        /* 닉네임/포인트 숨김 */
    }

    .user-profile {
        z-index: 20;
        /* 타이틀보다 위에 */
    }

    /* 4. 오른쪽 햄버거 메뉴: 오른쪽 끝 고정 */
    .header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        margin-left: auto !important;
        /* 혹시라도 왼쪽으로 붙지 않게 밀어냄 */
        z-index: 20;
    }
}

/* ==================================================
   🚨 음식 추가 카드 디자인 (깨짐 방지 & 카드형)
   ================================================== */

/* 1. 카드 컨테이너 */
.food-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    /* 여백 넉넉히 */
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    /* 위아래로 배치 */
    gap: 12px;
    position: relative;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.food-card:hover {
    border-color: #406CB4;
    box-shadow: 0 4px 12px rgba(64, 108, 180, 0.1);
}

/* 2. 헤더 (이름 + 배지 + 삭제버튼) */
.food-card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-right: 24px;
    /* 삭제 버튼 공간 확보 */
    flex-wrap: wrap;
}

.food-name {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    word-break: keep-all;
    /* 단어 단위로 줄바꿈 */
}

.badge-unchecked {
    flex-shrink: 0;
    padding: 2px 6px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
}

.delete-food-card {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.delete-food-card:hover {
    color: #ef4444;
}

/* 3. 메타 정보 (카테고리, 칼로리) */
.food-card-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
}

.meta-divider {
    color: #cbd5e1;
}

.meta-code {
    margin-left: auto;
    /* 오른쪽 끝으로 밀기 */
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 1px 6px;
    border-radius: 4px;
    color: #94a3b8;
    font-family: monospace;
    font-size: 11px;
}

/* 4. 입력창 영역 (박스 형태) */
.food-card-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 12px;
    height: 42px;
    /* 터치하기 편한 높이 */
    transition: border 0.2s;
}

.input-wrapper:focus-within {
    border-color: #406CB4;
    box-shadow: 0 0 0 2px rgba(64, 108, 180, 0.1);
}

.food-gram-input,
.provide-amount-input {
    border: none;
    width: 100%;
    height: 100%;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    text-align: right;
    padding: 0 4px 0 0;
    background: transparent;
    outline: none;
}

.input-group.main-input .food-gram-input {
    color: #406CB4;
}

/* 섭취량 강조 */

.unit {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

/* 모바일 대응: 화면이 좁을 때 입력창 세로로 배치 */
@media (max-width: 360px) {
    .food-card-inputs {
        flex-direction: column;
        gap: 12px;
    }

    .input-group {
        width: 100%;
    }
}

/* ==================================================
   🚨 음식 카드 레이아웃 긴급 복구 (최종)
   ================================================== */

/* 1. 헤더 영역 (배지랑 이름 겹침 해결) */
.food-card-header {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    position: relative !important;
    width: 100% !important;
}

/* 배지는 크기 고정하고 줄어들지 않게 */
.badge-unchecked {
    flex-shrink: 0 !important;
    width: auto !important;
    white-space: nowrap !important;
    margin-top: 2px !important;
}

/* 이름은 남은 공간 다 차지하게 */
.food-name {
    flex: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    /* flex items 줄바꿈 허용 */
    margin-top: 0 !important;
    line-height: 1.4 !important;
}

/* 삭제 버튼 (X) 위치 고정 */
.delete-food-card {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
}


/* 2. 입력창 영역 (2개씩 나오는 문제 해결) */
.food-card-inputs {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    background: #f8fafc !important;
    padding: 12px !important;
    border-radius: 12px !important;
    margin-top: 8px !important;
}

/* 각 입력 그룹 (섭취량/제공량) */
.input-group {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    /* 라벨 위, 인풋 아래 */
    gap: 6px !important;
    min-width: 0 !important;
}

/* 라벨 스타일 초기화 */
.input-group label {
    font-size: 12px !important;
    color: #64748b !important;
    font-weight: 600 !important;
    margin: 0 !important;
    display: block !important;
    width: 100% !important;
}

/* 인풋 감싸는 박스 (흰색 배경) */
.input-wrapper {
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 0 10px !important;
    height: 46px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 실제 인풋창 (투명화 & 크기 맞춤) */
.food-gram-input,
.provide-amount-input {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #333 !important;
    text-align: right !important;
    padding: 0 4px 0 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 단위 (g) */
.unit {
    font-size: 13px !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
    flex-shrink: 0 !important;
}

/* 가운데 칸막이 */
.input-divider {
    width: 1px !important;
    height: 40px !important;
    background: #e2e8f0 !important;
    flex-shrink: 0 !important;
}


/* [common.css] 맨 아래에 추가 */

/* ==================================================
   ✅ 공통 인풋 래퍼 (Input Wrapper Component)
   - 인풋 옆에 단위(kg, cm 등)나 아이콘을 넣을 때 사용
   - 사용법: <div class="input-wrapper"><input ...><span class="unit">kg</span></div>
   ================================================== */

/* 1. 겉 박스 (테두리 담당) */
.input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    background: #fff;
    border: 1px solid #e7e7e7;
    /* 기본 인풋과 동일한 테두리 */
    border-radius: 12px;
    /* 둥근 모서리 */
    padding: 0 16px;
    /* 좌우 여백 */
    transition: all 0.2s ease;
    position: relative;
}

/* 2. 포커스 효과 (박스 전체가 강조됨) */
.input-wrapper:focus-within {
    border-color: #406CB4;
    box-shadow: 0 0 0 3px rgba(64, 108, 180, 0.1);
    /* 부드러운 광채 */
}

/* 3. 내부 인풋 (테두리 제거 & 투명화) */
.input-wrapper input {
    border: none !important;
    /* 이중 테두리 방지 (필수) */
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 14px 0 !important;
    /* 상하 여백은 여기서 */
    margin: 0 !important;
    width: 100%;
    height: auto;
    font-size: 16px;
    color: #333;
}

/* 4. 단위 텍스트 (kg, 세 등) */
.input-wrapper .unit {
    flex-shrink: 0;
    margin-left: 8px;
    color: #999;
    font-weight: 500;
    font-size: 14px;
}

/* 5. 중앙 정렬 모드 (옵션) */
.input-wrapper.center-mode input {
    text-align: center;
}

/* ==========================================================================
   ✅ [공통] 브랜드 패널 & Split Layout (From nutrition_search.css)
   ========================================================================== */

/* 1. 전체 레이아웃 컨테이너 */
.split-layout-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #ffffff;
}

/* 2. [왼쪽 패널] 브랜드/캐릭터 영역 */
.brand-panel {
    width: 100%;
    min-height: 380px;
    /* 모바일 높이 확보 */
    background: linear-gradient(135deg, #EEF4FF 0%, #E3F2FD 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    z-index: 1;
    padding: 100px 20px 40px;
    /* 상단 여백 확보 */
    text-align: center;
}

/* 3. [오른쪽 패널] 컨텐츠 영역 (기본 구조) */
.content-panel {
    flex: 1;
    background: #ffffff;
    display: flex;
    z-index: 2;
}

/* 컨텐츠 내부 컨테이너 (모바일은 100%, PC만 제한) */
.content-container,
.form-container-max,
.form-container {
    width: 100%;
    max-width: 100%;
    /* 모바일/태블릿에서는 꽉 차게 */
}

/* PC (992px 이상)에서는 common.css PC 미디어쿼리(1619줄)에서 일괄 제어 */

/* 4. 둥둥 떠다니는 배경 애니메이션 */
.floating-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floater {
    position: absolute;
    font-size: 40px;
    opacity: 0.5;
    animation: floatUpProduct 6s infinite ease-in-out;
    filter: drop-shadow(0 4px 6px rgba(64, 108, 180, 0.1));
}

@keyframes floatUpProduct {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* 아이콘 위치 (p1~p6, register.php의 f1~f6도 호환되게 추가) */
.p1,
.f1 {
    left: 10%;
    top: 15%;
    animation-duration: 7s;
    font-size: 50px;
}

.p2,
.f2 {
    left: 80%;
    top: 25%;
    animation-duration: 5s;
    font-size: 45px;
    animation-delay: 1s;
}

.p3,
.f3 {
    left: 15%;
    top: 60%;
    animation-duration: 8s;
    font-size: 55px;
    animation-delay: 2s;
}

.p4,
.f4 {
    left: 75%;
    top: 70%;
    animation-duration: 6s;
    font-size: 40px;
    animation-delay: 0.5s;
}

.p5,
.f5 {
    left: 50%;
    top: 45%;
    animation-duration: 4s;
    font-size: 35px;
    animation-delay: 3s;
}

.p6,
.f6 {
    left: 30%;
    top: 85%;
    animation-duration: 9s;
    font-size: 40px;
    animation-delay: 1.5s;
}

/* 5. 텍스트 및 캐릭터 스타일 */
.sticky-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
}

.page-main-title {
    font-size: 26px;
    font-weight: 800;
    color: #333;
    margin-bottom: 10px;
}

.page-sub-desc {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.char-guide-box {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

.guide-bubble {
    background: #fff;
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(64, 108, 180, 0.12);
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 15px;
    position: relative;
    animation: floatBubble 3s ease-in-out infinite alternate;
}

@keyframes floatBubble {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-5px);
    }
}

.bubble-tail {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-top: 10px solid #fff;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
}

.cherry-3d-char {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.15));
}


/* 6. 💻 PC 화면 대응 (Top Banner Layout) - 992px 이상 */
@media (min-width: 992px) {
    .split-layout-container {
        width: 100%;
        /* 전폭으로 펼침 */
        max-width: none;
        /* 제한 없음 */
        height: auto;
        overflow: visible;
        padding-top: 24px;
        /* margin: 0 auto 제거 — content-container에서 중앙 정렬 */
    }

    /* 슬림한 상단 배너로 변경 */
    .brand-panel {
        width: 100%;
        max-width: 100%;
        height: 180px !important;
        min-height: 180px !important;
        /* 기본값 380px 강제 리셋 */
        padding: 0 40px !important;
        /* 기본값 100px 20px 40px 강제 리셋 */
        border-radius: 24px;
        justify-content: center;
        align-items: center;
        top: auto;
        box-shadow: 0 8px 24px rgba(64, 108, 180, 0.08);
        margin-bottom: 30px;
        overflow: hidden;
    }


    .sticky-content {
        display: flex;
        flex-direction: row-reverse;
        /* 캐릭터가 왼쪽, 말풍선이 오른쪽에 오도록 */
        align-items: center;
        justify-content: center;
        gap: 30px;
        width: 100%;
        max-width: 1000px !important;
        /* carediary.css 등 400px 재선언 강제 리셋 */
    }

    .sticky-content img[alt="로고"] {
        display: none;
        /* 상단 메뉴에 로고가 있으므로 숨김 */
    }

    /* 캐릭터 크기 축소 */
    .cherry-3d-char {
        width: 130px !important;
        max-height: 160px !important;
        /* brand-panel 180px 높이에 맞게 */
        height: auto !important;
        margin: 0 !important;
        object-fit: contain;
    }

    .guide-bubble {
        margin-bottom: 0;
        font-size: 16px;
    }

    .bubble-tail {
        left: -10px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-right: 10px solid #fff;
        border-left: none;
        /* 캐릭터를 향해 삐져나오도록 수정 */
    }

    /* PC 캐릭터 크기 확대 (제거/무시됨) */
    .page-main-title {
        font-size: 32px;
    }

    /* 오른쪽 패널 중앙 정렬 (이제는 하단 컨텐츠) */
    .content-panel {
        height: auto;
        overflow-y: visible;
        padding: 0;
        /* 여백 초기화 */
        align-items: center;
        /* 자식 요소 중앙 정렬 */
        margin-top: 0;
    }

    .content-container,
    .form-container-max,
    .form-container {
        max-width: 1080px;
        width: 100%;
        margin: 0 auto;
    }
}

/* 📱 모바일 768px 이하: content-panel padding 제거 */
@media (max-width: 768px) {
    .content-panel {
        padding: 0 !important;
    }

    /* 모바일 기본은 edge-to-edge: 페이지별 필요 시 개별 CSS에서만 여백 부여 */
    .content-container {
        padding: 0;
        box-sizing: border-box;
    }
}

/* =========================================
   🐾 커스텀 로딩 화면 (귀여움 주의)
   ========================================= */

/* 로딩 전체 덮개 (강력 버전) */
#globalLoader,
#cflCarePageLoader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 2147483647;
    /* CSS 허용 최대값 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;

    /* 스크롤 방지 및 터치 차단 */
    overflow: hidden;
    touch-action: none;
}

/* 통통 튀는 체리 */
.loader-char {
    width: 80px;
    height: auto;
    animation: bounceChar 1s infinite alternate cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

/* 그림자 (체리가 뛸 때 같이 움직임) */
.loader-shadow {
    width: 60px;
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    margin-top: 10px;
    animation: shrinkShadow 1s infinite alternate cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

/* 바뀌는 아이콘 텍스트 */
.loader-text-box {
    margin-top: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #406CB4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loader-emoji {
    font-size: 20px;
    display: inline-block;
    width: 24px;
    text-align: center;
}

/* 애니메이션 정의 */
@keyframes bounceChar {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-20px);
    }
}

@keyframes shrinkShadow {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.2;
    }
}

/* 케어 크롬리스: 첫 DB 로드 전 본문 숨김 + 체리 로더 */
#cflCarePageLoader {
    display: none;
}

body.cfl-care-page-loading .mq-shell {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

body.cfl-care-page-ready .mq-shell {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease;
}

body.cfl-care-page-loading #cflCarePageLoader {
    display: flex;
    opacity: 1;
}

#cflCarePageLoader {
    transition: opacity 0.38s ease;
}

.cfl-care-page-loader__text-box {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.cfl-care-page-loader__sub {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

/* ==========================================================================
   20. 탭 네비게이션 (Tabs) - Promoted from Guide
   ========================================================================== */
.tab-nav {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.tab-list {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-list::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.25s cubic-bezier(.4, 0, .2, 1);
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab-btn:hover {
    color: #406CB4;
    background: #EEF4FF;
    border-radius: 8px 8px 0 0;
}

.tab-btn.active {
    color: #406CB4;
    border-bottom-color: #406CB4;
    font-weight: 700;
}

.tab-btn i {
    font-size: 15px;
}

.tab-count {
    background: #EEF4FF;
    color: #406CB4;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    min-width: 20px;
    text-align: center;
}

.tab-btn.active .tab-count {
    background: #406CB4;
    color: #fff;
}

/* ==========================================================================
   21. 아티클 카드 (Article Card) - Promoted from Guide
   ========================================================================== */
.article-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.25s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden;
}

.article-card:hover {
    border-color: #406CB4;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.article-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.article-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
    flex-shrink: 0;
}

.article-card-icon.blue {
    background: #EEF4FF;
    color: #406CB4;
}

.article-card-icon.amber {
    background: #FFF8E1;
    color: #f59e0b;
}

.article-card-icon.green {
    background: #ECFDF5;
    color: #10b981;
}

.article-card-icon.rose {
    background: #FFF1F2;
    color: #f43f5e;
}

.article-card-icon.purple {
    background: #F3E8FF;
    color: #8b5cf6;
}

.article-card-info {
    flex: 1;
    min-width: 0;
}

.article-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #1E293B;
    margin: 0 0 4px;
    line-height: 1.3;
}

.article-card-desc {
    font-size: 13px;
    color: #64748B;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #94A3B8;
}

.article-card-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #cbd5e1;
    font-size: 14px;
    transition: all 0.25s cubic-bezier(.4, 0, .2, 1);
}

.article-card:hover .article-card-arrow {
    color: #406CB4;
    transform: translateY(-50%) translateX(3px);
}

/* ==========================================================================
   22. 프로모션/액션 위젯 (Promo Widget) - Promoted from Guide
   ========================================================================== */
.promo-widget {
    background: linear-gradient(135deg, #EEF4FF 0%, #f3f0ff 100%);
    border: 1px solid #ddd6fe;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.promo-widget-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #406CB4;
    border-radius: 14px;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}

.promo-widget-info {
    flex: 1;
}

.promo-widget-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1E293B;
    margin: 0 0 4px;
}

.promo-widget-info p {
    font-size: 13px;
    color: #64748B;
    margin: 0;
}

/* ==========================================================================
   23. 컨텐츠 허브 · 인수치 계산기 (.contents-hub-page / .pcalc-root)
       디자인 시스템: 브랜드 블루 #406CB4, 카드·탭 패턴과 정렬
   ========================================================================== */
.contents-hub-page {
    box-sizing: border-box;
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 16px calc(140px + env(safe-area-inset-bottom));
    min-height: calc(100vh - 180px);
}

.contents-hub-intro .contents-hub-badge {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

.contents-hub-intro .contents-hub-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px;
    letter-spacing: -0.2px;
}

.contents-hub-intro .contents-hub-desc {
    color: #64748b;
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
}

/* 본문 링크 — 섹션 24 (.cfl-text-link / prose) */

/* 연구소 칼럼 — 주제 칩 + 글 목록 */
.contents-column-chips {
    margin: 0 0 12px;
    padding: 8px 0 14px;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

/* 이번 주 인기 칼럼 — 가로 스와이프 */
.contents-popular-section {
    margin: 0 0 18px;
}

.contents-popular-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.contents-popular-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.contents-popular-hint {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

.contents-popular-swiper {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.contents-popular-swiper::-webkit-scrollbar {
    display: none;
}

.contents-popular-card {
    flex: 0 0 min(78vw, 280px);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.contents-popular-card:active {
    transform: scale(0.98);
}

.contents-popular-card__thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f5f9;
}

.contents-popular-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.contents-popular-card__body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.contents-popular-card__badge {
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
}

.contents-popular-card__title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.contents-popular-card__meta {
    font-size: 12px;
    color: #94a3b8;
}

/* 목록 썸네일 */
.contents-column-item__thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contents-column-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.contents-column-item__thumb--placeholder {
    color: #64748b;
    font-size: 18px;
}

.contents-column-item__thumb--beginner {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #059669;
}

.contents-column-item__thumb--standards {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #2563eb;
}

.contents-column-item__thumb--supplements {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #7c3aed;
}

.contents-column-item__thumb--clinical {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #ea580c;
}

.contents-popular-card__thumb.contents-column-item__thumb--placeholder,
.contents-popular-card__thumb.contents-column-item__thumb--beginner,
.contents-popular-card__thumb.contents-column-item__thumb--standards,
.contents-popular-card__thumb.contents-column-item__thumb--supplements,
.contents-popular-card__thumb.contents-column-item__thumb--clinical {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    flex: none;
    font-size: 28px;
}

.contents-column-board {
    padding: 0;
    overflow: hidden;
}

.contents-column-loading {
    padding: 28px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.contents-column-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s ease;
}

.contents-column-item:last-child {
    border-bottom: none;
}

.contents-column-item:hover {
    background: #f8fafc;
}

.contents-column-item:active {
    background: #f1f5f9;
}

.contents-column-item__meta {
    flex: 1;
    min-width: 0;
}

.contents-column-item__title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.contents-column-item__sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.contents-column-item__cat {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
}

.contents-column-item__cat--important {
    background: #fef2f2;
    color: #dc2626;
}

.contents-column-item__date {
    white-space: nowrap;
}

.contents-column-item__chevron {
    flex-shrink: 0;
    color: #cbd5e1;
    font-size: 14px;
}

.contents-column-empty {
    padding: 28px 18px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    line-height: 1.65;
}

.contents-hub-page code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 컨텐츠 허브 — 도구 카테고리 칩 (.mq-chips) + 선택 전 빈 화면 */
.contents-tool-chips {
    margin: 0;
    padding-top: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.contents-tool-chips .mq-chip {
    gap: 6px;
}

.contents-tool-placeholder {
    text-align: center;
    padding: 36px 20px 48px;
    color: #64748b;
}

.contents-tool-placeholder__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eef4ff 0%, #e0ecff 100%);
    border: 1px solid #bfdbfe;
    color: #406CB4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.contents-tool-placeholder__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.contents-tool-placeholder__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.contents-tool-panel {
    padding-top: 12px;
}

/* --- 인수치 계산기 (페이지 공통; 기존 전역 .tab-btn 과 충돌 방지) --- */
.pcalc-root.section-card {
    margin-bottom: 0;
}

.pcalc-type-tabs {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 16px;
    margin-bottom: 22px;
}

.pcalc-type-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 700;
    font-size: 14px;
    border-radius: 12px;
    padding: 12px 10px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
}

.pcalc-type-tab i {
    font-size: 14px;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.pcalc-type-tab:hover {
    color: #334155;
}

.pcalc-type-tab.active {
    background: #fff;
    color: #406CB4;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.pcalc-type-tab.active i {
    color: #406CB4;
}

.pcalc-type-tab:focus-visible {
    outline: 2px solid #406CB4;
    outline-offset: 2px;
}

.pcalc-form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.pcalc-field {
    flex: 1;
    min-width: 0;
}

.pcalc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.pcalc-help {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    margin-left: 4px;
}

.pcalc-input {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #f8fafc;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    font-family: inherit;
}

.pcalc-input:focus {
    border-color: #406CB4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(64, 108, 180, 0.12);
}

.pcalc-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
    margin-bottom: 6px;
    background: #f8fafc;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.pcalc-check {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.pcalc-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pcalc-check-box {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.pcalc-check input:checked+.pcalc-check-box {
    background: #406CB4;
    border-color: #406CB4;
}

.pcalc-check input:checked+.pcalc-check-box::after {
    content: '✔';
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.pcalc-result-card {
    margin-top: 22px;
    background: linear-gradient(135deg, #1e3a6e 0%, #406CB4 58%, #6b9fd4 100%);
    border-radius: var(--radius-xl, 20px);
    padding: 22px 18px;
    color: #fff;
    box-shadow: 0 12px 28px rgba(64, 108, 180, 0.22);
}

.pcalc-result-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 12px;
    align-items: stretch;
}

.pcalc-result-item {
    text-align: center;
    min-width: 0;
}

.pcalc-result-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.88;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.pcalc-result-value {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    word-break: break-all;
}

.pcalc-result-value.is-range {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.pcalc-range-note {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.08);
    color: #475569;
    font-size: 12px;
    line-height: 1.55;
}

.pcalc-range-note strong {
    color: #334155;
    font-weight: 700;
}

.pcalc-result-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.22);
    align-self: stretch;
}

.pcalc-btn-reset {
    width: 100%;
    margin-top: 14px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
}

.pcalc-btn-reset:hover {
    background: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.pcalc-note {
    margin: 18px 0 0;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.65;
    text-align: center;
}

@media (max-width: 520px) {
    .pcalc-form-row {
        flex-direction: column;
        gap: 12px;
    }

    .pcalc-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .pcalc-result-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pcalc-result-divider {
        width: 100%;
        height: 1px;
    }

    .pcalc-type-tab {
        font-size: 13px;
        padding: 11px 8px;
    }
}

/* ==========================================================================
   Legal / policy documents (.legal-page, .legal-doc)
   ========================================================================== */
.legal-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
    padding-bottom: 40px;
    box-sizing: border-box;
}

.legal-doc {
    line-height: 1.65;
    color: #334155;
}

.legal-doc__head {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.legal-doc__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #1e293b;
}

.legal-doc__meta {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.legal-doc h2 {
    margin: 28px 0 10px;
    font-size: 17px;
    font-weight: 800;
    color: #406CB4;
    line-height: 1.35;
}

.legal-doc h3 {
    margin: 18px 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.legal-doc p {
    margin: 0 0 10px;
    font-size: 14px;
    color: #475569;
}

.legal-doc ul,
.legal-doc ol {
    margin: 0 0 12px;
    padding-left: 20px;
}

.legal-doc li {
    margin-bottom: 6px;
    font-size: 14px;
    color: #475569;
}

.legal-doc__callout {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.55;
}

.legal-doc__callout--info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.legal-doc__table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 14px;
    font-size: 13px;
}

.legal-doc__table th,
.legal-doc__table td {
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.legal-doc__table th {
    background: #f8fafc;
    font-weight: 700;
    color: #334155;
}

.legal-doc__footnote {
    margin-top: 24px;
    font-size: 12px;
    color: #94a3b8;
}

.legal-lang-switch {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}

.legal-lang-switch__link {
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
}

.legal-lang-switch__link.is-active,
.legal-lang-switch__link:hover {
    color: #406CB4;
}

.legal-lang-switch__sep {
    color: #cbd5e1;
}

/* Support nav links (profile, contact hub) */
.support-nav {
    display: flex;
    flex-direction: column;
}

.support-nav__item {
    display: block;
    padding: 14px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
    transition: color 0.15s ease;
}

.support-nav__item:first-child {
    padding-top: 0;
}

.support-nav__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.support-nav__item:hover .support-nav__title {
    color: #406CB4;
}

.support-nav__title {
    display: block;
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #1e293b;
}

.support-nav__desc {
    display: block;
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
}

/* Shared section header (profile, legal, contact) */
.profile-section__head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.profile-section__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #1e293b;
}

.profile-section__desc {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
}

@media (max-width: 991px) {
    .profile-page .mq-section.profile-section,
    .legal-page .mq-section.profile-section {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .profile-section__title {
        font-size: 20px;
    }
}

.contact-info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 12px;
}

.contact-info-card__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.contact-info-card__row:last-child {
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .legal-doc__title {
        font-size: 20px;
    }
}

/* --------------------------------------------------------------------------
   24. 본문 인라인 텍스트 링크 (가이드·법률·허브 prose)
   - .cfl-text-link / .wiki-link : 명시적 클래스
   - class 없는 <a> : .wiki-article-content 등 prose 영역에서 자동 적용
   -------------------------------------------------------------------------- */
.cfl-text-link,
.wiki-link,
.wiki-article-content a:not([class]),
.design-guide-container a:not([class]),
.wiki-callout a:not([class]),
.legal-doc__body a:not([class]),
.cfl-prose a:not([class]),
.contents-hub-intro .contents-hub-desc a:not([class]),
.contents-column-empty a:not([class]),
.contents-tool-placeholder__desc a:not([class]) {
    color: #406CB4;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #bfdbfe;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.cfl-text-link:hover,
.wiki-link:hover,
.wiki-article-content a:not([class]):hover,
.design-guide-container a:not([class]):hover,
.wiki-callout a:not([class]):hover,
.legal-doc__body a:not([class]):hover,
.cfl-prose a:not([class]):hover,
.contents-hub-intro .contents-hub-desc a:not([class]):hover,
.contents-column-empty a:not([class]):hover,
.contents-tool-placeholder__desc a:not([class]):hover {
    color: #2e5490;
    border-bottom-color: #406CB4;
    background: #eef4ff;
}

.cfl-text-link:focus-visible,
.wiki-link:focus-visible,
.wiki-article-content a:not([class]):focus-visible,
.design-guide-container a:not([class]):focus-visible,
.wiki-callout a:not([class]):focus-visible,
.legal-doc__body a:not([class]):focus-visible,
.cfl-prose a:not([class]):focus-visible,
.contents-hub-intro .contents-hub-desc a:not([class]):focus-visible,
.contents-column-empty a:not([class]):focus-visible,
.contents-tool-placeholder__desc a:not([class]):focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ==========================================================================
   25. Paywall — PLUS 구독 / 포인트 잠금 (공통)
   - inline: 스마트케어 질병 영양평가 등 카드형
   - overlay: 상품상세 블러+잠금 (FLUTD·원재료 추정)
   - teaser: 밸런스업 등 무료 미끼 배너
   ========================================================================== */
.cfl-paywall-card {
    background: var(--semantic-warning-bg);
    border: 1px solid var(--semantic-warning-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.cfl-paywall-card--points {
    background: var(--primary-soft);
    border-color: #bfdbfe;
}

.cfl-paywall-card__head {
    font-size: 12px;
    font-weight: 800;
    color: var(--semantic-warning-ink);
    margin-bottom: 8px;
    line-height: 1.4;
}

.cfl-paywall-card--points .cfl-paywall-card__head {
    color: var(--primary-deep);
}

.cfl-paywall-card__preview {
    margin-bottom: 10px;
}

.cfl-paywall-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cfl-paywall-tag {
    background: #fee2e2;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.cfl-paywall-lock {
    background: var(--surface-card);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    border: 1px dashed var(--semantic-warning-border);
}

.cfl-paywall-card--points .cfl-paywall-lock {
    border-color: #bfdbfe;
}

.cfl-paywall-lock__crown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #ea580c;
    font-size: 16px;
    margin-bottom: 6px;
}

.cfl-paywall-lock__p {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 6px;
}

.cfl-paywall-lock__title {
    font-size: 13px;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cfl-paywall-lock--points .cfl-paywall-lock__title {
    color: var(--primary-deep);
}

.cfl-paywall-lock__cost {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--primary-soft);
    color: var(--primary);
}

.cfl-paywall-lock__lead {
    margin: 4px 0 8px;
    font-size: 12px;
    line-height: 1.55;
    color: #b45309;
}

.cfl-paywall-lock--points .cfl-paywall-lock__lead {
    color: var(--text-tertiary);
}

.cfl-paywall-lock__note {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
}

.cfl-paywall-lock__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

@media (min-width: 420px) {
    .cfl-paywall-lock__actions--row {
        flex-direction: row;
        justify-content: center;
    }
}

.cfl-paywall-lock__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cfl-paywall-lock__btn--primary {
    background: #f97316;
    color: #fff;
}

.cfl-paywall-lock__btn--primary:hover {
    background: #ea580c;
    color: #fff;
}

.cfl-paywall-lock--points .cfl-paywall-lock__btn--primary {
    background: var(--primary);
}

.cfl-paywall-lock--points .cfl-paywall-lock__btn--primary:hover {
    background: var(--primary-deep);
}

.cfl-paywall-lock__btn--ghost {
    background: var(--surface-card);
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.cfl-paywall-lock__btn--ghost:hover {
    background: var(--primary-soft);
}

/* overlay — 상품상세 잠금 영역 */
.cfl-paywall-overlay {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-height: 140px;
}

.cfl-paywall-overlay__content {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
    opacity: 0.55;
    padding: 12px;
}

.cfl-paywall-overlay__skeleton {
    min-height: 120px;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: cfl-paywall-shimmer 1.4s ease infinite;
}

@keyframes cfl-paywall-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.cfl-paywall-overlay__veil {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(2px);
}

.cfl-paywall-overlay__veil .cfl-paywall-lock {
    width: 100%;
    max-width: 320px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-style: solid;
}

/* teaser — 밸런스업 등 무료 미끼 */
.cfl-paywall-teaser {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid var(--semantic-purple-border);
    margin: 12px 0;
}

.cfl-paywall-teaser__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff;
    color: var(--semantic-purple-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.cfl-paywall-teaser__body {
    flex: 1;
    min-width: 0;
}

.cfl-paywall-teaser__title {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--semantic-purple-ink);
    margin-bottom: 4px;
}

.cfl-paywall-teaser__lead {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #5b21b6;
}

.cfl-paywall-teaser__cta {
    flex-shrink: 0;
    align-self: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--semantic-purple-ink);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--semantic-purple-border);
}

.cfl-paywall-teaser__cta:hover {
    background: #fff;
}