/* nutrition_search.css - Cherry Dr. Split Layout 적용 */

/* =========================================
   2. 검색 UI 스타일 (우측 패널 내부)
   ========================================= */

/* 검색 바 */
.search-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
}

@media(max-width:768px) {
    .search-row {
        margin: 20px;
    }
}

.search-input {
    flex: 1;
    height: var(--control-h);
    padding: 0 16px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(64, 108, 180, 0.1);
}

/* 검색 버튼 (강제 스타일 적용) */
.search-btn {
    /* 크기 및 정렬 */
    width: 50px !important;
    height: 46px !important;
    /* 인풋 높이랑 맞춤 */
    min-width: 50px !important;
    padding: 0 !important;

    /* 배경 및 색상 */
    background: #406CB4 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;

    /* 아이콘 중앙 정렬 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* 폰트 및 커서 */
    font-size: 18px !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}

.search-btn:hover {
    background: #355a96 !important;
}

/* 아이콘 크기 미세 조정 */
.search-btn i {
    font-size: 18px !important;
}

/* 카테고리 바 */
.cat-bar {
    display: flex;
    gap: 8px;
    padding: 5px 2px 15px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.cat-bar::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 99px;
    border: 1px solid #E6EAF6;
    background: #fff;
    color: #3B4B83;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(64, 108, 180, 0.1);
}

.cat-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(64, 108, 180, 0.2);
}

.cat-chip.all {
    background: #F5F7FA;
    color: #666;
}

/* 검색 결과 카드 (리스트) */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.food-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

@media(max-width:768px) {
    .food-card {
        margin-left: 15px;
    }
}

.food-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.food-card__media {
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
}

.food-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.food-card__body {
    flex: 1;
    min-width: 0;
}

.food-card__title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.3;
}

.food-card__meta {
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 8px;
    align-items: center;
}

.food-card__brand {
    color: var(--primary);
    font-weight: 600;
}

.food-card__kcal {
    background: #f0f7ff;
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ==================================================
   [복구] 등급 배지 (일반/신부전 점수)
   ================================================== */
.food-card__grades {
    margin-bottom: 6px;
    display: flex;
    gap: 4px;
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
}

/* 일반 등급 (파랑 계열) */
.grade-badge.general {
    background: #eff6ff;
    /* 연한 파랑 배경 */
    border-color: #dbeafe;
    /* 파랑 테두리 */
    color: #1d4ed8;
    /* 진한 파랑 글씨 */
}

/* 신부전 등급 (보라 계열) */
.grade-badge.renal {
    background: #f5f3ff;
    /* 연한 보라 배경 */
    border-color: #ddd6fe;
    /* 보라 테두리 */
    color: #7c3aed;
    /* 진한 보라 글씨 */
}

/* 기여자 정보 */
.food-card__contrib {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
    font-size: 11px;
    color: #aaa;
    display: flex;
    gap: 6px;
    align-items: center;
}

/* 상세 보기 (Nutrition Facts) */
#nutritionFactsContainer {
    margin-top: 20px;
    animation: slideUp 0.3s ease-out;
}

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

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

/* 기존 Nutrition Facts 내부 스타일 오버라이드 (깔끔하게) */
.nutrition-facts {
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: none;
    padding: 25px;
    margin: 0;
}

.nf-img {
    border-radius: 16px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 15px;
}

.nf-title {
    font-size: 22px;
    font-weight: 800;
    color: #333;
}

.donut {
    margin: 20px auto;
}

.ns-card {
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f0f0f0;
    margin-bottom: 15px;
}

/* 더보기 버튼 */
#cds-load-more {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background: #fff;
    border: 2px solid #eee;
    border-radius: 12px;
    color: #666;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

#cds-load-more:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 공통 유틸 */
.is-hidden {
    display: none !important;
}



/* ==================================================
   🚨 카테고리 바 긴급 수정 (강제 가로 정렬)
   ================================================== */

/* 컨테이너: 무조건 가로 한 줄로 배치 */
#catBarLarge,
#catBarSmall {
    display: flex !important;
    flex-direction: row !important;
    /* 가로 방향 */
    flex-wrap: nowrap !important;
    /* 줄바꿈 금지 */
    overflow-x: auto !important;
    /* 가로 스크롤 허용 */
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 10px 2px !important;
    /* 터치 영역 확보 */
    margin-bottom: 10px !important;

    /* 스크롤바 숨기기 */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@media(max-width:768px) {

    #catBarLarge,
    #catBarSmall {
        margin-left: 15px;
    }
}

#catBarLarge::-webkit-scrollbar,
#catBarSmall::-webkit-scrollbar {
    display: none;
}

/* 버튼(칩): 크기를 내용물에 맞춤 */
#catBarLarge .cat-chip,
#catBarSmall .cat-chip {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    /* 너비 자동 */
    min-width: auto !important;
    /* 최소 너비 해제 */
    max-width: none !important;
    /* 최대 너비 해제 */
    flex: 0 0 auto !important;
    /* 늘어나지 않게 고정 */

    padding: 8px 16px !important;
    margin: 0 !important;
    border-radius: 99px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    /* 글자 줄바꿈 금지 */

    /* 디자인 복구 */
    border: 1px solid #E6EAF6 !important;
    background: #fff !important;
    color: #3B4B83 !important;
}

/* 활성화된 버튼 스타일 */
#catBarLarge .cat-chip.active,
#catBarSmall .cat-chip.active {
    background: #406CB4 !important;
    color: #fff !important;
    border-color: #406CB4 !important;
}

/* '전체' 버튼 스타일 */
#catBarLarge .cat-chip.all,
#catBarSmall .cat-chip.all {
    background: #F5F7FA !important;
    color: #666 !important;
}



/* ==========================================================================
   4. 상세 화면 (Nutrition Facts) 디자인 복구 및 개선
   ========================================================================== */

/* 상세 컨테이너 애니메이션 */
#nutritionFactsContainer {
    animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 공통 카드 스타일 (ns-card) */
.ns-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

/* 카드 헤더 */
.ns-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
    border-bottom: 1px solid #f5f7fa;
    padding-bottom: 12px;
}

.ns-title {
    font-size: 18px;
    font-weight: 800;
    color: #1f2937;
}

.ns-sub {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
}

/* -------------------------------------------------------
   (A) 상단 기본 정보 (이미지, 타이틀, 제공량)
   ------------------------------------------------------- */
.nutrition-facts {
    text-align: center;
}

/* 제품 이미지 */
.nf-imgwrap {
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.nf-img {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    object-fit: cover;
}

/* 타이틀 및 카테고리 */
.nf-title {
    font-size: 24px;
    font-weight: 800;
    color: #111;
    margin: 10px 0 5px;
    line-height: 1.3;
}

.nf-cat {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
    background: #f3f4f6;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
}

/* 출처 정보 */
.nf-source {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nf-source .source-label {
    background: #e5e7eb;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
}

.nf-source .source-text {
    color: #374151;
    font-weight: 500;
}

.nf-source .source-link {
    color: #406CB4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.nf-source .source-link:hover {
    color: #355a96;
    text-decoration: underline;
}

/* 기여자 정보 (업로더, 날짜) */
.nf-contrib {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nf-contrib .uploader {
    color: #4b5563;
    font-weight: 600;
}

.nf-edit-link {
    color: #406CB4;
    text-decoration: none;
    font-weight: 600;
    margin-left: 10px;
}

/* 제공량 설정 인풋 */
.nf-serving-select {
    background: #f9fafb;
    padding: 15px;
    border-radius: 16px;
    margin: 20px 0;
}

.nf-serving-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    color: #374151;
    font-weight: 600;
}

.nf-qty {
    width: 50px !important;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    color: #406CB4;
}

.nf-unit {
    width: 80px !important;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-weight: 600;
    color: #374151;
}

/* 요약 영양소 (큰 글씨) */
.nf-line {
    height: 1px;
    background: #e5e7eb;
    margin: 20px 0;
}

.nf-nutrient {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 15px;
    color: #4b5563;
}

.nf-nutrient strong {
    color: #111;
}


/* -------------------------------------------------------
   (B) 도넛 차트 (칼로리 출처) - 백업본 복구 및 디자인 개선
   ------------------------------------------------------- */
.donut-wrap {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.donut {
    --size: 220px;
    --thickness: 28px;
    --c-prot: #FFD166;
    /* 단백질: 노랑 */
    --c-carb: #06D6A0;
    /* 탄수화물: 초록 */
    --c-fat: #EF476F;
    /* 지방: 핑크레드 */

    width: var(--size);
    height: var(--size);
    position: relative;
    border-radius: 50%;
    background: conic-gradient(var(--c-prot) 0 var(--p1, 33%),
            var(--c-carb) var(--p1, 33%) var(--p2, 66%),
            var(--c-fat) var(--p2, 66%) 100%);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* 도넛 가운데 구멍 */
.donut-hole {
    position: absolute;
    inset: calc(50% - (var(--size)/2 - var(--thickness)));
    background: #fff;
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* 도넛 중앙 텍스트 */
.donut-center {
    text-align: center;
}

.donut-kcal {
    font-size: 32px;
    font-weight: 800;
    color: #111;
    line-height: 1;
    letter-spacing: -1px;
}

.donut-label {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    font-weight: 600;
}

/* 범례 (Legend) */
.legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.lg {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
    font-weight: 600;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.prot {
    background: #FFD166;
}

.dot.carb {
    background: #06D6A0;
}

.dot.fat {
    background: #EF476F;
}


/* -------------------------------------------------------
   (C) 영양성분 테이블 (Nutrition Table)
   ------------------------------------------------------- */
.nf-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
}

.nf-table td {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.nf-table tr:last-child td {
    border-bottom: none;
}

/* 라벨 컬럼 */
.nf-table .label {
    color: #6b7280;
    font-weight: 500;
    width: 40%;
}

.nf-table .label.indent {
    padding-left: 15px;
    font-size: 13px;
    position: relative;
}

.nf-table .label.indent::before {
    content: "└";
    position: absolute;
    left: 0;
    color: #d1d5db;
}

/* 값 컬럼 */
.nf-table .val {
    text-align: right;
    font-weight: 700;
    color: #111;
}

/* DM/미네랄 보조 컬럼 */
.nf-table .dm {
    text-align: right;
    color: #9ca3af;
    font-size: 12px;
    width: 25%;
}


/* -------------------------------------------------------
   (D) Ca:P (칼슘:인) 분석 박스
   ------------------------------------------------------- */
.cap-judge-row td {
    padding-top: 10px;
    padding-bottom: 15px;
    border: none;
}

.cap-judge {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    align-items: flex-start;
}

.cap-tag {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
}

/* 상태별 색상 */
.cap-judge.cap-best {
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: #065f46;
}

.cap-judge.cap-best .cap-tag {
    background: #10b981;
    color: #fff;
}

.cap-judge.cap-slight-low {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1e40af;
}

.cap-judge.cap-slight-low .cap-tag {
    background: #3b82f6;
    color: #fff;
}

.cap-judge.cap-low {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.cap-judge.cap-low .cap-tag {
    background: #f59e0b;
    color: #fff;
}

.cap-judge.cap-high-okay {
    background: #fefce8;
    border: 1px solid #fef08a;
    color: #854d0e;
}

.cap-judge.cap-high-okay .cap-tag {
    background: #eab308;
    color: #fff;
}

.cap-judge.cap-too-high {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
}

.cap-judge.cap-too-high .cap-tag {
    background: #ef4444;
    color: #fff;
}

.cap-judge.cap-neutral {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #4b5563;
}

.cap-judge.cap-neutral .cap-tag {
    background: #9ca3af;
    color: #fff;
}

/* 칼슘:인 비율 강조 텍스트 */
.cap-line {
    text-align: right;
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px !important;
    margin-top: 5px;
}

.cap-line .pill {
    background: #406CB4;
    color: #fff;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 12px;
    margin-left: 6px;
}


/* -------------------------------------------------------
   (E) 고급 보기 (Advanced View) & 배지
   ------------------------------------------------------- */
.nf-advanced {
    background: #f8faff;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e6eaf6;
}

/* 세그먼트 버튼 (As-Fed / DM / ME) */
.nf-seg {
    display: flex;
    background: #e6eaf6;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.nf-seg .seg {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.nf-seg .seg.on {
    background: #fff;
    color: #406CB4;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* 등급 배지 모음 */
.nf-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.badge.low {
    background: #f3f4f6;
    color: #374151;
}

.badge.mid {
    background: #dbeafe;
    color: #1e40af;
}

.badge.high {
    background: #fae8ff;
    color: #86198f;
}

/* 매크로 코멘트 */
.nf-macro-comment {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* 검증 배지 */
.badge-verified {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    background: #dcfce7;
    color: #166534;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 600;
}

/* 원재료 칩 */
.ing-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ing-chip {
    padding: 6px 12px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 13px;
    border-radius: 99px;
    border: 1px solid #e5e7eb;
}

/* 모바일 대응 */
@media (max-width: 480px) {
    .ns-card {
        padding: 16px;
    }

    .nf-title {
        font-size: 20px;
    }

    .donut {
        --size: 180px;
    }

    .donut-kcal {
        font-size: 26px;
    }
}

/* =========================================
   📝 케어일지 검색 결과 스타일 (search_hub용)
   ========================================= */

/* 리스트 컨테이너 */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

/* 결과 카드 (한 줄) */
.result-row {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: grid;
    grid-template-columns: 40px 1fr;
    /* 아이콘 | 내용 */
    column-gap: 14px;
    row-gap: 4px;
    align-items: start;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 108, 180, 0.1);
    border-color: #e2e8f0;
}

/* 아이콘 박스 */
.result-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

/* 타입별 색상 */
.result-icon.food {
    background: #10b981;
}

/* 초록 */
.result-icon.drug {
    background: #6366f1;
}

/* 보라 */
.result-icon.status {
    background: #f59e0b;
}

/* 주황 */

/* 텍스트 영역 */
.result-row .title {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.4;
}

.result-row .note {
    grid-column: 2 / -1;
    font-size: 14px;
    color: #555;
    margin-top: 4px;
    background: #f8fafc;
    padding: 8px 10px;
    border-radius: 8px;
    line-height: 1.5;
}

.result-row .meta {
    grid-column: 2 / -1;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* 뱃지 스타일 */
.result-row .badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    vertical-align: middle;
    letter-spacing: -0.5px;
}

.badge.food {
    background: #e7f8f1;
    color: #047857;
}

.badge.drug {
    background: #eef2ff;
    color: #4338ca;
}

.badge.status {
    background: #fffbeb;
    color: #b45309;
}


/* =========================================
   ⚡️ 퀵 필터 칩 (Quick Chips) 스타일
   ========================================= */
.quick-chip-area {
    display: flex;
    gap: 8px;
    margin: 12px 0 20px;
    overflow-x: auto;
    padding-bottom: 5px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    /* 스크롤바 숨김 */
}

.quick-chip-area::-webkit-scrollbar {
    display: none;
}

.quick-chip {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 펫 이름 칩 (파랑) */
.quick-chip.pet {
    background: #EEF4FF;
    color: #406CB4;
    border: 1px solid #DCE9FC;
}

.quick-chip.pet:hover {
    background: #406CB4;
    color: #fff;
}

/* 키워드 칩 (회색) */
.quick-chip.keyword {
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.quick-chip.keyword:hover {
    background: #f1f5f9;
    color: #333;
    border-color: #cbd5e1;
}

/* ==========================================================================
   케어다이어리 등록 버튼 및 모달
   ========================================================================== */

/* 등록 버튼 */
.btn-add-carediary {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-add-carediary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-add-carediary:active {
    transform: translateY(0);
}

.btn-add-carediary i {
    font-size: 18px;
}

/* 모달 오버레이 */
.cd-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    padding: 20px;
}

.cd-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 모달 박스 */
.cd-modal {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}

.cd-modal-overlay.show .cd-modal {
    transform: translateY(0) scale(1);
}

/* 모달 헤더 */
.cd-modal-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.cd-modal-icon {
    font-size: 28px;
}

.cd-modal-title {
    flex: 1;
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
}

.cd-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cd-modal-close:hover {
    background: #cbd5e1;
    color: #334155;
}

/* 모달 바디 */
.cd-modal-body {
    padding: 24px;
}

.cd-modal-food-info {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e2e8f0;
}

.cd-modal-food-name {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.4;
}

.cd-modal-food-kcal {
    font-size: 14px;
    color: #64748b;
    background: #f1f5f9;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
}

/* 인풋 그룹 */
.cd-input-group {
    margin-bottom: 16px;
}

.cd-input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.cd-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 4px;
    transition: all 0.2s;
}

.cd-input-wrapper:focus-within {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.cd-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    outline: none;
    width: 100%;
}

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

.cd-input-unit {
    padding: 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
}

/* 시간 표시 */
.cd-time-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #eff6ff;
    border-radius: 12px;
    font-size: 14px;
    color: #3b82f6;
    font-weight: 500;
}

.cd-time-display i {
    font-size: 16px;
}

/* 모달 푸터 */
.cd-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
}

.cd-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.cd-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.cd-btn-cancel:hover {
    background: #e2e8f0;
    color: #334155;
}

.cd-btn-confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.cd-btn-confirm:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.cd-btn-confirm:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 토스트 메시지 */
.cd-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cd-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 펫 선택 드롭다운 */
.cd-pet-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: all 0.2s;
}

.cd-pet-select:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}