/* ============================================================
   쓸모연구소 — 문패(門牌) 디자인 시스템
   종이(--pa) 위에 먹(--k)과 인주(--ju) 두 색. 세로쓰기 한글 기둥이 서명.
   ============================================================ */

@font-face {
  font-family: 'Pretendard';
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url('fonts/PretendardVariable.woff2') format('woff2-variations');
}

:root {
  --pa: #F4F4F0;      /* 종이 */
  --pa2: #EDEDE8;     /* 종이, 한 톤 어둡게 */
  --k: #141414;       /* 먹 */
  --mu: #767470;      /* 옅은 먹 */
  --ln: #D4D4CE;      /* 괘선 */
  --ju: #C8321E;      /* 인주 */
  --ju-soft: #F7E6E2;
  --font: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--pa); color: var(--k);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* 절대 규칙: 한글은 어절(띄어쓰기) 단위로만 줄바꿈한다. "코덱|스"처럼 단어 중간에서 끊기면 안 된다. */
  word-break: keep-all; overflow-wrap: break-word; line-break: strict;
}
/* 빨간 핵심어는 한 덩어리로 붙여 둔다 */
.kw { white-space: nowrap; }
/* 제목류는 줄 길이를 고르게 */
h1, h2, h3, .lead-title, .row .rb h3, .related b { text-wrap: balance; }
p, li { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--k); color: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }

/* ---------- 상단 ---------- */
.top {
  max-width: 1360px; margin: 0 auto; padding: 30px 40px 0;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.mark { display: flex; flex-direction: column; gap: 10px; }
.seal {
  width: 64px; height: 64px; background: var(--ju); color: #fff; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; letter-spacing: .06em; line-height: 1;
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3.5px var(--ju);
  transition: transform .5s var(--ease);
}
.mark:hover .seal { transform: rotate(-4deg) scale(1.03); }
.seal.small { width: 40px; height: 40px; font-size: 14px; box-shadow: inset 0 0 0 1.5px #fff, inset 0 0 0 2.5px var(--ju); }
.seal.big { width: 96px; height: 96px; font-size: 32px; }
.brand { font-size: 12.5px; letter-spacing: .34em; color: var(--mu); font-weight: 700; }
.issue { font-size: 12px; letter-spacing: .18em; color: var(--mu); text-align: right; line-height: 1.9; display: flex; flex-direction: column; }
.issue b { color: var(--ju); font-weight: 800; }

/* ---------- 레이아웃 ---------- */
.wrap {
  max-width: 1360px; margin: 0 auto; padding: 26px 40px 90px;
  display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 46px; align-items: start;
}
main { min-width: 0; }

/* ---------- 왼쪽 문패 메뉴 (가로 글씨 · 스크롤해도 따라옴) ---------- */
.sb {
  position: sticky; top: 20px; z-index: 20;
  display: block; padding: 24px 0 6px;
  border-top: 2px solid var(--k);
  max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--ln) transparent;
}
.sb::-webkit-scrollbar { width: 5px; }
.sb::-webkit-scrollbar-thumb { background: var(--ln); border-radius: 3px; }
.sb::-webkit-scrollbar-track { background: transparent; }
.vg {
  writing-mode: horizontal-tb; text-orientation: mixed; white-space: normal;
  display: block; height: auto; min-height: 0; max-height: none;
  padding: 0; margin: 0 0 14px; min-width: 0; border: none;
}
.vg + .vg { border-left: none; border-top: 1px solid var(--ln); padding-top: 14px; }
.vt {                                                     /* 그룹 이름표 = 먹색 칩 */
  display: block; width: fit-content; background: var(--k); color: #fff;
  font-size: 10.5px; letter-spacing: .26em; font-weight: 800;
  padding: 7px 11px 6px; margin: 0 0 7px; border-radius: 2px; line-height: 1;
  white-space: nowrap;
}
.vr {                                                     /* 항목 = 한 줄에 하나, 왼쪽 눈금 */
  display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 10px;
  text-align: left; font-size: 13px; font-weight: 600; letter-spacing: .005em; color: var(--k);
  padding: 5px 4px 5px 10px; background: none; cursor: pointer;
  border: none; border-left: 2px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
}
.vr span { min-width: 0; }
.vr em {
  font-style: normal; writing-mode: horizontal-tb; text-orientation: mixed;
  font-size: 11px; color: var(--mu); font-variant-numeric: tabular-nums; flex: 0 0 auto;
}
.vr:hover { color: var(--ju); border-left-color: var(--ln); }
.vr.on, .vr.active { color: var(--ju); font-weight: 800; border-left-color: var(--ju); background: var(--ju-soft); }
.vr.on em, .vr.active em { color: var(--ju); }
.vr.disabled { opacity: .3; cursor: not-allowed; }
.vr.disabled:hover { color: var(--k); border-left-color: transparent; }
.vr[hidden] { display: none; }
.vr.morebtn { color: var(--mu); font-weight: 700; border-left: 2px dashed var(--ln); }
.vr.morebtn em { color: var(--ju); }
.vr.morebtn.open { color: var(--k); }
.reset {
  writing-mode: horizontal-tb; display: block; width: 100%;
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
  color: #fff; background: var(--ju); border: none; padding: 7px 10px; border-radius: 2px;
  cursor: pointer; margin: 0 0 14px; position: static;
}
.reset[hidden] { display: none; }

/* ---------- 홈 리드 + 키 비주얼 ---------- */
.lead {
  border-top: 2px solid var(--k); padding-top: 26px; margin-bottom: 40px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: start;
}
.lead-t { display: flex; gap: 22px; }
.vlab {
  writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap;
  font-size: 11px; letter-spacing: .3em; color: var(--mu); font-weight: 700;
  border-right: 1px solid var(--ln); padding: 2px 6px 0 0; flex-shrink: 0; align-self: flex-start; line-height: 1;
}
.row .vlab { font-size: 10px; letter-spacing: .14em; }
.vlab.red { color: var(--ju); border-right-color: var(--ju); }
.lead h1, .lead .lead-title { margin: 0 0 14px; font-size: 44px; font-weight: 800; letter-spacing: -.035em; line-height: 1.22; text-wrap: balance; }
.lead p { margin: 0 0 14px; font-size: 16px; line-height: 1.75; color: var(--mu); }
.meta { font-size: 12px; letter-spacing: .14em; color: var(--mu); margin-bottom: 20px; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 800; letter-spacing: .12em; color: var(--k);
  border: 1px solid var(--k); padding: 11px 18px; border-radius: 2px;
  transition: background .25s, color .25s;
}
.cta i { font-style: normal; transition: transform .3s var(--ease); }
.cta:hover { background: var(--k); color: #fff; }
.cta:hover i { transform: translateX(4px); }
.kv { margin: 0; border: 1px solid var(--ln); padding: 8px; background: #fff; }
.kv img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.kv figcaption { font-size: 10.5px; letter-spacing: .24em; color: var(--mu); text-transform: uppercase; padding: 8px 2px 0; }

/* ---------- 제목 강조: 핵심어는 인주색, 핵심 문구는 밑줄 ---------- */
.kw { color: var(--ju); font-weight: 800; }
.kp {
  text-decoration: underline; text-decoration-color: var(--ju);
  text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-skip-ink: auto;
}
.lead h1 .kp, .lead .lead-title .kp, .art-body h1 .kp { text-decoration-thickness: 3px; text-underline-offset: 7px; }
.art-body h1 u.kp { font-weight: inherit; }
.art-body .kw { font-weight: 700; }
.art-body .notice {          /* 면책·주의 고지: 온통 빨간 글씨 대신 인주색 테두리 상자 */
  border: 1px solid var(--ju); border-left-width: 3px; border-radius: 2px;
  background: var(--ju-soft); color: var(--k);
  padding: 14px 16px; margin: 20px 0; font-size: 14.5px; line-height: 1.7;
}
.art-body .notice .kw { color: var(--ju); }
/* 영상 밖 배경: 매체가 더한 부분이라 소제목 상자를 속 빈 형태로 구분한다 */
.art-body .ednote { margin-top: 46px; border-top: 1px solid var(--ln); padding-top: 6px; }
.art-body .ednote > h2 {
  background: none; color: var(--k); box-shadow: inset 0 0 0 1px var(--k);
}
.art-body .ednote > h2::before { content: "＋ "; color: var(--ju); font-weight: 800; }
.art-body .ednote > h3 { background: var(--pa2); color: var(--k); }                 /* 본문 키워드는 제목보다 한 톤 가볍게 */
.art-body u.ks { font-weight: 600; }

/* ---------- 목록 ---------- */
.listhead { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--k); padding-bottom: 10px; margin-bottom: 4px; }
.listhead h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .1em; }
.listhead h2 span { color: var(--ju); margin-left: 6px; }
.search { position: relative; }
.search input {
  font-family: inherit; font-size: 13px; border: none; border-bottom: 1px solid var(--ln); background: none;
  padding: 6px 26px 6px 0; width: 200px; outline: none; color: var(--k); transition: border-color .25s;
}
.search input:focus { border-bottom-color: var(--ju); }
.search span { position: absolute; right: 2px; top: 5px; color: var(--mu); }
.empty { text-align: center; color: var(--mu); padding: 60px 0; }

.row {
  display: grid; grid-template-columns: 60px 30px 1fr 150px; gap: 20px;
  padding: 22px 0; border-top: 1px solid var(--ln); align-items: start;
}
.row .no { font-size: 30px; font-weight: 800; color: var(--ju); letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.row .rb h3 {
  margin: 0 0 6px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.4;
  background-image: linear-gradient(var(--ju), var(--ju)); background-repeat: no-repeat;
  background-size: 0 2px; background-position: 0 100%; transition: background-size .35s var(--ease);
  display: inline;
}
.row:hover .rb h3 { background-size: 100% 2px; }
.row .rb p { margin: 0; font-size: 13.5px; color: var(--mu); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .rm { text-align: right; font-size: 11.5px; letter-spacing: .12em; color: var(--mu); line-height: 1.9; }
.row .rm b { display: block; color: var(--k); font-variant-numeric: tabular-nums; }

/* ---------- 카테고리 / 플랫폼 헤더 ---------- */
.head { border-top: 2px solid var(--k); padding-top: 24px; margin-bottom: 28px; display: flex; gap: 22px; }
.head h1 { margin: 0 0 8px; font-size: 40px; font-weight: 800; letter-spacing: -.035em; line-height: 1.2; }
.head p { margin: 0; color: var(--mu); font-size: 15px; }
.tabs { display: flex; flex-wrap: wrap; gap: 0; margin-top: 18px; border-top: 1px solid var(--ln); }
.tab { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; padding: 10px 14px 10px 0; margin-right: 14px; border-top: 2px solid transparent; margin-top: -1px; transition: border-color .25s, color .25s; }
.tab em { font-style: normal; color: var(--ju); margin-left: 6px; font-variant-numeric: tabular-nums; }
.tab:hover { border-top-color: var(--k); }
.sec { margin-top: 34px; }
.sech { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 4px; border-bottom: 2px solid var(--k); padding-bottom: 8px; scroll-margin-top: 24px; }
.sech span { font-size: 15px; font-weight: 800; letter-spacing: .1em; }
.sech em { font-style: normal; font-size: 12px; color: var(--ju); letter-spacing: .12em; }

.ptiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ln); border-left: 1px solid var(--ln); margin-bottom: 36px; }
.ptile { padding: 18px 18px 16px; border-right: 1px solid var(--ln); border-bottom: 1px solid var(--ln); display: flex; flex-direction: column; gap: 4px; transition: background .25s; }
.ptile:hover { background: #fff; }
.ptile b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.ptile em { font-style: normal; font-size: 12px; color: var(--ju); font-weight: 800; letter-spacing: .1em; }
.ptile span { font-size: 12.5px; color: var(--mu); line-height: 1.5; }
.ptile small { font-size: 11px; color: var(--mu); margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--ln); }

/* ---------- 아티클 ---------- */
.art { max-width: 800px; display: grid; grid-template-columns: 30px 1fr; gap: 24px; border-top: 2px solid var(--k); padding-top: 22px; }
.art > .vlab { position: sticky; top: 24px; }
.art-col { min-width: 0; }
.art-meta { font-size: 12px; letter-spacing: .14px; color: var(--mu); display: flex; gap: 16px; margin-bottom: 6px; letter-spacing: .14em; }
.art-meta b { color: var(--k); }
.art-body { font-size: 16.5px; line-height: 1.85; }
.art-body h1 { font-size: 40px; font-weight: 800; letter-spacing: -.035em; line-height: 1.22; margin: 8px 0 28px; text-wrap: balance; }
.art-body h2 {
  display: block; width: 100%; margin: 44px 0 16px; padding: 12px 18px;
  background: var(--k); color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.01em; line-height: 1.45; border-radius: 2px;
}
.art-body h3 {
  display: inline-block; margin: 26px 0 10px; padding: 5px 12px;
  background: var(--ju-soft); color: var(--ju); font-size: 15px; font-weight: 800; letter-spacing: -.005em; border-radius: 2px;
}
.art-body p { margin: 0 0 16px; }
.art-body ul, .art-body ol { margin: 0 0 16px; padding-left: 22px; }
.art-body li { margin-bottom: 6px; }
.art-body strong { font-weight: 800; color: var(--ju); }
.art-body table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 14px; }
.art-body th, .art-body td { border: 1px solid var(--ln); padding: 8px 12px; text-align: left; vertical-align: top; }
.art-body th { background: var(--pa2); font-weight: 800; }
.art-body blockquote { border-left: 2px solid var(--ju); margin: 20px 0; padding: 4px 18px; color: var(--mu); }
/* 편집자 표시: 형광펜 / 밑줄 */
.art-body mark { background: linear-gradient(transparent 38%, #FFEB7A 38%, #FFEB7A 92%, transparent 92%); color: inherit; padding: 0 2px; font-weight: 600; }
.art-body u { text-decoration: underline; text-decoration-color: var(--ju); text-decoration-thickness: 2px; text-underline-offset: 5px; font-weight: 600; }
/* 삽화 */
.art-fig { margin: 26px 0 30px; border: 1px solid var(--ln); padding: 8px; background: #fff; }
.art-fig img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.art-fig figcaption { font-size: 10.5px; letter-spacing: .24em; color: var(--mu); padding: 8px 2px 0; }
.art-body code { font-family: 'SF Mono', Menlo, monospace; font-size: 13px; background: var(--pa2); padding: 1px 6px; border-radius: 2px; }
.art .cta { margin-top: 34px; }

/* 프롬프트 박스 */
.prompt-box { margin: 22px 0; border: 1px solid var(--k); border-radius: 2px; overflow: hidden; background: #fff; }
.prompt-box-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--k); background: var(--pa); }
.prompt-box-head span { font-size: 11px; font-weight: 800; letter-spacing: .22em; color: var(--ju); }
.prompt-box .copy-btn { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--k); background: #fff; border: 1px solid var(--k); padding: 4px 12px; border-radius: 2px; cursor: pointer; transition: background .2s, color .2s; }
.prompt-box .copy-btn:hover, .prompt-box .copy-btn.copied { background: var(--k); color: #fff; }
.prompt-box pre { margin: 0; padding: 16px; overflow-x: auto; }
.prompt-box code { background: none; padding: 0; font-size: 14px; color: var(--k); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }

/* 요약카드 */
.summary-card { border: 1px solid var(--ln); border-left: 2px solid var(--ju); padding: 18px 20px; margin: 24px 0; background: #fff; }
.summary-card-label { font-size: 11px; font-weight: 800; color: var(--ju); letter-spacing: .22em; margin-bottom: 8px; }
.summary-card-claim { font-size: 15.5px; font-weight: 600; margin: 0 0 12px; line-height: 1.6; }
.chip-row, .cover-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row { margin-bottom: 8px; }
.chip-fact { font-size: 12px; font-weight: 700; border: 1px solid var(--k); padding: 2px 9px; border-radius: 2px; font-variant-numeric: tabular-nums; }
.tag-dot { font-size: 12px; color: var(--mu); border: 1px solid var(--ln); padding: 2px 9px; border-radius: 2px; }

/* ---------- 404 ---------- */
.nf { grid-column: 1 / -1; text-align: center; padding: 80px 0; }
.nf h1 { font-size: 36px; font-weight: 800; letter-spacing: -.03em; margin: 24px 0 8px; }
.nf p { color: var(--mu); margin: 0 0 24px; }

/* ---------- 하단 ---------- */
.foot { border-top: 1px solid var(--k); }
.foot-in { max-width: 1360px; margin: 0 auto; padding: 26px 40px 40px; display: flex; gap: 18px; align-items: center; font-size: 12.5px; color: var(--mu); letter-spacing: .04em; }
.foot-in p { margin: 0; }

/* ---------- 모션 ---------- */
.rise { opacity: 0; transform: translateY(14px); animation: rise .9s var(--ease) forwards; }
.rise.d1 { animation-delay: .12s } .rise.d2 { animation-delay: .24s } .rise.d3 { animation-delay: .36s }
@keyframes rise { to { opacity: 1; transform: none; } }
[data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise, [data-reveal] { opacity: 1; transform: none; animation: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 반응형 ---------- */
@media (max-width: 1100px) {
  .lead { grid-template-columns: 1fr; }
  .lead h1, .lead .lead-title { font-size: 36px; }
  .ptiles { grid-template-columns: 1fr 1fr; }
}

/* 모바일: 기둥은 가로 띠로 눕고, 한 손으로 넘긴다 */
@media (max-width: 860px) {
  body { overflow-wrap: anywhere; }   /* 좁은 화면에서 긴 영문·주소가 넘치지 않게 */
  .top { padding: 18px 20px 0; align-items: center; }
  .mark { flex-direction: row; align-items: center; gap: 12px; }
  .seal { width: 44px; height: 44px; font-size: 16px; box-shadow: inset 0 0 0 1.5px #fff, inset 0 0 0 2.5px var(--ju); }
  .brand { letter-spacing: .22em; font-size: 11.5px; }
  .issue { display: flex; font-size: 10.5px; letter-spacing: .1em; line-height: 1.6; }
  .issue span:last-child { display: none; }

  .wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 18px 0 56px; }
  main { padding: 0 20px; min-width: 0; }

  /* 필터/메뉴: 그룹마다 한 줄 가로 스크롤 띠 */
  .sb { position: static; display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin: 0 0 22px; min-width: 0; max-width: 100%; border-top: none; border-bottom: 1px solid var(--ln); box-shadow: none; padding: 0 0 8px; max-height: none; overflow: visible; }
  .reset { position: static; display: inline-block; width: auto; align-self: flex-start; margin: 0 20px 2px; }
  .vg, .vg + .vg, .vg:first-of-type {
    position: static; border-top: none; margin: 0;
    writing-mode: horizontal-tb; text-orientation: mixed; white-space: nowrap;
    height: auto; min-height: 0; max-height: none; border: none; min-width: 0; max-width: 100%;
    display: flex; flex-wrap: nowrap; align-items: center; gap: 6px;
    overflow-x: auto; overflow-y: hidden; padding: 2px 20px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
  }
  .vg::-webkit-scrollbar { display: none; }
  .vg::after { content: ""; flex: 0 0 24px; }               /* 마지막 칩이 마스크에 안 가리게 */
  .vt { flex: 0 0 auto; width: auto; margin: 0 4px 0 0; padding: 8px 9px 7px; font-size: 10.5px; letter-spacing: .22em; border: none;
        position: sticky; left: 0; top: auto; width: auto; text-align: left; z-index: 1; box-shadow: 6px 0 0 var(--pa); }   /* 그룹 이름은 왼쪽에 붙어 따라온다 */
  .vr, .vg > .vr:first-of-type {
    display: inline-flex; width: auto; justify-content: flex-start; flex: 0 0 auto;
    border: 1px solid var(--ln); border-radius: 2px; background: #fff;
    padding: 0 12px; min-height: 36px; font-size: 13.5px; letter-spacing: .02em;
  }
  .vr.on, .vr.active { border: 1.5px solid var(--ju); background: var(--ju-soft); }
  .vr:hover { border-color: var(--ln); }
  .vr.on span::before, .vr.active span::before { content: ""; }
  .vr em { writing-mode: horizontal-tb; }
  .vr.more[hidden] { display: inline-flex; }               /* 가로 띠에서는 '더보기' 없이 전부 */
  .vr.morebtn { display: none; }

  /* 리드 */
  .lead { padding-top: 20px; margin-bottom: 28px; gap: 22px; }
  .lead-t { flex-direction: column; gap: 10px; }
  .vlab { writing-mode: horizontal-tb; border-right: none; border-bottom: 1px solid var(--ln); padding: 0 0 4px; }
  .lead h1, .lead .lead-title { font-size: 27px; letter-spacing: -.03em; line-height: 1.3; margin-bottom: 10px; }
  .lead p { font-size: 15px; line-height: 1.7; }
  .meta { margin-bottom: 14px; }
  .cta { padding: 12px 18px; min-height: 44px; }
  .kv { padding: 6px; }
  .kv figcaption { font-size: 10px; }

  /* 목록 */
  .listhead { flex-direction: column; align-items: stretch; gap: 10px; padding-bottom: 12px; }
  .search input { width: 100%; font-size: 16px; padding: 8px 26px 8px 0; }   /* 16px = iOS 확대 방지 */
  .search span { top: 8px; }
  .row { grid-template-columns: 38px 1fr; gap: 12px; padding: 16px 0; }
  .row .vlab { display: none; }
  .row .no { font-size: 20px; padding-top: 3px; }
  .row .rb h3 { font-size: 17px; line-height: 1.4; }
  .row .rb p { font-size: 13px; -webkit-line-clamp: 2; }
  .row .rm { grid-column: 2; text-align: left; font-size: 11px; line-height: 1.6; margin-top: -4px; }
  .row .rm b { display: inline; margin-right: 10px; }

  /* 카테고리 / 플랫폼 헤더 */
  .head { flex-direction: column; gap: 10px; padding-top: 18px; margin-bottom: 20px; }
  .head h1 { font-size: 30px; }
  .head p { font-size: 14px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 14px -20px 0; padding: 0 20px;
          -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%); }
  .tabs::after { content: ""; flex: 0 0 24px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 12px 14px 12px 0; min-height: 40px; }
  .sec { margin-top: 26px; }
  .ptiles { grid-template-columns: 1fr; }
  .ptile { padding: 14px 16px; }

  /* 아티클 */
  .art { grid-template-columns: 1fr; gap: 8px; padding-top: 16px; }
  .art > .vlab { position: static; }
  .art-meta { flex-wrap: wrap; gap: 8px 14px; font-size: 11.5px; }
  .art-body { font-size: 16px; line-height: 1.8; }
  .art-body h1 { font-size: 26px; line-height: 1.3; margin: 6px 0 20px; }
  .art-body h2 { margin: 34px 0 14px; padding: 11px 14px; font-size: 16px; }
  .art-body h3 { font-size: 14.5px; }
  .art-body table { display: block; overflow-x: auto; white-space: nowrap; font-size: 13px; }
  .art-body pre { overflow-x: auto; }
  .art-body img { max-width: 100%; height: auto; }
  .art-fig { margin: 20px 0 24px; padding: 6px; }
  .prompt-box pre { padding: 14px; }
  .prompt-box .copy-btn { min-height: 34px; padding: 4px 14px; }
  .summary-card { padding: 14px 16px; }
  .art .cta { margin-top: 26px; }

  /* 하단 */
  .foot-in { flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px 20px 36px; font-size: 12px; }

  /* 스크롤 등장 모션은 짧게 */
  [data-reveal] { transform: translateY(8px); transition-duration: .5s; }
}

@media (max-width: 400px) {
  .lead h1, .lead .lead-title { font-size: 25px; }
  .art-body h1 { font-size: 24px; }
  .head h1 { font-size: 27px; }
}

/* 아이폰 노치·홈바 여백 */
@supports (padding: env(safe-area-inset-left)) {
  @media (max-width: 860px) {
    .top, main, .foot-in { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
    .foot-in { padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
  }
}

/* ---------- 검색·초보자용 구조 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lead .lead-title { margin: 0 0 14px; }

/* 목차: 한지 위 먹 괘선 목록 */
.art-body .toc {
  margin: 4px 0 34px; padding: 16px 20px 14px; background: #fff;
  border: 1px solid var(--ln); border-top: 2px solid var(--k);
}
.art-body .toc b { display: block; font-size: 11.5px; letter-spacing: .22em; color: var(--ju); font-weight: 800; margin-bottom: 8px; }
.art-body .toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.art-body .toc li { font-size: 14px; line-height: 1.55; margin: 0 0 6px; break-inside: avoid; }
.art-body .toc a { color: var(--k); border-bottom: 1px solid transparent; transition: border-color .2s, color .2s; }
.art-body .toc a:hover { color: var(--ju); border-bottom-color: var(--ju); }
.art-body h2[id] { scroll-margin-top: 20px; }

/* 자주 묻는 질문 */
.art-body .faq h3 { display: block; background: none; color: var(--k); padding: 0 0 0 30px; position: relative; margin: 24px 0 8px; font-size: 16px; }
.art-body .faq h3::before {
  content: "Q"; position: absolute; left: 0; top: -1px; width: 21px; height: 21px; border-radius: 2px;
  background: var(--ju); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.art-body .faq h3 + p { padding-left: 30px; position: relative; }
.art-body .faq h3 + p::before { content: "A"; position: absolute; left: 4px; top: 0; font-size: 13px; font-weight: 800; color: var(--mu); }
.art-body .faq p { padding-left: 30px; }

/* 같이 읽으면 좋은 글 */
.related { margin-top: 44px; border-top: 2px solid var(--k); padding-top: 14px; }
.related h2 { margin: 0 0 6px; font-size: 13px; letter-spacing: .22em; font-weight: 800; color: var(--k); }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.related li { border-bottom: 1px solid var(--ln); }
.related a { display: block; padding: 12px 0; }
.related .rel-cat { display: block; font-size: 10.5px; letter-spacing: .18em; color: var(--ju); font-weight: 700; margin-bottom: 3px; }
.related b { font-size: 15px; font-weight: 700; line-height: 1.45; letter-spacing: -.01em; }
.related a:hover b { color: var(--ju); }
@media (max-width: 860px) {
  .art-body .toc ol { columns: 1; }
  .related ul { grid-template-columns: 1fr; }
}

/* ---------- 도구함 (사이드바) ---------- */
.toolbox { border-top: 1px solid var(--ln); padding-top: 14px; }
.toolbox .tb-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--ln); margin: 0 0 10px; }
.toolbox .tb-tabs button {
  flex: 1 1 auto; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--mu); padding: 6px 2px 7px; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.toolbox .tb-tabs button:hover { color: var(--k); }
.toolbox .tb-tabs button.on { color: var(--ju); border-bottom-color: var(--ju); }
.toolbox [data-pane] { min-height: 150px; }
.toolbox [data-pane][hidden] { display: none; }
.toolbox .tb-more { display: block; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--mu); letter-spacing: .02em; }
.toolbox .tb-more:hover { color: var(--ju); }
.toolbox .tb-more i { font-style: normal; }
.toolbox .tb-link { display: none; }

/* ---------- 도구 공통 ---------- */
.tool { background: #fff; border: 1px solid var(--ln); border-top: 2px solid var(--k); padding: 12px; }
.tool input[type="date"], .tool input[type="number"], .tool textarea {
  font: inherit; font-size: 14px; color: var(--k); background: var(--pa); border: 1px solid var(--ln); border-radius: 2px;
  padding: 7px 8px; width: 100%; box-sizing: border-box; outline: none; transition: border-color .2s;
}
.tool input:focus, .tool textarea:focus { border-color: var(--ju); }
.tool textarea { resize: vertical; line-height: 1.55; }
.tool label { display: block; font-size: 12px; font-weight: 700; color: var(--mu); letter-spacing: .02em; }
.tool label input { margin-top: 4px; }
.tool output { font-weight: 800; color: var(--k); font-variant-numeric: tabular-nums; }

/* 시계 */
.t-clock .clk-time { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.t-clock .clk-date { font-size: 12px; color: var(--mu); margin-top: 6px; letter-spacing: .02em; }
.clk-world { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
.clk-world li { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--ln); font-size: 14px; }
.clk-world b { font-weight: 700; }
.clk-world span { color: var(--mu); font-variant-numeric: tabular-nums; }

/* 계산기 */
.t-calc { outline: none; }
.t-calc:focus-visible { box-shadow: 0 0 0 2px var(--ju); }
.calc-screen { background: var(--pa); border: 1px solid var(--ln); padding: 6px 8px; text-align: right; margin-bottom: 8px; min-height: 52px; }
.calc-hist { font-size: 11px; color: var(--mu); min-height: 15px; word-break: break-all; }
.calc-out { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; word-break: break-all; line-height: 1.2; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ck { font: inherit; font-size: 15px; font-weight: 700; height: 34px; border: 1px solid var(--ln); background: var(--pa); color: var(--k); border-radius: 2px; cursor: pointer; transition: background .15s, color .15s; }
.ck:hover { background: #fff; }
.ck:active { transform: translateY(1px); }
.ck.fn { color: var(--mu); }
.ck.op { color: var(--ju); background: var(--ju-soft); border-color: #ecc9c1; }
.ck.eq { background: var(--k); color: #fff; border-color: var(--k); }
.t-calc.big { max-width: 420px; }
.t-calc.big .ck { height: 56px; font-size: 20px; }
.t-calc.big .calc-out { font-size: 34px; }
.t-calc.big .calc-screen { min-height: 78px; padding: 10px 12px; }

/* 글자수 */
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 10px 0 0; }
.cc-grid div { border-top: 1px solid var(--ln); padding-top: 5px; }
.cc-grid dt { font-size: 11px; color: var(--mu); font-weight: 700; }
.cc-grid dd { margin: 0; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tool-stage .cc-grid { grid-template-columns: repeat(3, 1fr); }
.tool-stage .cc-grid dd { font-size: 24px; }

/* D-day */
.t-dday .dd-out { font-size: 34px; font-weight: 800; color: var(--ju); letter-spacing: -.02em; margin-top: 10px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.t-dday .dd-sub { font-size: 12px; color: var(--mu); margin-top: 4px; }
.dd-add { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--ln); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dd-add h3 { grid-column: 1 / -1; margin: 0 !important; background: none !important; padding: 0 !important; color: var(--k) !important; font-size: 15px !important; }
.dd-add-out { grid-column: 1 / -1; margin: 0 !important; font-size: 14px; }
.dd-add-out output { font-size: 20px; margin-left: 6px; }

/* 퍼센트 */
.t-percent { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pc-box { border: 1px solid var(--ln); padding: 12px; background: var(--pa); }
.pc-box h3 { margin: 0 0 8px !important; padding: 0 !important; background: none !important; color: var(--k) !important; font-size: 14px !important; display: block !important; }
.pc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-box p { margin: 10px 0 0 !important; font-size: 13px; color: var(--mu); }
.pc-box output { font-size: 20px; color: var(--ju); margin-left: 6px; }

/* 평수 */
.py-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; }
.py-eq { font-size: 22px; color: var(--ju); font-weight: 800; padding-bottom: 6px; }
.py-row input { font-size: 22px !important; font-weight: 800; }
.py-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.py-quick button { font: inherit; font-size: 13px; font-weight: 700; padding: 5px 11px; border: 1px solid var(--ln); background: var(--pa); border-radius: 2px; cursor: pointer; }
.py-quick button:hover { border-color: var(--ju); color: var(--ju); }

/* 도구 페이지 */
.tool-page .tool-stage { margin: 22px 0 34px; }
.tool-page .tool-stage .tool { padding: 18px; }
.tool-page .t-clock .clk-time { font-size: 64px; }
.tool-page .t-dday .dd-out { font-size: 56px; }
.tool-page .t-age .cc-grid dd { font-size: 26px; }

@media (max-width: 860px) {
  .toolbox .tb-tabs, .toolbox [data-pane] { display: none !important; }
  .toolbox .tb-more { display: none; }
  .toolbox { border-top: none; padding-top: 0; }
  .toolbox .tb-link { display: inline-flex; }
  .t-percent { grid-template-columns: 1fr; }
  .clk-world { grid-template-columns: 1fr; }
  .tool-page .t-clock .clk-time { font-size: 46px; }
  .tool-stage .cc-grid { grid-template-columns: repeat(2, 1fr); }
  .py-row { grid-template-columns: 1fr; }
  .py-eq { display: none; }
}
.art-body a.ext { color: var(--k); border-bottom: 1px solid var(--ju); padding-bottom: 1px; white-space: nowrap; }
.art-body a.ext::after { content: " ↗"; color: var(--ju); font-size: .85em; }
.art-body a.ext:hover { color: var(--ju); }
