@charset "utf-8";
/* ============================================================
   NOCODE STUDIO — Tistory Skin
   Wanted Design System 기반 (Pretendard JP / #3366FF / radius 12)
   목록: 정사각 카드뉴스 그리드 + 호버 오버레이
   상세: 히어로 + 2단(본문/사이드) + TOC + 시리즈 + 댓글
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-jp.css');

/* ---------- 1. Tokens ---------- */
:root{
  --font-ui:"Pretendard JP Variable","Pretendard JP",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

  --accent:#3366FF;
  --accent-strong:#005EEB;
  --accent-soft:rgba(51,102,255,.10);
  --accent-on-dark:#8FB4FF;

  --ink:#171717;
  --body:rgba(46,47,51,.88);
  --muted:rgba(55,56,60,.61);
  --faint:rgba(55,56,60,.45);

  --line:rgba(112,115,124,.22);
  --line-soft:rgba(112,115,124,.12);

  --bg:#ffffff;
  --surface:#F4F5F7;
  --surface-2:#E7E9EE;
  --overlay:rgba(23,23,23,.86);

  --r-sm:8px;
  --r-md:12px;
  --r-pill:999px;

  --maxw:1280px;
  --gutter:40px;
  --header-h:64px;
}

/* ---------- 2. Reset ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--bg);color:var(--body);
  font-family:var(--font-ui);
  font-size:16px;line-height:1.6;
  -webkit-font-smoothing:antialiased;
  word-break:keep-all;overflow-wrap:anywhere;
}
img{max-width:100%;height:auto;border:0;vertical-align:top}
a{color:var(--accent);text-decoration:none}
a:hover{color:var(--accent-strong)}
h1,h2,h3,h4,p,figure,blockquote,pre{margin:0}
ul,ol{margin:0;padding:0;list-style:none}
button,input,textarea{font:inherit;color:inherit}
button{background:none;border:0;cursor:pointer;padding:0}
hr{border:0;border-top:1px solid var(--line);margin:32px 0}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
.a11y{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

.wrap{max-width:var(--maxw);margin:0 auto;padding:0 var(--gutter)}

/* ---------- 3. Header ---------- */
.hd{
  position:sticky;top:0;z-index:60;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(160%) blur(12px);
  border-bottom:1px solid var(--line);
}
.hd-in{
  max-width:var(--maxw);margin:0 auto;padding:0 var(--gutter);
  height:var(--header-h);display:flex;align-items:center;gap:24px;
}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-mark{width:26px;height:26px;border-radius:var(--r-sm);background:var(--accent);flex:none}
.brand-name{
  font-weight:700;font-size:18px;line-height:1;letter-spacing:-.023em;color:var(--ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.brand-name:hover{color:var(--ink)}
.brand-sub{
  font-family:var(--font-mono);font-weight:500;font-size:12px;line-height:1;
  color:var(--faint);padding-top:2px;white-space:nowrap;
}

.search{margin-left:auto;display:flex;align-items:center;gap:8px;width:240px;height:36px;padding:0 14px;border-radius:var(--r-pill);background:var(--surface);flex:none}
.search::before{content:"";width:14px;height:14px;border:1.6px solid var(--faint);border-radius:50%;flex:none}
.search input{
  width:100%;min-width:0;border:0;background:none;outline:none;
  font-weight:500;font-size:13px;line-height:1.4;color:var(--ink);
}
.search input::placeholder{color:var(--faint)}
.search button{width:0;height:0;overflow:hidden;opacity:0;position:absolute}


/* 읽기 진행 바 (상세) */
.progress{height:3px;background:var(--line-soft);position:sticky;top:var(--header-h);z-index:59}
.progress i{display:block;height:3px;width:0;background:var(--accent);transition:width .1s linear}

/* ---------- 4. 목록 : 히어로 ---------- */
.hero{
  max-width:var(--maxw);margin:0 auto;
  padding:44px var(--gutter) 28px;
  display:flex;align-items:flex-end;justify-content:space-between;gap:40px;
}
.hero-txt{max-width:760px;min-width:0}
.eyebrow{
  font-family:var(--font-mono);font-weight:600;font-size:13px;line-height:1.4;
  letter-spacing:.02em;color:var(--accent);margin-bottom:12px;
}
.hero h1{
  font-weight:700;font-size:36px;line-height:1.28;letter-spacing:-.027em;
  color:var(--ink);margin-bottom:12px;text-wrap:pretty;
}
.hero p{
  font-weight:400;font-size:16px;line-height:1.6;letter-spacing:.006em;
  color:var(--body);max-width:620px;text-wrap:pretty;
}
.stats{display:flex;gap:28px;padding-bottom:6px;flex:none}
.stats b{display:block;font-weight:700;font-size:24px;line-height:1.2;color:var(--ink)}
.stats span{display:block;font-weight:500;font-size:12px;line-height:1.4;color:var(--muted)}

/* ---------- 5. 목록 : 카테고리 칩 ---------- */
.chips{
  max-width:var(--maxw);margin:0 auto;
  padding:0 var(--gutter) 24px;display:flex;gap:8px;flex-wrap:wrap;align-items:center;
}
.chips ul{display:contents}
.chips li{display:contents}
.chips a,.chip{
  height:34px;padding:0 16px;display:inline-flex;align-items:center;
  border-radius:var(--r-pill);background:#fff;border:1px solid var(--line);
  color:var(--body);font-weight:500;font-size:14px;line-height:1;white-space:nowrap;
}
.chips a:hover,.chip:hover{border-color:var(--accent);color:var(--accent)}
.chips a.chip-on,.chip.chip-on,.chips li.selected>a{
  background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600;
}
.chips a.chip-on:hover,.chip.chip-on:hover,.chips li.selected>a:hover{background:var(--accent-strong);color:#fff}
/* 티스토리 [##_category_list_##] 출력(tt_category)을 칩으로 평탄화 */
.chips .tt_category,
.chips .tt_category ul,
.chips .tt_category li{display:contents}
.chips .tt_category .link_tit{display:none}   /* "분류 전체보기"는 전체 칩으로 대체 */
.chips .tt_category .link_sub_item{background:var(--surface);border-color:transparent}
.chips .c_cnt,.chips .cnt{opacity:.7;margin-left:2px;font-variant-numeric:tabular-nums;font-size:12px}
/* 하위 카테고리는 기본 숨김 — 상위 선택 시 JS가 아래 줄(.chips-sub)로 복제 */
.chips .tt_category .sub_category_list{display:none}
.chips-sub{padding-top:0;margin-top:-12px}
.chips-sub a{background:var(--surface);border-color:transparent;height:32px;font-size:13px}
.chips-sub a.chip-on{background:var(--accent);color:#fff}
.sort{margin-left:auto;font-weight:500;font-size:13px;line-height:1.4;color:var(--muted);white-space:nowrap}

/* ---------- 6. 목록 : 그리드 ---------- */
.grid{
  max-width:var(--maxw);margin:0 auto;
  padding:0 var(--gutter) 8px;
  display:grid;grid-template-columns:repeat(3,1fr);gap:0;
}
.card{position:relative;min-width:0}
.card-link{display:block;color:inherit}
.card-thumb{
  position:relative;aspect-ratio:1/1;overflow:hidden;
  outline:1px solid var(--line);outline-offset:-1px;
  background-image:repeating-linear-gradient(135deg,#F4F5F7 0 9px,#E7E9EE 9px 18px);
}
.card-thumb img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .5s cubic-bezier(.2,.8,.2,1)}
.card:hover .card-thumb img{transform:scale(1.04)}
/* 썸네일이 없는 글 : 제목을 플레이스홀더에 노출 */
.card-fallback{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  text-align:center;padding:28px;
  font-weight:700;font-size:18px;line-height:1.45;letter-spacing:-.02em;color:var(--ink);
  text-wrap:pretty;
}
.card-thumb:has(img) .card-fallback{display:none}
.ph{
  position:absolute;inset:0;
  background-image:repeating-linear-gradient(135deg,#F4F5F7 0 9px,#E7E9EE 9px 18px);
  display:flex;align-items:center;justify-content:center;text-align:center;padding:16px;
  font-family:var(--font-mono);font-weight:500;font-size:12px;line-height:1.4;color:var(--faint);
}
.badge{
  position:absolute;top:14px;left:14px;z-index:2;
  height:26px;padding:0 10px;display:inline-flex;align-items:center;
  border-radius:var(--r-sm);background:var(--ink);color:#fff;
  font-weight:600;font-size:12px;line-height:1;letter-spacing:.01em;
}
.badge-alt{background:#fff;color:var(--ink)}

.card-ov{
  position:absolute;inset:0;z-index:1;
  opacity:0;transition:opacity .18s ease;
  background:var(--overlay);
  display:flex;flex-direction:column;justify-content:flex-end;padding:24px;
}
.card:hover .card-ov,.card:focus-within .card-ov{opacity:1}
.card-eyebrow{
  font-family:var(--font-mono);font-weight:600;font-size:12px;line-height:1.4;
  color:var(--accent-on-dark);margin-bottom:8px;
}
.card-title{
  font-weight:700;font-size:22px;line-height:1.4;letter-spacing:-.023em;
  color:#fff;margin-bottom:8px;text-wrap:pretty;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}
.card-desc{
  font-weight:400;font-size:14px;line-height:1.55;color:rgba(255,255,255,.7);
  margin-bottom:12px;text-wrap:pretty;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.card-meta{font-weight:500;font-size:12px;line-height:1.4;color:rgba(255,255,255,.55)}

/* 목록 비었을 때 */
.empty{max-width:var(--maxw);margin:0 auto;padding:80px var(--gutter);text-align:center;color:var(--muted)}

/* ---------- 7. 목록 : 더 보기 / 페이징 ---------- */
.more{
  max-width:var(--maxw);margin:0 auto;
  padding:28px var(--gutter) 40px;
  display:flex;flex-direction:column;align-items:center;gap:10px;
}
.more-btn{
  height:44px;padding:0 28px;display:inline-flex;align-items:center;
  border-radius:var(--r-md);border:1px solid var(--line);
  font-weight:600;font-size:15px;line-height:1;color:var(--ink);
}
.more-btn:hover{border-color:var(--accent);color:var(--accent)}
.more-note{font-weight:500;font-size:12px;line-height:1.4;color:var(--faint)}
.paging{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:center}
.paging a{
  min-width:36px;height:36px;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:var(--r-sm);font-weight:600;font-size:14px;color:var(--body);
}
.paging a span{display:contents}
.paging a:hover{background:var(--surface);color:var(--ink)}
.paging a:has(.selected),.paging a.selected{background:var(--accent);color:#fff}
.paging a:has(.selected):hover{background:var(--accent-strong);color:#fff}
/* 첫/마지막 페이지에서 이전·다음 비활성화 */
.paging .no-more-prev,.paging .no-more-next{opacity:.35;pointer-events:none}

/* ---------- 8. 상세 : 히어로 ---------- */
.detail{max-width:var(--maxw);margin:0 auto}
.dt-head{padding:40px var(--gutter) 32px}
/* 대표 이미지 옆에 제목 묶음을 아래쪽 끝에 맞춰 정렬 */
.dt-headinner{display:flex;gap:40px;align-items:flex-end;min-width:0}
.dt-hero{
  width:400px;height:400px;flex:none;border-radius:var(--r-md);overflow:hidden;position:relative;
  background-image:repeating-linear-gradient(135deg,#F4F5F7 0 9px,#E7E9EE 9px 18px);
}
.dt-hero img{width:100%;height:100%;object-fit:cover}
/* 대표 이미지가 없으면 히어로를 접고 텍스트를 전폭으로 */
.dt-head:not(:has(.dt-hero img)) .dt-hero{display:none}
.dt-headtxt{flex:1;min-width:0;display:flex;flex-direction:column}
.tagline{display:flex;align-items:center;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.cat-pill{
  height:28px;padding:0 12px;display:inline-flex;align-items:center;
  border-radius:9px;background:var(--accent-soft);color:var(--accent);
  font-weight:600;font-size:13px;line-height:1;
}
.series-mark{font-family:var(--font-mono);font-weight:600;font-size:13px;line-height:1.4;color:var(--muted)}
.dt-title{
  font-weight:700;font-size:40px;line-height:1.3;letter-spacing:-.027em;
  color:var(--ink);margin-bottom:14px;text-wrap:pretty;
}
.dt-lead{
  font-weight:400;font-size:17px;line-height:1.6;letter-spacing:.006em;
  color:var(--body);margin-bottom:24px;text-wrap:pretty;
}
.dt-by{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:auto;flex-wrap:wrap}
.by{display:flex;align-items:center;gap:12px}
.by-av{width:44px;height:44px;border-radius:50%;background:var(--surface-2);flex:none;overflow:hidden}
.by-av img{width:100%;height:100%;object-fit:cover}
.by-name{font-weight:600;font-size:15px;line-height:1.4;color:var(--ink)}
.by-meta{font-weight:500;font-size:13px;line-height:1.4;color:var(--muted)}
.acts{display:flex;gap:8px}
.act{
  width:40px;height:40px;border-radius:var(--r-md);border:1px solid var(--line);
  display:inline-flex;align-items:center;justify-content:center;
  font-weight:600;font-size:13px;line-height:1;color:var(--body);
}
.act:hover{border-color:var(--accent);color:var(--accent)}
.act.on{border-color:var(--accent);background:var(--accent);color:#fff}
.act-wide{width:auto;padding:0 16px}

/* ---------- 9. 상세 : 본문 + 사이드 ---------- */
.dt-body{display:flex;gap:40px;padding:32px var(--gutter) 40px;border-top:1px solid var(--line);align-items:flex-start}
.dt-main{flex:1;min-width:0;max-width:100%}
.dt-side{
  width:300px;flex:none;display:flex;flex-direction:column;gap:24px;
  position:sticky;top:calc(var(--header-h) + 24px);
  max-height:calc(100vh - var(--header-h) - 48px);overflow-y:auto;
  scrollbar-width:none;
}
.dt-side::-webkit-scrollbar{display:none}

/* 넓은 화면 : 본문만 화면 중앙 정렬, 사이드바는 그 오른쪽 */
@media (min-width:1240px){
  .dt-body{
    display:grid;
    grid-template-columns:minmax(0,1fr) 680px minmax(0,1fr);
    column-gap:32px;align-items:start;
  }
  .dt-main{grid-column:2;min-width:0}
  .dt-side{grid-column:3;justify-self:start;width:100%;max-width:300px}
}

/* 본문 타이포 (에디터 출력물) */
.entry{font-weight:400;font-size:17px;line-height:1.75;letter-spacing:.006em;color:var(--body)}
.entry > *{margin-bottom:16px}
.entry h2{
  font-weight:700;font-size:24px;line-height:1.35;letter-spacing:-.023em;color:var(--ink);
  margin:36px 0 12px;scroll-margin-top:calc(var(--header-h) + 20px);
}
.entry h3{
  font-weight:700;font-size:19px;line-height:1.45;letter-spacing:-.02em;color:var(--ink);
  margin:28px 0 10px;scroll-margin-top:calc(var(--header-h) + 20px);
}
.entry h4{font-weight:600;font-size:17px;color:var(--ink);margin:24px 0 8px}
.entry p{margin:0 0 16px}
.entry strong,.entry b{font-weight:600;color:var(--ink)}
.entry a{text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.entry ul,.entry ol{margin:0 0 20px;padding-left:22px}
.entry ul{list-style:disc}
.entry ol{list-style:decimal}
.entry li{margin:6px 0}
.entry li::marker{color:var(--faint)}
.entry img,.entry video,.entry iframe{border-radius:var(--r-md);max-width:100%}
.entry figure{margin:0 0 24px}
.entry figcaption,.entry .caption{
  font-weight:500;font-size:13px;line-height:1.5;color:var(--faint);margin-top:10px;text-align:left;
}
.entry blockquote{
  border-left:3px solid var(--accent);padding:4px 0 4px 20px;margin:0 0 24px;
  font-weight:600;font-size:18px;line-height:1.6;color:var(--ink);text-wrap:pretty;
}
.entry blockquote p{margin:0}
.entry pre{
  border-radius:var(--r-md);background:var(--ink);padding:20px;margin:0 0 10px;
  overflow-x:auto;max-width:100%;
  font-family:var(--font-mono);font-weight:500;font-size:14px;line-height:1.7;color:var(--surface-2);
}
/* 본문에 직접 넣은 광고가 좁은 화면을 밀어내지 않도록 */
.entry ins.adsbygoogle{display:block;max-width:100%}
.entry pre code{background:none;padding:0;color:inherit;font-size:inherit}
.entry code{
  font-family:var(--font-mono);font-size:.9em;background:var(--surface);
  padding:2px 6px;border-radius:6px;color:var(--ink);
}
.entry table{width:100%;border-collapse:collapse;margin:0 0 24px;font-size:15px}
.entry th,.entry td{border:1px solid var(--line);padding:10px 12px;text-align:left}
.entry th{background:var(--surface);font-weight:600;color:var(--ink)}
.entry hr{margin:36px 0}

/* 태그 */
.tags{display:flex;flex-wrap:wrap;gap:8px;margin:28px 0 0}
.tags a{
  height:32px;padding:0 14px;display:inline-flex;align-items:center;border-radius:var(--r-pill);
  background:var(--surface);color:var(--body);font-weight:500;font-size:13px;line-height:1;
}
.tags a:hover{background:var(--accent-soft);color:var(--accent)}

/* 이전/다음 글 */
.adjacent{display:flex;gap:16px;margin:36px 0}
.adjacent > *{flex:1;min-width:0;border:1px solid var(--line);border-radius:var(--r-md);padding:20px;color:inherit}
.adjacent > *:hover{border-color:var(--accent)}
/* 이전·다음 글이 모두 없으면 영역째로 숨김 */
.adjacent:not(:has(a.pv, a.nx)){display:none}
.adjacent .nx{text-align:right}
.adj-lb{font-weight:500;font-size:12px;line-height:1.4;color:var(--faint);margin-bottom:8px}
.adj-tt{font-weight:600;font-size:15px;line-height:1.45;color:var(--ink);text-wrap:pretty}

/* 섹션 타이틀 */
.sec-tt{font-weight:700;font-size:18px;line-height:1.4;color:var(--ink);margin:0 0 16px}

/* 관련 글 */
.rel{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:0 0 36px}
.rel-it{display:flex;gap:14px;align-items:center;color:inherit;min-width:0}
.rel-th{
  width:84px;height:84px;flex:none;border-radius:var(--r-md);overflow:hidden;position:relative;
  background-image:repeating-linear-gradient(135deg,#F4F5F7 0 9px,#E7E9EE 9px 18px);
}
.rel-th img{width:100%;height:100%;object-fit:cover}
.rel-tt{font-weight:600;font-size:15px;line-height:1.45;color:var(--ink);text-wrap:pretty}
.rel-it:hover .rel-tt{color:var(--accent)}
.rel-mt{display:block;font-weight:500;font-size:12px;line-height:1.4;color:var(--faint);margin-top:6px}
.rel-txt{min-width:0}

/* 댓글 */
.cmt-cnt{color:var(--accent)}
.cmt-ol,.cmt-replies{list-style:none;margin:0;padding:0}
.cmt-li{margin:0 0 4px}
.cmt-replies{padding-left:52px}
.cmt-replies .cmt-av{width:32px;height:32px;background:var(--surface)}
.cmt-body{flex:1;min-width:0}
.cmt-form{display:flex;gap:12px;margin:8px 0 24px;align-items:flex-start}
.cmt-av{width:40px;height:40px;border-radius:50%;background:var(--surface-2);flex:none;overflow:hidden;display:inline-flex}
.cmt-av img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.cmt-fields{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}
.cmt-secret{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.cmt-secret input{accent-color:var(--accent)}
/* 비밀 댓글 */
.cmt.hidden_comment .cmt-txt,.cmt.secret .cmt-txt{color:var(--faint)}
.cmt-ta{
  width:100%;min-height:48px;border:1px solid var(--line);border-radius:var(--r-md);
  padding:13px 16px;font-size:15px;line-height:1.5;resize:vertical;background:#fff;outline:none;
}
.cmt-ta:focus{border-color:var(--accent)}
.cmt-ta::placeholder{color:var(--faint)}
.cmt-guest{display:flex;gap:8px;flex-wrap:wrap}
.cmt-guest input{
  height:40px;border:1px solid var(--line);border-radius:var(--r-sm);padding:0 12px;
  font-size:14px;background:#fff;outline:none;min-width:0;flex:1;
}
.cmt-guest input:focus{border-color:var(--accent)}
.cmt-guest label{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.cmt-submit{
  height:48px;padding:0 24px;border-radius:var(--r-md);background:var(--accent);color:#fff;
  font-weight:600;font-size:15px;line-height:1;flex:none;align-self:flex-start;
  border:0;outline:none;appearance:none;-webkit-appearance:none;cursor:pointer;
}
.cmt-submit:hover{background:var(--accent-strong)}
.cmt-submit:focus-visible{outline:2px solid var(--accent-strong);outline-offset:2px}
.cmt{display:flex;gap:12px;margin:0 0 20px}
.cmt.is-reply .cmt-av{width:32px;height:32px;background:var(--surface)}
.cmt-name{font-weight:600;font-size:14px;line-height:1.45;color:var(--ink)}
.cmt-when{font-weight:500;font-size:12px;line-height:1.45;color:var(--faint);margin-left:6px}
.cmt-author{font-weight:600;font-size:11px;line-height:1;color:var(--accent);margin-left:6px}
.cmt-txt{margin:6px 0 0;font-weight:400;font-size:15px;line-height:1.65;color:var(--body);text-wrap:pretty}
.cmt-tools{margin-top:6px;display:flex;gap:10px;font-size:12px;color:var(--faint)}
.cmt-tools a{color:var(--faint)}
.cmt-tools a:hover{color:var(--accent)}

/* 보호글 */
.locked{border:1px solid var(--line);border-radius:var(--r-md);padding:40px;text-align:center}
.locked input{height:44px;border:1px solid var(--line);border-radius:var(--r-sm);padding:0 14px;margin:0 8px 0 0}

/* ---------- 10. 상세 : 사이드 ---------- */
.side-card{border:1px solid var(--line);border-radius:var(--r-md);padding:20px}
.side-prof{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.side-prof .by-av{width:48px;height:48px}
.side-prof b{display:block;font-weight:600;font-size:15px;line-height:1.4;color:var(--ink)}
.side-prof span{display:block;font-family:var(--font-mono);font-weight:500;font-size:12px;line-height:1.4;color:var(--muted)}
.side-bio{font-weight:400;font-size:14px;line-height:1.6;color:var(--body);margin-bottom:16px;text-wrap:pretty}
.side-stats{
  display:flex;gap:20px;padding-top:14px;border-top:1px solid var(--line-soft);
}
.side-stats b{display:block;font-weight:700;font-size:17px;line-height:1.3;color:var(--ink);font-variant-numeric:tabular-nums}
.side-stats span{display:block;font-weight:500;font-size:11px;line-height:1.4;color:var(--muted)}

.side-lb{
  font-family:var(--font-mono);font-weight:600;font-size:12px;line-height:1.4;
  letter-spacing:.04em;color:var(--muted);margin-bottom:12px;
}
.toc{border-left:2px solid var(--line);display:flex;flex-direction:column;gap:10px;padding-left:14px}
.toc a{font-weight:500;font-size:14px;line-height:1.45;color:var(--body);text-wrap:pretty}
.toc a.lv3{padding-left:10px}
.toc a:hover{color:var(--accent)}
.toc a.on{font-weight:600;color:var(--accent)}

.series-mark{display:none}
.side-share{display:none}
.side-series{border:1px dashed rgba(112,115,124,.4);border-radius:var(--r-md);padding:20px}
.side-series b{display:block;font-weight:600;font-size:14px;line-height:1.4;color:var(--ink);margin-bottom:12px}
.side-series ol{display:flex;flex-direction:column;gap:9px}
.side-series a{font-weight:500;font-size:13px;line-height:1.5;color:var(--body);text-wrap:pretty}
.side-series a:hover{color:var(--accent)}
.side-series .now{font-weight:600;color:var(--accent)}

.side-ad{border-radius:var(--r-md);overflow:hidden;position:relative;min-height:250px}
.side-share{font-weight:500;font-size:13px;line-height:1.4;color:var(--muted);display:flex;gap:10px;flex-wrap:wrap}
.side-share button{color:var(--muted)}
.side-share button:hover{color:var(--accent)}


/* ---------- 10-b. 광고 (애드센스) ---------- */
.ad{margin:36px 0}
.ad ins{display:block;width:100%}
/* 목록 페이지 : 본문 폭에 맞춰 가운데 */
.ad-list{max-width:var(--maxw);margin:8px auto 0;padding:0 var(--gutter)}
/* 사이드바 : 카드와 같은 리듬 */
.ad-side{margin:0}
/* 사이드바에 광고가 있으면 스크롤 클리핑을 풀어 광고가 잘리지 않게 한다 */
.dt-side.has-ad{max-height:none;overflow:visible}
/* 티스토리가 채워 주는 목록 광고 영역 여백 */
[id^=revenue_],.revenue_unit_wrap{margin:24px 0}

/* ---------- 11. 티스토리 자동 삽입 요소 정리 ---------- */
/* '카테고리의 다른 글' 박스 숨김 (관련 글 섹션으로 대체) */
.another_category{display:none!important}
/* 본문 아래 자동 삽입되는 블로그 네임카드 숨김 */
[data-tistory-react-app="Namecard"],.tt_box_namecard{display:none!important}

/* 티스토리가 각 그룹 치환자 앞에 끼워 넣는 빈 앵커(<a href=""> </a>) 무력화.
   공백 텍스트가 들어 있어 :empty로는 안 잡히므로 href로 걸러낸다.
   주의 — 이 앵커는 뒤따르는 마크업(이전/다음 글·관련 글·댓글)을 자식으로
   삼켜버리는 경우가 있다. display:none으로 지우면 댓글까지 사라지므로,
   자식 요소가 있으면 display:contents로 박스만 없애고 내용은 그대로 흐르게 한다. */
.dt-main > a[href=""]:has(*),
.tags > a[href=""]:has(*),
.rel > a[href=""]:has(*){display:contents}
.dt-main > a[href=""]:not(:has(*)),
.tags > a[href=""]:not(:has(*)),
.adjacent > a[href=""]:not(:has(*)),
.rel > a[href=""]:not(:has(*)),
.cmt-ol > a[href=""]:not(:has(*)),
.tag-cloud > a[href=""]:not(:has(*)){display:none}
/* 태그가 하나도 없으면 태그 영역 자체를 숨김 */
.dt-main .tags:not(:has(a:not([href=""]))){display:none}

/* 모바일 전용 요소 (기본 숨김) */
.actionbar,.mtoc{display:none}

/* ---------- 12. 반응형 : 태블릿 ---------- */
@media (max-width:1100px){
  :root{--gutter:28px}
  .grid{grid-template-columns:repeat(3,1fr)}
  .dt-hero{width:320px;height:320px}
  .dt-title{font-size:34px}
  .dt-side{width:264px}
}
@media (max-width:960px){
  /* 세로로 쌓일 때 stretch로 되돌리지 않으면 본문이 코드블록 너비만큼
     늘어나 글이 화면 밖으로 밀려난다 */
  .dt-body{flex-direction:column;gap:32px;align-items:stretch}
  .dt-side{width:100%;flex-direction:row;flex-wrap:wrap;position:static;max-height:none;overflow:visible}
  .dt-side > *{flex:1;min-width:260px}
  .search{width:180px}
}

/* ---------- 13. 반응형 : 모바일 390 ---------- */
@media (max-width:768px){
  :root{--gutter:20px;--header-h:56px}

  .hd-in{gap:12px}
  .search{width:150px;flex:1;min-width:0}

  .hero{flex-direction:column;align-items:stretch;gap:16px;padding:24px var(--gutter) 16px}
  .hero h1{font-size:26px;line-height:1.32}
  .hero p{font-size:14px}
  .stats{gap:20px;padding:0}
  .stats b{font-size:18px}

  .chips{padding:0 var(--gutter) 16px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .chips::-webkit-scrollbar{display:none}
  .chips a,.chip{height:32px;padding:0 14px;font-size:13px;flex:none}
  .sort{display:none}

  /* PC와 동일한 3열 정사각 타일 · 간격 0 · 화면 끝까지 (9개 = 3×3)
     터치 기기에는 호버가 없으므로 오버레이 없이 썸네일만 노출하고,
     탭하면 바로 글로 이동한다. */
  .grid{grid-template-columns:repeat(3,1fr);gap:0;padding:0}
  .card-thumb{border-radius:0}
  .card-fallback{font-size:12px;line-height:1.35;padding:10px}
  .badge{top:8px;left:8px;height:22px;padding:0 8px;border-radius:7px;font-size:11px}
  .card-ov{display:none}

  .more{padding:24px var(--gutter) 20px}
  .more-btn{width:100%;justify-content:center}

  /* 상세 */
  /* PC와 같은 구조 : 왼쪽 썸네일 + 오른쪽에 카테고리·제목(아래쪽 정렬),
     작성자 줄만 그 아래 전체 폭으로. display:contents로 마크업 변경 없이 배치. */
  .dt-head{padding:20px var(--gutter) 16px}
  .dt-headinner{
    display:grid;
    grid-template-columns:118px minmax(0,1fr);
    grid-template-rows:1fr auto auto auto;   /* 1행은 빈 여백 흡수용 */
    gap:0 14px;align-items:stretch;          /* 기본 flex의 gap:40px 초기화 */
  }
  .dt-hero{grid-column:1;grid-row:1 / 4;width:118px;height:118px;border-radius:var(--r-md)}
  .dt-headtxt{display:contents}
  .tagline{grid-column:2;grid-row:2;margin:0 0 8px}
  .cat-pill{height:22px;padding:0 9px;font-size:11px;border-radius:7px}
  .dt-title{grid-column:2;grid-row:3;font-size:18px;line-height:1.35;margin:0}
  /* 좁은 칸에서는 요약문을 접는다 */
  .dt-lead{display:none}
  .dt-by{
    grid-column:1 / -1;grid-row:4;
    margin:14px 0 0;padding-bottom:16px;
    border-bottom:1px solid var(--line);
  }
  .by-av{width:32px;height:32px}
  .by-name{font-size:13px}
  .by-meta{font-size:11px}
  .acts{display:none}
  /* 대표 이미지가 없으면 텍스트가 전폭을 쓰도록 */
  .dt-head:not(:has(.dt-hero img)) .dt-headinner{grid-template-columns:minmax(0,1fr)}
  .dt-head:not(:has(.dt-hero img)) .tagline,
  .dt-head:not(:has(.dt-hero img)) .dt-title{grid-column:1}

  .dt-body{padding:20px var(--gutter) 0;border-top:0}
  .entry{font-size:16px}
  .entry h2{font-size:20px;margin:24px 0 10px}
  .entry h3{font-size:17px}
  .entry pre{padding:16px;font-size:12px}
  /* 열이 많은 표는 잘리지 않게 가로 스크롤 */
  .entry table{display:block;width:100%;overflow-x:auto}
  .adjacent{flex-direction:column;gap:12px;margin:24px 0}
  .adjacent .nx{text-align:left}
  .rel{grid-template-columns:1fr;gap:12px}
  .cmt-submit{align-self:stretch;justify-content:center}

  .dt-side{flex-direction:column;gap:20px}
  .dt-side > *{min-width:0}
  .side-toc{display:none}

  /* 하단 고정 액션바 (상세 전용) */
  body.has-actionbar{padding-bottom:64px}
  .actionbar{
    display:flex;position:fixed;left:0;right:0;bottom:0;z-index:70;height:64px;
    background:#fff;border-top:1px solid var(--line);
    align-items:center;gap:10px;padding:0 20px;
  }
  .actionbar .ab-l{display:flex;gap:20px;font-weight:600;font-size:14px;line-height:1;color:var(--body)}
  .actionbar .ab-l button:hover{color:var(--accent)}
  .mtoc{
    display:block;position:fixed;inset:auto 0 0 0;z-index:80;background:#fff;border-radius:20px 20px 0 0;
    box-shadow:0 -8px 40px rgba(0,0,0,.18);padding:20px 20px 28px;transform:translateY(101%);
    transition:transform .24s cubic-bezier(.2,.8,.2,1);max-height:70vh;overflow:auto;
  }
  .mtoc.open{transform:translateY(0)}
  .mtoc .toc{border-left:0;padding-left:0}
  .mtoc .toc a{padding:8px 0;font-size:15px}
}

@media (max-width:420px){
  .card-fallback{font-size:11px;padding:8px}
}

/* ---------- 14. 페이지 타입별 노출 제어 (body id) ----------
   tt-body-index / category / archive / tag / search : 목록
   tt-body-page : 개별 글(상세)                                   */
#tt-body-page .hero,
#tt-body-page .chips,
#tt-body-page .chips-sub,
#tt-body-page .more{display:none}
#tt-body-page .grid{display:block;padding:0;max-width:none}

#tt-body-index .progress,
#tt-body-category .progress,
#tt-body-archive .progress,
#tt-body-tag .progress,
#tt-body-search .progress,
#tt-body-guestbook .progress,
#tt-body-location .progress,
#tt-body-index .actionbar,
#tt-body-category .actionbar,
#tt-body-archive .actionbar,
#tt-body-tag .actionbar,
#tt-body-search .actionbar,
#tt-body-guestbook .actionbar,
#tt-body-location .actionbar,
#tt-body-guestbook .hero,
#tt-body-guestbook .chips,
#tt-body-guestbook .chips-sub,
#tt-body-guestbook .more{display:none}

/* 검색/태그/카테고리 페이지에서는 히어로 문구를 컴팩트하게 */
#tt-body-search .hero,
#tt-body-tag .hero,
#tt-body-archive .hero{padding-top:32px}

/* 태그 목록 페이지 : 그리드·페이징 숨김, 태그 클라우드만 */
#tt-body-tag .more{display:none}
.tag-cloud{margin:0}
.tag-cloud a.cloud1{background:var(--accent);color:#fff;font-weight:600}
.tag-cloud a.cloud2{background:var(--accent-soft);color:var(--accent);font-weight:600}
.tag-cloud a.cloud1:hover,.tag-cloud a.cloud2:hover{color:#fff;background:var(--accent-strong)}


/* ---------- 15. 기타 ---------- */
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}
@media print{
  .hd,.progress,.dt-side,.actionbar,.more{display:none!important}
  .dt-body{display:block;padding:0}
}
