/* 성분 페이지 배치(v1): 10개국 판정 칩 · 규제 표 묶음 · 따라 내려오는 목차/탭 · 같이 보면 좋은 성분 · 유통사·기업 기준 한 줄 · 터치 영역
   공통 테마(theme.v2.css)는 건드리지 않고 이 페이지에서만 덧씌운다 */
.ingredient-main{--ing-sticky:0px}
.ingredient-main>section[id],.ingredient-main>.ingredient-card[id],.country-regulation-table tr[id]{scroll-margin-top:16px}

/* ── 10개국 판정 칩 */
.reg-strip{margin:16px 0 4px}
.reg-strip ol{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.reg-chip{display:flex;flex-direction:column;gap:1px;min-height:44px;height:100%;box-sizing:border-box;padding:7px 10px 8px;border:1px solid #e3e3df;border-left-width:3px;border-radius:8px;background:#fff;text-decoration:none!important;color:#2e323a;line-height:1.35}
.reg-chip:hover{border-color:#b9b2e3;background:#faf9fd}
.reg-chip:focus-visible{outline:2px solid #5b4cc4;outline-offset:2px}
.reg-chip b{font-size:12px;font-weight:600;color:#55595f;letter-spacing:0}
.reg-chip-v{font-size:14px;font-weight:700;display:flex;align-items:baseline;gap:4px}
.reg-chip-v i{font-style:normal;font-size:12px;width:12px;text-align:center;flex:0 0 12px}
.reg-chip small{font-size:12px;color:#5f636b;font-weight:500;overflow-wrap:anywhere}
.reg-chip.is-prohibit{border-left-color:#b3203d;background:#fbe9ec}.reg-chip.is-prohibit .reg-chip-v{color:#9b1530}
.reg-chip.is-limit{border-left-color:#d1495b;background:#fdf1f2}.reg-chip.is-limit .reg-chip-v{color:#b02a3e}
.reg-chip.is-functional{border-left-color:#7a55c4;background:#f5f1fd}.reg-chip.is-functional .reg-chip-v{color:#5d3c9c}
.reg-chip.is-allow{border-left-color:#2f8a5c;background:#f0f8f3}.reg-chip.is-allow .reg-chip-v{color:#1d6b43}
.reg-chip.is-unlisted .reg-chip-v{color:#4e5560}.reg-chip.is-unlisted{border-left-color:#9aa0a8}
.reg-chip.is-clear{border-left-color:#8cc5a4;background:#f7fbf8}.reg-chip.is-clear .reg-chip-v{color:#2a6e48}
.reg-chip.is-review .reg-chip-v{color:#666a72;font-weight:600}.reg-chip.is-review{border-left-color:#d6d6d1}
.reg-strip-foot{margin:8px 0 0;font-size:13px;color:#61656d}

/* 표 행으로 이동했을 때 잠깐 표시 */
.country-regulation-table tr:target>*{background:#f5f2fe}

/* ── 국가별 규제 표 묶음 */
.reg-group{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;margin:22px 0 6px;font-size:15px;font-weight:700;color:#16181d}
.country-regulations h2+.reg-group{margin-top:8px}
.reg-group span{font-size:13px;font-weight:600;color:#5b4cc4}
.reg-group small{font-size:12.5px;font-weight:400;color:#61656d}
.reg-group.is-regulated::before,.reg-group.is-confirmed::before{content:"";width:8px;height:8px;border-radius:50%;align-self:center;background:#c98a26}
.reg-group.is-confirmed::before{background:#2f8a5c}
.reg-group.is-review::before,.reg-group.is-notlisted::before{content:"";width:8px;height:8px;border-radius:50%;align-self:center;background:#9aa0a8}
.reg-group.is-review::before{background:#b9a7de}
.reg-none{margin:8px 0 0;color:#2e323a}
.country-regulations .ingredient-status.allow{background:#e2f4e9;color:#1d6b43}
.ingredient-status.clear{background:#eef7f1;color:#2a6e48}

/* ── 실행 버튼 줄 */
.ingredient-actions{align-items:center}
.ingredient-actions .primary{min-height:43px}
body.v2 .ingredient-actions .primary{background:#5b4cc4;color:#fff;border-color:#5b4cc4;box-shadow:none}
body.v2 .ingredient-actions .primary:hover{background:#4c3eb0}
.ingredient-actions .ingredient-fix-link{margin-left:6px;min-height:44px;padding:0 4px;font-size:13px;color:#61656d;text-decoration:underline;text-underline-offset:3px}

/* ── 이 페이지 탭(휴대폰·태블릿: 위에 붙음) */
.ing-tabs{display:none}
@media (max-width:800px){
  .ingredient-main>section[id],.ingredient-main>.ingredient-card[id],.country-regulation-table tr[id]{scroll-margin-top:64px}
  .ing-tabs{display:block;position:sticky;top:0;z-index:30;margin:0 -18px 14px;padding:0 18px;background:var(--paper,#f7f7f5);border-bottom:1px solid #e3e3df}
  .ing-tabs-in{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;mask-image:linear-gradient(90deg,#000 88%,transparent);-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);padding-right:28px}
  .ing-tabs-in::-webkit-scrollbar{display:none}
  body.v2 .ing-tabs a,.ing-tabs a{flex:0 0 auto;display:inline-flex;align-items:center;min-height:44px;padding:0 10px;font-size:14px;font-weight:500;color:#55595f;text-decoration:none;border-bottom:2px solid transparent;white-space:nowrap}
  body.v2 .ing-tabs a[aria-current="true"],.ing-tabs a[aria-current="true"]{color:#16181d;border-bottom-color:#5b4cc4;font-weight:700}
}

/* ── 오른쪽 칸(PC): 따라 내려오는 목차 + 같이 보면 좋은 성분 */
.ingredient-sidebar .side-toc h2,.ingredient-sidebar .side-rel h2{font-size:15px;margin:0 0 8px;padding:0;border:0}
body.v2 .side-toc a,.side-toc a{display:flex;align-items:center;min-height:36px;padding:0 0 0 12px;border-left:2px solid #e3e3df;color:#55595f;text-decoration:none;font-size:14px}
body.v2 .side-toc a:hover,.side-toc a:hover{color:#16181d}
body.v2 .side-toc a[aria-current="true"],.side-toc a[aria-current="true"]{border-left-color:#5b4cc4;color:#16181d;font-weight:700}
body.v2 .side-rel .ingredient-side-link,.side-rel .ingredient-side-link{font-size:14px;color:#16181d;text-decoration:none}
.side-rel .ingredient-side-link small{font-size:12px;color:#61656d}
@media (min-width:801px){
  .ingredient-sidebar{position:sticky;top:16px;max-height:calc(100vh - 32px);overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain}
  .ingredient-sidebar .ingredient-card{margin-bottom:12px;padding:18px 20px}
  .rel-main{display:none}
}
@media (max-width:800px){
  .side-toc,.side-rel{display:none}
}

/* ── 연구원 노트: 비었을 때 한 줄 */
.research-notes-empty.is-compact{margin:4px 0 10px;padding:12px 14px;border:1px dashed #d9d6e6;border-radius:10px;font-size:14px;line-height:1.6;color:#4e5560;background:#fbfbfa}
.research-notes-loading{margin:8px 0}
#researchNotesAuth:empty{display:none}

/* ── 유통사·기업 기준 한 줄 */
.nonreg-compact{padding-top:4px!important;padding-bottom:4px!important}
.nonreg-compact summary{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;min-height:48px;cursor:pointer;list-style:none}
.nonreg-compact summary::-webkit-details-marker{display:none}
.nonreg-title{font-weight:700;color:#16181d;font-size:15px}
.nonreg-result{font-size:12.5px;font-weight:600;padding:2px 9px;border-radius:20px;background:#efedf2;color:#4e5560}
.nonreg-more{margin-left:auto;font-size:13px;color:#5b4cc4}
.nonreg-more::after{content:" ▾"}
.nonreg-compact[open] .nonreg-more::after,.nonreg-compact details[open] .nonreg-more::after{content:" ▴"}
.nonreg-compact h3{font-size:14px;margin:14px 0 6px}
.nonreg-compact .source-links{display:flex;flex-wrap:wrap;gap:4px 14px}
.nonreg-compact details{padding-bottom:10px}

/* ── 휴대폰(390px): 칩 배치 · 터치 영역 · 작은 글씨 */
@media (max-width:560px){
  .reg-strip ol{grid-template-columns:repeat(2,minmax(0,1fr))}
  .reg-chip{padding:6px 9px 7px}
  .ingredient-actions{gap:8px}
  .ingredient-actions .primary,.ingredient-actions .secondary{flex:1 1 auto}
  .ingredient-actions .ingredient-fix-link{margin-left:0;flex-basis:100%;justify-content:flex-start}
  /* 이동 경로 'ㄱ' 같은 짧은 링크 */
  .ingredient-breadcrumb{gap:2px 6px}
  .ingredient-breadcrumb a{display:inline-flex;align-items:center;min-height:44px;min-width:44px;justify-content:center;padding:0 4px;box-sizing:border-box}
  .ingredient-breadcrumb a:first-child{justify-content:flex-start;padding-left:0}
  /* 출처 링크 */
  .ingredient-main a.cas-source,.ingredient-main a.country-source,.ingredient-main a.country-detail-link,.ingredient-main .source-links a,.ingredient-main p.muted a,.ingredient-main .if-src a{display:inline-flex;align-items:center;min-height:44px;padding:0 2px;box-sizing:border-box;vertical-align:middle}
  .ingredient-main .source-links{display:flex;flex-wrap:wrap;column-gap:14px}
  /* 자주 묻는 질문 */
  .ingredient-main details.ingredient-faq>summary,.country-absent>summary,.country-more>summary{min-height:44px;display:flex;align-items:center;flex-wrap:wrap;box-sizing:border-box}
  .country-absent>summary span{margin-left:6px}
  /* 규제 표 카드: '상태'·'배합 조건' 이름표는 빼고 간격을 줄여 짧게 */
  .country-regulations .country-regulation-table tr{padding:12px 0}
  .country-regulations .country-regulation-table td:is([data-label="상태"],[data-label="배합 조건"])::before{display:none}
  .country-regulations .country-regulation-table td[data-label="근거 출처"]::before{display:inline;margin:0 8px 0 0;font-size:12px;color:#61656d}
  .country-regulations .country-regulation-table td{padding:3px 0}
  /* 작은 이름표는 12px 이상 */
  .ingredient-main .ingredient-status,.ingredient-main .tag,.reg-chip small,.ingredient-main small{font-size:max(12px,1em)}
  .ingredient-main .text-button{min-height:44px}
}

@media (prefers-reduced-motion:no-preference){html:has(.ingredient-layout){scroll-behavior:smooth}}
/* 합계량 고시 묶음: 대상 물질 목록·원문 */
.group-members{margin:0;padding-left:18px;line-height:1.8}
.group-raw{margin:12px 0 0;font-size:13px;color:#4e5560}
.group-raw summary{cursor:pointer}
.group-raw pre{white-space:pre-wrap;font:inherit;background:#faf8fc;border:1px solid #eee9f2;border-radius:10px;padding:10px 12px;margin:8px 0 0}

/* 제한 있음 = 빨강, 금지·제한 없음 = 초록 */
.ingredient-status.limit{background:#fde4e7;color:#b02a3e}
.ingredient-status.prohibit{background:#f9d6dc;color:#9b1530}
.ingredient-status.allow{background:#e2f4e9;color:#1d6b43}
.reg-group.is-regulated::before{background:#d1495b}
.reg-group.is-notlisted::before{background:#2f8a5c}
