/* 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;
    /* 폰트 및 커서 */
    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;
}

/* 검색 결과 카드 (리스트) */
.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-bottom: 20px;
    background: #fff;
}

.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 박스(배경/라디우스/테두리/그림자/마진/패딩)는 공통 .mq-section--banner가 관리 */

/* 더보기 버튼 */
#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;
}



/* 카테고리 바/칩(강제 !important 블록 제거): common.css 4-3b 참고 */

/* ==========================================================================
   4. 상세 화면 (Nutrition Facts) 디자인 복구 및 개선
   ========================================================================== */

/* 상세 컨테이너 애니메이션 */
#nutritionFactsContainer {
    animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 공통 카드 스타일 .ns-card — 박스 자체는 .mq-section--banner가 처리.
   여기서는 카드 내부 콘텐츠의 layout/typography만 관리. */

/* 카드 헤더 */
.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-amount {
    width: 80px !important;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    color: #406CB4;
    font-size: 16px;
}

.nf-unit-text {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

/* 요약 영양소 (큰 글씨) */
.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: 200px;
    --thickness: 22px;
    --c-prot: var(--macro-prot);
    /* 단백질 — 디자인시스템 파스텔 (핑크) */
    --c-carb: var(--macro-carb);
    /* 탄수화물 — 디자인시스템 파스텔 (연두) */
    --c-fat: var(--macro-fat);
    /* 지방 — 디자인시스템 파스텔 (노랑) */

    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: var(--macro-prot);
}

.dot.carb {
    background: var(--macro-carb);
}

.dot.fat {
    background: var(--macro-fat);
}


/* -------------------------------------------------------
   (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 정보 (이제 .val 안으로 들어옴) */
.dm-hint {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
    font-weight: 400;
}


/* -------------------------------------------------------
   (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);
}

/* 옥살산염 3단계 가이드 (제품·원재료) */
.oxalate-guide-panel {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.oxalate-guide-panel.oxalate-safe {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.oxalate-guide-panel.oxalate-mid {
  background: #fffbeb;
  border-color: #fde68a;
}

.oxalate-guide-panel.oxalate-high {
  background: #fef2f2;
  border-color: #fecaca;
}

.oxalate-guide-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.oxalate-guide-icon {
  font-size: 18px;
  line-height: 1.2;
  flex-shrink: 0;
}

.oxalate-guide-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.oxalate-grade-tag,
.oxalate-ing-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.oxalate-tag-safe,
.oxalate-tag-low {
  background: #dcfce7;
  color: #166534;
}

.oxalate-tag-mid {
  background: #fef3c7;
  color: #b45309;
}

.oxalate-tag-high {
  background: #fee2e2;
  color: #b91c1c;
}

.oxalate-guide-stats {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.oxalate-guide-msg {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: #334155;
}

.oxalate-guide-panel.oxalate-safe .oxalate-guide-msg { color: #166534; }
.oxalate-guide-panel.oxalate-mid .oxalate-guide-msg { color: #b45309; }
.oxalate-guide-panel.oxalate-high .oxalate-guide-msg { color: #b91c1c; }

.oxalate-guide-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
}

.oxalate-ing-tag {
  margin-left: 4px;
  font-size: 10px;
  padding: 2px 6px;
}

/* 결석 예측 — flutd_stone_profile.css 로 이전됨 */

/* 등급 배지 모음 */
.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;
}

/* =========================================
   [NEW] 원재료 자동 분석 시각화 스타일
   ========================================= */

.ing-analysis-container {
    margin-top: 0;
}

.ing-group-sec {
    margin-bottom: 20px;
}

/* 원재료 함량·아미노산 역산 — /css/ingredient_decompose.css */

/* 1그룹/2그룹/... 타이틀 — 사이즈 한 단계 낮춰 칩과의 위계만 확보 */
.ing-group-title {
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ing-group-title .count {
    font-size: 11px;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 99px;
    color: #64748b;
}

.ing-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 성분 칩 공통 — 12px 본문 사이즈로 정보 밀도 ↑ */
.ing-chip {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ing-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* 투명성 등급 컬러링 (Specificity Level) */
.ing-chip.lvl-a {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

/* 명확: 파랑 */
.ing-chip.lvl-b {
    background: #f0fdf4;
    color: #15803d;
    border-color: #dcfce7;
}

/* 보통: 녹색 */
.ing-chip.lvl-c {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

/* 불투명: 회색 */

/* 질병 경고 스타일 — 디자인시스템 SEMANTIC 파스텔(위험 #fda4af) 사용
   기존 #ef4444 (선명한 빨강) → 매크로 프로틴 토큰 패밀리(파스텔 핑크)로 톤 다운 */
.ing-chip.has-alert {
    border-color: var(--macro-prot) !important;
    background: var(--macro-prot-soft) !important;
    color: var(--macro-prot-ink) !important;
    box-shadow: 0 0 0 1px var(--macro-prot-soft);
}

.alert-icon {
    font-size: 12px;
    color: var(--macro-prot);
}

.alert-text {
    font-size: 10px;
    font-weight: 800;
    background: var(--macro-prot-soft);
    color: var(--macro-prot-ink);
    border: 1px solid var(--macro-prot);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 2px;
    line-height: 1.4;
}

/* 하단 팝업 (Bottom Sheet) */
.ing-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 30px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    z-index: 11000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ing-bottom-sheet.show {
    transform: translateY(0);
}

.ing-bs-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.ing-bs-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.ing-bs-handle {
    width: 40px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: -15px auto 20px;
}

.ing-bs-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #1e293b;
}

.ing-bs-sub {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
}

.ing-bs-desc {
    font-size: 15px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
}

.ing-bs-info {
    display: flex;
    gap: 20px;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
}

.ing-bs-item {
    flex: 1;
}

.ing-bs-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ing-bs-val {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

/* =========================
   [NEW] 제품 비교 시스템 스타일
   ========================= */

/* 하단 비교 바 */
.compare-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: calc(100% - 40px);
    max-width: 720px;
    background: rgba(15, 23, 42, 0.95);
    /* 더 진하게 */
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 14px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.compare-bar.show {
    transform: translateX(-50%) translateY(0);
}

.compare-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-items {
    display: flex;
    gap: 10px;
}

.compare-item {
    background: #406CB4;
    color: #fff;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-item-name {
    max-width: 120px;
    overflow: hidden;
    text-wrap: nowrap;
    text-overflow: ellipsis;
}

.compare-item-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}

.compare-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compare-bar .btn {
    min-width: auto !important;
    white-space: nowrap !important;
    padding: 8px 16px !important;
    height: 38px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

.compare-bar .btn-link {
    padding-left: 8px !important;
    padding-right: 8px !important;
    color: #94a3b8 !important;
}

.compare-bar .btn-link:hover {
    color: #fff !important;
}



@media (max-width: 480px) {
    .compare-bar {
        padding: 12px;
        width: calc(100% - 30px);
        bottom: 15px;
    }

    .compare-bar-content {
        flex-direction: column;
        gap: 10px;
    }

    .compare-items {
        width: 100%;
        gap: 6px;
    }

    .compare-item {
        flex: 1;
        padding: 6px 10px;
        font-size: 11px;
        min-width: 0;
    }

    .compare-item-name {
        max-width: none;
        flex: 1;
    }

    .compare-actions {
        width: 100%;
        gap: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 10px;
        justify-content: center;
    }

    .compare-actions .btn {
        width: 100%;
        padding: 10px !important;
        font-size: 13px !important;
        height: 40px !important;
    }

    .compare-hint {
        display: none;
    }
}


.compare-hint {
    font-size: 12px;
    color: #94a3b8;
}

/* 비교 바 표시 시 하단 액션바(비교 담기 / 케어다이어리)와 겹침 방지 */
body.compare-bar-active .ns-actionbar {
    margin-bottom: 100px;
}

@media (max-width: 600px) {
    body.compare-bar-active .ns-actionbar {
        margin-bottom: 0;
    }

    body.compare-bar-active .compare-bar {
        /* 스티키 액션바(~70px) 바로 위 */
        bottom: calc(70px + env(safe-area-inset-bottom, 0px) + 12px);
        width: calc(100% - 24px);
    }
}

/* 비교 모달 */
.compare-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.compare-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.compare-modal {
    width: 95%;
    max-width: 900px;
    height: 90vh;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.compare-modal-header {
    padding: 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-modal-title {
    font-size: 18px;
    font-weight: 800;
}

.compare-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333 !important;
    min-width: auto !important;
    padding: 0 !important;
}

.compare-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

/* 비교 그리드 */
.compare-grid {
    display: grid;
    grid-template-columns: 140px 1fr 1fr;
    gap: 1px;
    background: #f1f5f9;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    overflow: hidden;
}

@media (max-width: 600px) {
    .compare-grid {
        grid-template-columns: 90px 1fr 1fr;
    }

    .compare-modal-body {
        padding: 15px;
    }

    .compare-grid>div {
        padding: 10px 8px;
    }

    .comp-name {
        font-size: 13px;
    }

    .comp-row-label {
        font-size: 11px;
    }

    .comp-row-val {
        font-size: 13px;
    }
}


.compare-grid>div {
    background: #fff;
    padding: 16px;
}

.compare-col-item {
    text-align: center;
}

.comp-name {
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 4px;
}

.comp-brand {
    font-size: 12px;
    color: #94a3b8;
}

.comp-row-label {
    font-weight: 700;
    color: #64748b;
    font-size: 13px;
    background: #f8fafc !important;
}

.comp-row-val {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.comp-row-val.higher {
    color: #406CB4;
    background: #f0f7ff !important;
    font-weight: 800;
}

.comp-row-val small {
    font-weight: normal;
    color: #94a3b8;
    font-size: 11px;
}

/* 원재료 비교 박스 */
.compare-ing-box {
    margin-top: 20px;
}

.ing-diff-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ing-common-list,
.ing-unique-list {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
}


/* ==========================================================================
   5. 2026 PRODUCT DETAIL RESKIN — 미니멀 상세
   ── 컨테이너는 common.css의 .mq-section / .mq-section--banner를 사용
   ── 본 섹션은 페이지 전용 인터널(콘텐츠 레이아웃/타이포)만 담당
   ── 매크로 색은 토큰(--macro-*) 사용 → 디자인시스템 SEMANTIC 파스텔 일관
   ── 무채색 액센트(블랙/슬레이트 진톤) 사용 금지 → primary blue 또는 파스텔
   ========================================================================== */

/* 5-0. 컨테이너 사이 간격 */
#nutritionFactsContainer {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#nutritionFactsContainer > .ns-hero,
#nutritionFactsContainer > .ns-serving,
#nutritionFactsContainer > .ns-kpis,
#nutritionFactsContainer > .ns-card,
#nutritionFactsContainer > .ns-ingredients-wrap,
#nutritionFactsContainer > .ns-actionbar {
    margin-bottom: 0;
}

/* 5-3b. 원재료 분석 — KPI→브랜드와 동일: groove(8px) + edge-to-edge 본문 */
.ns-ingredients-wrap {
    display: flex;
    flex-direction: column;
}

.ns-ingredients-wrap > .ns-ingredients-section {
    border-top: 0;
}

.ns-ingredients-section__inner {
    padding: 16px;
}

@media (min-width: 992px) {
    .ns-ingredients-section__inner {
        padding: 0;
    }
}

#nutritionFactsContainer .ns-ingredients-section .ns-head {
    align-items: center;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 14px;
}

#nutritionFactsContainer .ns-ingredients-section .ns-title {
    font-size: 16px;
    font-weight: var(--font-weight-emphasis, 600);
    line-height: 1.4;
    color: #1e293b;
    letter-spacing: -0.01em;
}

@media (min-width: 992px) {
    #nutritionFactsContainer .ns-ingredients-section .ns-title {
        font-size: 18px;
    }
}

#nutritionFactsContainer .ns-ingredients-section .ing-analysis-container {
    margin-top: 0;
}

/* FLUTD 프로필 아래 원재료·역산 구간 */
.ing-analysis-container > .flutd-profile + .ing-decompose-stack,
.ing-analysis-container > .flutd-profile + .ing-group-sec {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.ns-ingredients-section .ing-decompose-stack {
    margin-bottom: 0;
}

/* 5-1. HERO — 이미지(좌) + 정보(우). 컨테이너는 .mq-section (edge-to-edge)
   ── 모바일은 컨테이너가 좌우 여백 0이므로 내부 16px 패딩으로 콘텐츠 거터 확보
   ── PC(≥992px)에서는 .mq-section이 padding:24px를 자동 적용 */
.ns-hero {
    padding: 16px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: center;
}

.ns-hero__media {
    width: 240px;
    height: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ns-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ns-hero__body {
    min-width: 0;
}

.ns-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.ns-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

.ns-tag--verified {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.ns-tag--buy {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.ns-tag--buy:hover {
    filter: brightness(0.97);
}

.ns-affiliate-note {
    font-size: 11px;
    color: #64748b;
    line-height: 1.55;
    margin: 16px 0 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.ns-tag--neutral {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid #c7d8f1;
}

.ns-hero__title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 6px;
}

.ns-hero__title-row .ns-hero__title {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.ns-hero__title {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
    word-break: keep-all;
}

.ns-fav-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-top: 2px;
    padding: 0;
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ns-fav-btn:hover {
    color: #94a3b8;
}

.ns-fav-btn.ns-fav-btn--on,
.ns-fav-btn.mq-fav-btn--on {
    color: #f59e0b;
}

.ns-fav-btn.ns-fav-btn--on:hover,
.ns-fav-btn.mq-fav-btn--on:hover {
    color: #d97706;
}

.ns-hero__cat {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 14px;
    line-height: 1.5;
}

.ns-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    font-size: 12px;
    color: #94a3b8;
}

.ns-hero__byline {
    color: #64748b;
    font-weight: 500;
}

.ns-hero__source,
.ns-hero__edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
}

.ns-hero__source:hover,
.ns-hero__edit:hover {
    text-decoration: underline;
}

.ns-hero__source i,
.ns-hero__edit i {
    font-size: 11px;
}

/* 5-2. SERVING — 스텝퍼 + 퀵칩. 컨테이너는 .mq-section (edge-to-edge)
   레이아웃 원칙
    • 라벨/스텝퍼는 줄어들지 않음 (제공량 글자가 세로로 깨지는 현상 방지)
    • 퀵 칩 영역이 남은 공간을 차지(flex:1) → 좁아지면 다음 줄로 자연스럽게 wrap
    • 모바일 edge-to-edge라 내부 16px 패딩으로 거터 확보 (PC는 mq-section이 처리) */
.ns-serving {
    padding: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
}

.ns-serving__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ns-serving__label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    /* 한글 라벨이 글자 단위로 wrap되는 현상 방지 */
    flex-shrink: 0;
}

.ns-stepper {
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 2px;
    height: 40px;
    flex-shrink: 0;
    /* 스텝퍼도 줄어들지 않게 — 라벨이 강제로 압축되는 것을 막음 */
}

.ns-stepper__btn {
    width: 32px;
    height: 36px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}

.ns-stepper__btn:hover {
    background: #fff;
    color: var(--primary);
}

.ns-stepper__btn:active {
    background: #e2e8f0;
}

/* common.css 1267줄의 글로벌 input[type="number"] (specificity 0,1,1)
   규칙을 이기기 위해 .ns-stepper input.ns-stepper__input (0,2,1) 사용.
   글로벌이 100% width / 46px height / 12px padding-left를 강제하기 때문에
   여기서 명시적으로 모두 리셋해야 stepper가 컨텐츠 폭으로 유지됨. */
.ns-stepper input.ns-stepper__input {
    width: 56px;
    min-width: 0;
    flex: 0 0 56px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    outline: none;
    font-family: inherit;
    -moz-appearance: textfield;
    box-sizing: border-box;
}

.ns-stepper input.ns-stepper__input::-webkit-outer-spin-button,
.ns-stepper input.ns-stepper__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ns-stepper__unit {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    padding-right: 8px;
}

.ns-serving__quick {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1 1 200px;
    /* 남는 가로 공간을 차지. 200px 이하로 좁아지면 자동 줄바꿈 */
    min-width: 0;
}

.ns-quick {
    flex: 1 1 auto;
    /* 같은 줄 안에서 칩들이 공간을 균등 분할 → 빈 자리를 효율적으로 활용 */
    min-width: 0;
    text-align: center;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ns-quick:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.ns-quick.is-on {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

/* 5-3. KPI 그리드 — 6칸 균등 (칼로리 + 단·지·탄·수·회). 컨테이너 .mq-section
   ── 디자인 원칙: KPI 행은 종류별 컬러 사용하지 않음 (무채색 미니멀)
      매크로 컬러 토큰(--macro-*)은 도넛/차트에서만 사용해 시각적 노이즈 최소화
   ── 칼로리 한 칸만 primary 톤으로 강조 (블랙 사용 금지) — 폭은 다른 셀과 동일
   ── 6칸이 정확히 떨어지도록 PC 6×1, 모바일 3×2 그리드 (빈 셀 없음)
   ※ 모바일은 edge-to-edge라 라디우스 없음. PC에서만 라디우스 적용. */
.ns-kpis {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    background: #e2e8f0;
    overflow: hidden;
    padding: 0 !important;
    /* mq-section 기본 padding 무효화 (셀 자체가 풀폭) */
}

.ns-kpi {
    background: #fff;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ns-kpi__label {
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ns-kpi__value {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.ns-kpi__value small {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    margin-left: 2px;
}

/* 칼로리 액센트 — primary 톤만 유지(폰트 크기는 다른 셀과 동일)
   다른 KPI와 같은 폭(1fr)에 맞추기 위해 색만 강조하고 사이즈는 통일 */
.ns-kpi--accent {
    background: var(--primary-soft);
}

.ns-kpi--accent .ns-kpi__label {
    color: var(--primary);
}

.ns-kpi--accent .ns-kpi__value {
    color: var(--primary);
}

.ns-kpi--accent .ns-kpi__value small {
    color: var(--primary);
    opacity: 0.7;
}

/* 5-4. CARD HEAD 보강 (기존 .ns-card / .ns-head / .ns-title 사용)
   컨테이너 자체는 .mq-section--banner가 padding/border/radius 처리 */
#nutritionFactsContainer .ns-card {
    box-shadow: none;
    transition: none;
}

#nutritionFactsContainer .ns-head {
    align-items: center;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 14px;
}

#nutritionFactsContainer .ns-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.01em;
}

#nutritionFactsContainer .ns-sub {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
}

/* 제품 상세 — 기호성 평가 */
#nutritionFactsContainer .ns-palate .ns-body {
    padding-top: 2px;
}

#nutritionFactsContainer .ns-palate .drawer-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
}

#nutritionFactsContainer .ns-palate-pet {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md, 10px);
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 12px;
    background: #fff;
}

.ns-palate-hint {
    margin: 0 0 10px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.ns-palate-hint a {
    color: var(--primary);
    font-weight: 600;
}

.ns-palate-login {
    margin-top: 10px;
    display: inline-flex;
}

.ns-palate-loading {
    margin: 0;
    font-size: 13px;
}

.ns-palate-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ns-palate-btn {
    flex: 1;
    min-width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md, 10px);
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.ns-palate-btn:hover {
    border-color: var(--primary);
    background: rgba(64, 108, 180, 0.06);
}

.ns-palate-btn.is-active {
    border-color: var(--primary);
    background: var(--primary-soft, rgba(64, 108, 180, 0.12));
    box-shadow: 0 2px 8px rgba(64, 108, 180, 0.15);
    color: #1e293b;
}

.ns-palate-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.ns-palate-emoji {
    font-size: 1.35rem;
    line-height: 1;
}

.ns-palate-btn .lbl {
    font-size: 11px;
    font-weight: 700;
}

.ns-palate-foot {
    margin: 12px 0 0;
    font-size: 12px;
}

.ns-palate-foot a {
    color: var(--primary);
    font-weight: 600;
}

/* 5-5. DETAIL TABLES — PC 2열 그리드 */
.ns-tables {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.ns-tables__heading {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 8px;
}

#nutritionFactsContainer .nf-table td {
    padding: 11px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

#nutritionFactsContainer .nf-table .label {
    color: #64748b;
    font-weight: 500;
}

#nutritionFactsContainer .nf-table .val {
    color: #1e293b;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#nutritionFactsContainer .ns-split {
    height: 1px;
    background: #f1f5f9;
    margin: 16px 0;
}

/* 5-6. ACTION BAR — 모바일 스티키, PC 인라인. primary는 디자인시스템 색 */
.ns-actionbar {
    display: flex;
    gap: 10px;
    background: transparent;
    padding: 0;
}

.ns-actionbar__btn {
    flex: 1;
    height: 50px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.ns-actionbar__btn--ghost {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.ns-actionbar__btn--ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.ns-actionbar__btn--primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(64, 108, 180, 0.18);
}

.ns-actionbar__btn--primary:hover {
    background: #355a96;
    border-color: #355a96;
    box-shadow: 0 8px 20px rgba(64, 108, 180, 0.24);
}

/* 5-7. 도넛 + 범례 PC 가로 정렬 */
.ns-macro-card .donut-wrap {
    padding: 8px 0 4px;
}

.ns-macro-card .donut {
    --size: 180px;
    --thickness: 18px;
    box-shadow: none;
}

.ns-macro-card .legend {
    margin-top: 12px;
    gap: 18px;
}

/* ==========================================================================
   5-R. 반응형: 모바일 가독성 우선 / PC 정보 밀도
   ========================================================================== */
@media (min-width: 992px) {

    /* PC에서만 KPI 박스 라디우스 (edge-to-edge가 아니므로) */
    .ns-kpis {
        border-radius: var(--radius-lg);
    }

    .ns-tables {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }

    .ns-macro-card__row {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 28px;
        align-items: center;
    }

    .ns-macro-card .legend {
        justify-content: flex-start;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-top: 0;
    }
}

@media (max-width: 991.98px) {
    .ns-hero {
        grid-template-columns: 140px 1fr;
        gap: 16px;
    }

    .ns-hero__media {
        width: 140px;
        height: 140px;
    }

    .ns-hero__title {
        font-size: 19px;
    }

    .ns-hero__cat {
        margin-bottom: 10px;
    }

    .ns-kpis {
        /* 모바일 3×2 그리드 — 6칸이 빈 셀 없이 정확히 떨어짐
           edge-to-edge 모바일이므로 radius 제거 */
        grid-template-columns: repeat(3, 1fr);
    }

    .ns-kpi__value {
        font-size: 18px;
    }

    .ns-kpi--accent .ns-kpi__value {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    .ns-hero {
        grid-template-columns: 120px 1fr;
        gap: 14px;
    }

    .ns-hero__media {
        width: 120px;
        height: 120px;
    }

    .ns-hero__title {
        font-size: 17px;
        line-height: 1.35;
    }

    /* .ns-serving 모바일 레이아웃은 베이스 스타일에서 자동으로 처리됨
        - 라벨/스텝퍼는 줄어들지 않고
        - 퀵 칩은 남은 공간 차지 또는 자동 줄바꿈 */

    /* 모바일 스티키 액션바 — 한 손으로 즉시 액션 */
    .ns-actionbar {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        margin: 4px -16px 0;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.05);
        z-index: 5;
    }

    .ns-kpi {
        padding: 12px 14px;
    }

    .ns-kpi__label {
        font-size: 10px;
    }
}

/* 작은 폰: 매우 좁은 화면에서 hero 1열 */
@media (max-width: 360px) {
    .ns-hero {
        grid-template-columns: 1fr;
    }

    .ns-hero__media {
        width: 100%;
        height: 220px;
    }
}

/* ==========================================================================
   6. BRAND PANEL — 제품 상세 브랜드 요약
   ========================================================================== */
#nutritionFactsContainer > .ns-brand {
    margin-top: 0;
}

.ns-brand__loading,
.ns-brand__empty {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 4px 0 0;
}

.ns-brand__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.ns-brand__logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.ns-brand__logo--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 800;
    font-size: 18px;
}

.ns-brand__identity {
    flex: 1;
    min-width: 0;
}

.ns-brand__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ns-brand__title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ns-brand__sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 500;
}

.ns-brand__explore {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary, #406CB4);
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
}

.ns-brand__explore:hover {
    background: #dbeafe;
}

.ns-brand__highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.ns-brand__fact {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 10px 10px 9px;
    min-width: 0;
}

.ns-brand__fact-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ns-brand__fact-value {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    word-break: keep-all;
}

.ns-brand__since {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary, #406CB4);
}

.ns-brand__since-suffix {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-left: 1px;
}

.ns-brand__country {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ns-brand__countries {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 2px;
}

.ns-brand__country--compact {
    font-size: 12px;
}

.ns-brand__country--compact span:last-child {
    white-space: nowrap;
}

.ns-brand__country-sep {
    color: #cbd5e1;
    font-weight: 700;
    padding: 0 1px;
}

.ns-brand__fact--mfg .ns-brand__fact-value {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.ns-brand__fact-note {
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1.35;
}

.ns-brand__flag {
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.ns-brand__flag-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 14px;
    padding: 0 3px;
    border-radius: 2px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 8px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.03em;
    line-height: 1;
    flex-shrink: 0;
}

.ns-brand__muted {
    color: #94a3b8;
    font-weight: 600;
}

.ns-brand__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.ns-brand__chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.ns-brand__chip--kr {
    background: #ecfdf5;
    color: #059669;
    border-color: #d1fae5;
}

.ns-brand__chip--recall {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fee2e2;
}

.ns-brand__alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 10px;
}

.ns-brand__alert--recall {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
}

.ns-brand__alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.ns-brand__more {
    border-top: 1px dashed #e2e8f0;
    padding-top: 10px;
}

.ns-brand__more-summary {
    list-style: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    padding: 6px 0;
    user-select: none;
}

.ns-brand__more-summary::-webkit-details-marker {
    display: none;
}

.ns-brand__more-summary::after {
    content: ' ▾';
    color: #94a3b8;
    font-weight: 600;
}

.ns-brand__more[open] .ns-brand__more-summary::after {
    content: ' ▴';
}

.ns-brand__more-body {
    padding: 4px 0 2px;
}

.ns-brand__rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 12px;
}

.ns-brand__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed #eef2f7;
    font-size: 13px;
}

.ns-brand__row:last-child {
    border-bottom: none;
}

.ns-brand__row-label {
    flex-shrink: 0;
    width: 72px;
    color: #64748b;
    font-weight: 600;
}

.ns-brand__row-value {
    flex: 1;
    text-align: right;
    color: #334155;
    font-weight: 500;
    line-height: 1.45;
    word-break: keep-all;
}

.ns-brand__website {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid var(--primary, #406CB4);
    color: var(--primary, #406CB4);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
}

.ns-brand__website:hover {
    background: var(--primary, #406CB4);
    color: #fff;
}

.ns-brand__link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary, #406CB4);
    text-decoration: none;
}

.ns-brand__link:hover {
    text-decoration: underline;
}

.ns-brand__recalls-title {
    font-size: 13px;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 8px;
}

.ns-brand__recall-item {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.ns-brand__recall-date {
    font-size: 12px;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 4px;
}

.ns-brand__recall-reason {
    font-size: 13px;
    color: #7f1d1d;
    line-height: 1.45;
}

@media (max-width: 420px) {
    .ns-brand__highlights {
        grid-template-columns: 1fr;
    }

    .ns-brand__fact {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
    }

    .ns-brand__fact-label {
        margin-bottom: 0;
    }
}

/* 글로벌 DB 안내 (제품 상세 — rumy/user) */
.ns-global-db-disclaimer {
    margin: 0 0 16px;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--text-muted, #64748b);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

/* 실측 열량 밸런스업 안내 */
.ns-balance-up-notice {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #c7d2fe;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
}

.ns-balance-up-notice__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #4338ca;
    font-size: 13px;
}

.ns-balance-up-notice__head .fa-flask {
    opacity: 0.9;
}

.ns-balance-up-notice__info {
    margin-left: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #a5b4fc;
    background: #fff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    line-height: 1;
    padding: 0;
}

.ns-balance-up-notice__body {
    margin: 0;
    font-size: 13px;
    color: #334155;
    line-height: 1.55;
}

.ns-balance-up-notice__meta {
    margin: 8px 0 0;
    font-size: 11px;
    color: #6366f1;
    font-variant-numeric: tabular-nums;
}

.ns-balance-up-notice__cv {
    margin: 6px 0 0;
    font-size: 11px;
    color: #4338ca;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ns-engine-hint {
    margin-top: 4px;
    font-size: 11px;
    color: #4f46e5;
    font-weight: 600;
}

.nf-badges .badge.info.ns-badge-balance-up {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

/* 프리미엄 Paywall (상품 상세) */
.ing-decompose-body--preview {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}

.ing-decompose-body--preview .ing-decompose-chart-col {
    align-items: center;
}

.flutd-profile--locked-tail {
    margin-top: 0;
}

/* 제품상세 FREE: 단일 잠금 카드 (overlay 없음) */
.cfl-paywall-lock-wrap--flutd,
.cfl-paywall-lock-wrap--ingredients {
    margin: 12px 0 16px;
}

.cfl-paywall-lock-wrap .cfl-paywall-lock--ns-detail {
    width: 100%;
    margin: 0 auto;
    padding: 28px 20px 24px;
    min-height: 200px;
    box-sizing: border-box;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
    box-shadow: 0 8px 24px rgba(64, 108, 180, 0.1);
    border-style: solid;
}

.cfl-paywall-lock-wrap .cfl-paywall-lock--ns-detail .cfl-paywall-lock__p {
    width: 44px;
    height: 44px;
    font-size: 16px;
    margin-bottom: 12px;
}

.cfl-paywall-lock-wrap .cfl-paywall-lock--ns-detail .cfl-paywall-lock__title {
    font-size: 17px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.cfl-paywall-lock-wrap .cfl-paywall-lock--ns-detail .cfl-paywall-lock__cost {
    font-size: 12px;
    padding: 3px 10px;
}

.cfl-paywall-lock-wrap .cfl-paywall-lock--ns-detail .cfl-paywall-lock__lead {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    line-height: 1.5;
}

.cfl-paywall-lock-wrap .cfl-paywall-lock--ns-detail .cfl-paywall-lock__note {
    margin: 0 0 20px;
    font-size: 14px;
    font-weight: 800;
    color: var(--primary, #406cb4);
    line-height: 1.45;
}

.cfl-paywall-lock-wrap .cfl-paywall-lock--ns-detail .cfl-paywall-lock__actions--row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: stretch;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.cfl-paywall-lock-wrap .cfl-paywall-lock--ns-detail .cfl-paywall-lock__actions--row .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 10px;
    font-size: 14px;
}

.cfl-paywall-lock-wrap .cfl-paywall-lock--ns-detail .cfl-paywall-lock__actions--row .btn-outline {
    background: #fff;
}

.cfl-paywall-teaser--balance-up {
    margin: 0 0 12px;
}

/* ==========================================================================
   ★ 제품 제형 정보 (.ns-texture)
      주식캔/간식캔에서만 노출. 트랙 A(국물 상태) + 트랙 B(건더기 형태)
   ========================================================================== */
.ns-texture .ns-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.ns-texture .ns-sub {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.ns-texture__tracks {
    display: grid;
    grid-template-columns: 1fr 12px 1fr;
    gap: 14px 0;
    align-items: stretch;
    margin-top: 4px;
}

.ns-texture__cross {
    align-self: center;
    color: #cbd5e1;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    line-height: 1;
}

.ns-texture__col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ns-texture__heading {
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
}

.ns-texture__heading--a {
    background: #E0F2FE;
    color: #0284C7;
}

.ns-texture__heading--b {
    background: #FFEDD5;
    color: #C2410C;
}

.ns-texture__heading-hint {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-left: 4px;
}

.ns-texture__card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.ns-texture__card.is-on {
    border-color: #6366F1;
    background: #F5F3FF;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.ns-texture__card.is-on::before {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6366F1 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / 14px 14px;
}

/* 파테/무스 단독: Track B 카드 dim + 슬래시 오버레이 */
.ns-texture__card.is-disabled {
    opacity: 0.45;
    background: #f8fafc;
    border-style: dashed;
    border-color: #cbd5e1;
    filter: grayscale(0.4);
}

.ns-texture__card.is-disabled .ns-texture__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(148, 163, 184, 0.18);
    border-radius: inherit;
}

.ns-texture__col--disabled .ns-texture__heading--b.is-disabled {
    background: #F1F5F9;
    color: #94A3B8;
}

.ns-texture__heading-disabled {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    border: 1px dashed #cbd5e1;
}

.ns-texture__heading-disabled i {
    font-size: 10px;
}

.ns-texture__cross-mute {
    color: #cbd5e1;
    font-weight: 500;
}

.ns-texture__media {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #F8FAFC;
    border: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ns-texture__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ns-texture__body {
    flex: 1;
    min-width: 0;
}

.ns-texture__title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.ns-texture__name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.ns-texture__tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.ns-texture__card.is-on .ns-texture__tag {
    background: #EEF2FF;
    color: #4338CA;
}

.ns-texture__desc {
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
    margin: 0 0 4px;
}

.ns-texture__for {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.ns-texture__combo {
    margin-top: 14px;
    padding: 14px 14px 12px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 14px;
    display: flex;
    align-items: stretch;
    gap: 12px;
    overflow: hidden;
    position: relative;
}

/* 파테 단독: 톤 다운 배경 (라일락) */
.ns-texture__combo--pate {
    background: #F5F3FF;
    border-color: #DDD6FE;
}

.ns-texture__combo-main {
    flex: 1;
    min-width: 0;
}

.ns-texture__combo-title {
    font-size: 13px;
    font-weight: 800;
    color: #92400E;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ns-texture__combo--pate .ns-texture__combo-title {
    color: #5B21B6;
}

.ns-texture__combo-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ns-texture__pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #fff;
    border: 1px solid #FDE68A;
    color: #78350F;
    line-height: 1.2;
}

.ns-texture__pill small {
    font-size: 10px;
    font-weight: 500;
    color: #92400E;
    margin-left: 2px;
}

.ns-texture__combo--pate .ns-texture__pill {
    border-color: #DDD6FE;
    color: #4338CA;
}

.ns-texture__combo--pate .ns-texture__pill small {
    color: #6D28D9;
}

.ns-texture__pill--none {
    background: #fff;
    border-style: dashed;
    color: #64748b !important;
    font-weight: 600;
}

.ns-texture__pill--none small {
    color: #94a3b8 !important;
}

.ns-texture__times {
    color: #FBBF24;
    font-weight: 700;
    font-size: 14px;
}

.ns-texture__combo-caption {
    font-size: 13px;
    line-height: 1.45;
    color: #78350F;
    margin: 0 0 4px;
    font-weight: 700;
}

.ns-texture__combo--pate .ns-texture__combo-caption {
    color: #5B21B6;
}

.ns-texture__combo-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #78350F;
    margin: 0;
}

.ns-texture__combo--pate .ns-texture__combo-desc {
    color: #6D28D9;
}

/* 고양이 일러스트 — 우측 하단 정렬, 모바일에서는 아래로 떨어지지 않게 작게 */
.ns-texture__combo-cat {
    flex: 0 0 auto;
    width: 80px;
    align-self: flex-end;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: -8px -6px -10px 0;
}

.ns-texture__combo-cat img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 480px) {
    .ns-texture__combo-cat {
        width: 64px;
    }
}

.ns-texture__guide {
    margin-top: 12px;
    padding: 12px 14px;
    background: #F8FAFC;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.ns-texture__guide-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ns-texture__guide-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ns-texture__guide-item {
    font-size: 11px;
    line-height: 1.45;
    color: #475569;
    padding: 6px 8px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ns-texture__guide-item b {
    display: block;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 2px;
}

.ns-texture__footnote {
    margin: 10px 0 0;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.45;
}

@media (max-width: 600px) {
    .ns-texture__tracks {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ns-texture__cross {
        display: none;
    }

    .ns-texture__guide-list {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   제품 상세 — 탭 (기본정보/성분/결석/원재료)
   ========================================= */
.ns-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    gap: 4px;
    align-items: stretch;
    padding: 6px 4px 0;
    margin: 0 0 14px;
    background: #ffffff;
    border-bottom: 1px solid #eef0f3;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ns-tabs::-webkit-scrollbar {
    display: none;
}

.ns-tab {
    flex: 0 0 auto;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 11px 14px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2.5px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

.ns-tab:hover {
    color: #0f172a;
}

.ns-tab.is-active {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
}

.ns-tab--soon {
    color: #cbd5e1;
    cursor: default;
}

.ns-tab--soon:hover {
    color: #cbd5e1;
}

.ns-tab__soon {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
}

.ns-tabpanel {
    display: none;
}

.ns-tabpanel.is-active {
    display: block;
    animation: nsTabFade .18s ease;
}

@keyframes nsTabFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 600px) {
    .ns-tab {
        padding: 10px 11px 11px;
        font-size: 13.5px;
    }
}
