/* 니트자켓 HTML 상세. 카페24 스킨 CSS와 섞이지 않게 모두 #tmd 아래에 둔다. */

/* 폰트: 피그마 상세의 본문·제목 = Pretendard (Light 300 / Regular 400 / SemiBold 600 / Bold 700).
   외부 CDN 없이 fonts/ 폴더의 파일을 쓴다. 라이선스: SIL OFL 1.1 (fonts/LICENSE.txt) */
@font-face { font-family: "Pretendard"; font-weight: 300; font-display: swap; src: url("fonts/Pretendard-Light.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 400; font-display: swap; src: url("fonts/Pretendard-Regular.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 600; font-display: swap; src: url("fonts/Pretendard-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: swap; src: url("fonts/Pretendard-Bold.woff2") format("woff2"); }

#tmd {
  --ink: #111;
  --sub: #666;
  --line: #e5e5e5;
  --soft: #f4f2ee;
  --red: #e60012;
  --pink: #ffe3e3;
  --radius: 12px;
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  color: var(--ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  -webkit-text-size-adjust: 100%;
}
#tmd *, #tmd *::before, #tmd *::after { box-sizing: border-box; }
#tmd img { display: block; max-width: 100%; height: auto; }
#tmd figure, #tmd blockquote, #tmd p, #tmd h1, #tmd h2, #tmd h3, #tmd h4, #tmd ul, #tmd dl, #tmd dd { margin: 0; }
#tmd ul { padding: 0; list-style: none; }
#tmd button { font: inherit; color: inherit; cursor: pointer; }

.tmd-h2 { font-size: 26px; font-weight: 700; text-align: center; }
.tmd-h3 { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.tmd-note { font-size: 13px; color: var(--sub); margin-top: 8px; }
.tmd-lead { font-size: 18px; font-weight: 600; text-align: center; margin: 24px 0; }
.tmd-figure { margin: 0 0 32px; }
.tmd-figure figcaption, .tmd-caption { font-size: 12px; color: var(--sub); text-align: right; margin-top: 6px; }

/* 타이틀 */
.tmd-hero { padding: 48px 20px 24px; }
.tmd-title { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 20px; }
.tmd-ask-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 24px; }
#tmd .tmd-ask {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--ink); border-radius: 14px; background: #fff;
  text-align: left; line-height: 1.3;
}
#tmd .tmd-ask[data-ask="size"] { background: var(--ink); color: #fff; }
.tmd-ask b { display: block; font-size: 15px; }
.tmd-ask small { display: block; font-size: 12px; opacity: .7; margin-top: 2px; }
.tmd-ask-icon { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 14px; font-weight: 700; border: 1px solid var(--ink); }

/* AI 검색기 */
#tmd .tmd-fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50;
  padding: 12px 16px; border: 0; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.tmd-fab span { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 4px; border-radius: 50%; background: #fff; color: var(--ink); font-size: 12px; }
.tmd-sheet {
  width: 100%; max-width: 560px; max-height: 88vh; max-height: 88dvh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 20px 20px 0 0; background: #fff; color: var(--ink);
  display: none; flex-direction: column; overflow: hidden;
}
.tmd-sheet[open] { display: flex; animation: tmd-up .22s ease-out; }
.tmd-sheet::backdrop { background: rgba(0,0,0,.45); }
@keyframes tmd-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 600px) { .tmd-sheet { margin: auto; border-radius: 20px; max-height: 80vh; } }
.tmd-sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
.tmd-sheet-head h2 { font-size: 18px; font-weight: 700; }
#tmd .tmd-sheet-close { width: 36px; height: 36px; border: 0; background: none; font-size: 28px; line-height: 1; }
.tmd-sheet-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 20px; padding: 4px; border-radius: 12px; background: var(--soft); }
#tmd .tmd-sheet-tabs button { padding: 10px; border: 0; border-radius: 9px; background: none; font-size: 14px; font-weight: 700; color: var(--sub); }
#tmd .tmd-sheet-tabs [aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.tmd-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); }

.tmd-size-form fieldset { margin: 0 0 18px; padding: 0; border: 0; }
.tmd-size-form legend { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.tmd-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.tmd-choices label { position: relative; }
.tmd-choices input { position: absolute; opacity: 0; pointer-events: none; }
.tmd-choices span { display: block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; cursor: pointer; }
.tmd-choices small { color: var(--sub); font-size: 12px; }
.tmd-choices input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.tmd-choices input:checked + span small { color: #ddd; }
.tmd-choices input:focus-visible + span { outline: 2px solid #4a90e2; outline-offset: 2px; }

.tmd-size-result:empty { display: none; }
.tmd-size-result { padding: 18px; border-radius: 16px; background: var(--soft); }
.tmd-rec-label { font-size: 13px; color: var(--sub); }
.tmd-rec-size { font-size: 30px; font-weight: 700; margin: 2px 0 6px; }
.tmd-rec-why { font-size: 14px; }
.tmd-rec-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 13px; text-align: center; background: #fff; border-radius: 10px; overflow: hidden; }
.tmd-rec-table th, .tmd-rec-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.tmd-rec-table thead th { background: #fafafa; font-weight: 700; }
.tmd-rec-table tr.is-rec td, .tmd-rec-table tr.is-rec th { font-weight: 700; background: #fff8e6; }
.tmd-rec-tip { font-size: 12px; color: var(--sub); margin-top: 10px; }
#tmd .tmd-rec-go { margin-top: 12px; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 700; text-decoration: underline; }

.tmd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#tmd .tmd-chips button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; }
#tmd .tmd-chips button[aria-pressed="true"] { border-color: var(--ink); font-weight: 700; }
.tmd-chat { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.tmd-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14px; white-space: pre-line; }
.tmd-msg.is-me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.tmd-msg.is-bot { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 4px; }
.tmd-ask-form { display: flex; gap: 6px; margin-top: 16px; position: sticky; bottom: 0; background: #fff; padding-top: 8px; }
.tmd-ask-form input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 16px; }
#tmd .tmd-ask-form button { padding: 0 16px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; }

/* 색상 선택 */
.tmd-colors { padding: 32px 20px 40px; border-top: 8px solid var(--soft); }
.tmd-color-panel { margin-top: 12px; }
.tmd-color-name { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 16px; }
.tmd-color-shots { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; align-items: start; }
.tmd-color-cuts { display: grid; gap: 8px; }
.tmd-color-cuts figcaption { font-size: 12px; font-weight: 600; text-align: center; }
.tmd-color-model img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.tmd-swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.tmd-swatch-group { margin-bottom: 16px; }
.tmd-swatch-group > p { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.tmd-swatch-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tmd-swatch { width: 56px; height: 56px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.tmd-swatch[aria-pressed="true"] { border: 2px solid var(--ink); }
.tmd-swatch img { width: 100%; height: 100%; object-fit: cover; }

/* 아코디언 */
.tmd-accordions { border-top: 8px solid var(--soft); }
.tmd-acc { border-bottom: 1px solid var(--line); }
.tmd-acc > summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 20px; font-size: 19px; font-weight: 700;
}
.tmd-acc > summary::-webkit-details-marker { display: none; }
.tmd-acc > summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.tmd-acc[open] > summary::after { transform: rotate(-135deg); }
.tmd-acc-body { padding: 4px 20px 40px; }

/* 탭 */
.tmd-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px; scrollbar-width: none; }
.tmd-tabs::-webkit-scrollbar { display: none; }
.tmd-tabs [role="tab"] { flex: none; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--soft); font-size: 14px; font-weight: 600; }
#tmd .tmd-tabs [aria-selected="true"] { background: var(--ink); color: #fff; }
.tmd-line-tabs [role="tab"] { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 10px; background: none; font-size: 12px; }
.tmd-line-tabs [role="tab"] img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; }
#tmd .tmd-line-tabs [aria-selected="true"] { background: none; color: var(--ink); }
.tmd-line-tabs [aria-selected="true"] img { border-color: var(--ink); }

/* 사이즈표 */
.tmd-table-wrap { overflow-x: auto; margin-top: 16px; }
.tmd-size-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; text-align: center; }
.tmd-size-table th, .tmd-size-table td { padding: 10px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tmd-size-table thead th { font-weight: 700; border-bottom: 2px solid var(--ink); }
.tmd-size-table tbody th { text-align: left; font-weight: 700; }

/* 제품 개발 과정 */
.tmd-quote { font-size: 20px; font-weight: 700; text-align: center; margin: 24px 0; }
.tmd-quote cite { font-style: normal; font-size: 14px; color: var(--sub); }

/* 연출 이미지 */
.tmd-carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.tmd-carousel-track::-webkit-scrollbar { display: none; }
.tmd-carousel-track > figure { flex: 0 0 100%; scroll-snap-align: start; }
.tmd-carousel-track img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.tmd-carousel-track figcaption { font-size: 12px; color: var(--sub); text-align: right; margin-top: 6px; }
.tmd-carousel-nav { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 12px; font-size: 14px; }
.tmd-carousel-nav button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 20px; line-height: 1; }

/* 디테일 · 조직감 */
.tmd-wide { width: 100%; margin-bottom: 20px; border-radius: var(--radius); }
.tmd-features { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; }
.tmd-feature img, .tmd-noimg { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--soft); }
.tmd-feature h4 { font-size: 16px; font-weight: 700; margin: 12px 0 4px; }
.tmd-feature p { font-size: 14px; color: #444; }

/* 길이감 비교 */
.tmd-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tmd-compare-h { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.tmd-compare img { width: 100%; aspect-ratio: 377 / 406; object-fit: cover; }
.tmd-compare p:last-child { font-size: 14px; margin-top: 8px; }

/* 소재 */
.tmd-material h4 { font-size: 18px; font-weight: 700; margin: 28px 0 12px; }
.tmd-material > p { font-size: 15px; margin-top: 12px; }
.tmd-box { margin-top: 32px; padding: 20px; border-radius: var(--radius); background: var(--soft); }
.tmd-box h4 { margin-top: 0; }
.tmd-blend { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.tmd-blend img { width: 100%; border-radius: 10px; }
.tmd-plus { font-size: 22px; font-weight: 700; padding-top: 18%; }
.tmd-blend li { margin-top: 8px; padding: 6px 8px; border-radius: 999px; background: #fff; font-size: 13px; text-align: center; }
.tmd-blend li.is-weak { background: none; border: 1px dashed #bbb; color: #999; }
.tmd-blend li.is-strong { background: #e6dfd3; font-weight: 700; }
.tmd-conclusion { margin-top: 20px; padding: 14px; border: 1.5px solid var(--red); border-radius: 10px; background: #fff; font-weight: 700; text-align: center; }
.tmd-yarns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 모델 사이즈 */
.tmd-models { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tmd-models img { width: 100%; border-radius: var(--radius); }
.tmd-models figcaption { font-size: 14px; margin-top: 10px; }

/* 상품 고시 정보 */
.tmd-notice-table { display: grid; grid-template-columns: 120px 1fr; font-size: 14px; border-top: 2px solid var(--ink); }
.tmd-notice-table dt, .tmd-notice-table dd { padding: 12px 8px; border-bottom: 1px solid var(--line); }
.tmd-notice-table dt { font-weight: 700; background: #fafafa; }
.tmd-notice-line { font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
.tmd-notice-line:first-child { margin-top: 0; }
.tmd-notice-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px 8px; }
.tmd-notice-colors li { font-size: 12px; text-align: center; }
.tmd-notice-colors img { width: 56px; height: 56px; margin: 0 auto 4px; object-fit: cover; border-radius: 6px; }

/* 하단 안내 */
.tmd-footer { padding: 32px 20px 56px; border-top: 8px solid var(--soft); }
.tmd-footer section { margin-top: 44px; }
.tmd-warn { padding: 20px 20px 20px 36px !important; background: var(--pink); border-radius: var(--radius); color: var(--red); font-size: 14px; list-style: disc !important; }
.tmd-warn li + li { margin-top: 4px; }
.tmd-care ul { padding-left: 20px; list-style: disc; font-size: 14px; color: #333; }
.tmd-care li + li { margin-top: 4px; }
.tmd-period { font-size: 17px; font-weight: 600; }
.tmd-red { color: var(--red); }
.tmd-redbox { margin-top: 16px; padding: 16px 20px; border: 1.5px solid var(--red); border-radius: 10px; color: var(--red); font-size: 14px; }
.tmd-redbox li::before { content: "- "; }
.tmd-contact-name { font-weight: 700; margin-bottom: 8px; }
.tmd-contact-row { display: grid; grid-template-columns: 1fr auto; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tmd-contact-row dt { grid-column: 1; font-weight: 700; }
.tmd-contact-row dd { grid-column: 1; }
.tmd-contact-row img { grid-column: 2; grid-row: 1 / 3; width: 66px; }
.tmd-contact-row a { color: inherit; }

/* 검수 표시 (?flags=1) */
.tmd-show-flags [data-flag] { outline: 2px dashed #ff8a00; outline-offset: 2px; position: relative; }
.tmd-show-flags [data-flag]::after { content: "⚠ " attr(data-flag); display: block; font-size: 11px; font-weight: 600; color: #b35c00; background: #fff4e5; padding: 2px 6px; margin-top: 4px; text-align: left; }

@media (max-width: 480px) {
  .tmd-title { font-size: 30px; }
  .tmd-color-shots { grid-template-columns: 1fr 1fr; }
  .tmd-features { grid-template-columns: 1fr 1fr; gap: 20px 12px; }
  .tmd-feature h4 { font-size: 15px; }
  .tmd-feature p { font-size: 13px; }
  .tmd-notice-table { grid-template-columns: 96px 1fr; }
}

/* 사이즈 도안 (tools/build_size_svg.py) */
.tmd-size-svg { display: block; width: 100%; height: auto; font-family: inherit; }
