/* ==========================================================================
   상담자료 (consult.html) — 네이비 · 샴페인 골드 · 아이보리 종이
   색·글꼴 변수는 home/home.css, 자료 블록 모양은 library/library.css 를 그대로 씁니다.
   ========================================================================== */
.cs {
  --cs-bg: #0B1626;
  --cs-bg2: #12233A;
  --cs-gold: #C9A96E;
  --cs-gold-2: #E6CFA0;
  --cs-ivory: #FBF8F2;
  --cs-line: rgba(201, 169, 110, .28);
  --cs-top-h: 64px;
  --cs-nav-h: 74px;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 169, 110, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(62, 95, 134, .35), transparent 60%),
    linear-gradient(180deg, var(--cs-bg2), var(--cs-bg));
  color: #EDE6D8;
  font-family: var(--sans);
}
html:has(body.cs) { background: #0B1626; }
/* display 를 준 요소도 hidden 이면 숨겨요 */
.cs [hidden] { display: none !important; }
.cs-top .li, .cs-cover .li, .cs-nav .li, .cs-toc .li { display: inline-block; width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }

/* ---------- 위쪽 막대 ---------- */
.cs-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: var(--cs-top-h); padding: 0 clamp(14px, 3vw, 28px);
  background: rgba(8, 17, 30, .78);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cs-line);
}
.cs-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex: none; }
.cs-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--cs-gold); color: var(--cs-gold-2);
  font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: 0;
}
.cs-brand-t { display: flex; flex-direction: column; line-height: 1.2; }
.cs-brand-t b { font-family: var(--serif); font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .02em; }
.cs-brand-t small { font-size: 11.5px; color: rgba(237, 230, 216, .62); letter-spacing: .02em; }
.cs-now { flex: 1; min-width: 0; margin: 0; display: flex; align-items: baseline; justify-content: center; gap: 10px; overflow: hidden; white-space: nowrap; }
.cs-now span { font-size: 12px; color: var(--cs-gold); letter-spacing: .08em; }
.cs-now b { font-weight: 600; font-size: 14.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.cs-actions { display: flex; gap: 6px; flex: none; }
.cs-ic {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(237, 230, 216, .18); background: rgba(255, 255, 255, .04);
  color: #EDE6D8; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: border-color .2s, background .2s, color .2s;
}
.cs-ic:hover { border-color: var(--cs-gold); color: #fff; background: rgba(201, 169, 110, .1); }
.cs-ic[aria-pressed="true"], .cs-ic[aria-expanded="true"] { border-color: var(--cs-gold); color: var(--cs-gold-2); }
.cs-ic:focus-visible, .cs-arrow:focus-visible, .cs-fold:focus-visible, .cs-feat:focus-visible { outline: 2px solid var(--cs-gold-2); outline-offset: 2px; }

/* ---------- 처음 화면 ---------- */
.cs-cover { padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px) 60px; }
.cs-cover-in { max-width: 1160px; margin: 0 auto; }
.cs-kicker { margin: 0 0 14px; font-size: 12px; letter-spacing: .34em; color: var(--cs-gold); font-weight: 600; }
.cs-h1 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 1.2rem + 3.4vw, 3.6rem); line-height: 1.22; color: #fff; letter-spacing: -0.01em; }
.cs-h1 em { font-style: normal; color: var(--cs-gold-2); }
.cs-lead { max-width: 640px; margin: 18px 0 0; font-size: 17px; line-height: 1.75; color: rgba(237, 230, 216, .78); }
.cs-sec-t { margin: 0 0 12px; font-size: 12px; letter-spacing: .2em; color: var(--cs-gold); font-weight: 600; }
.cs-feature { margin-top: 38px; }
.cs-feat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cs-feat {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  border: 1px solid var(--cs-line); color: inherit; text-decoration: none;
  transition: transform .25s var(--ease-out), border-color .25s, background .25s;
}
.cs-feat:hover { transform: translateY(-2px); border-color: var(--cs-gold); background: linear-gradient(135deg, rgba(201, 169, 110, .16), rgba(255, 255, 255, .03)); }
.cs-feat-i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; background: linear-gradient(135deg, var(--g1), var(--g3)); color: #fff; }
.cs-feat-i .li { width: 22px; height: 22px; }
.cs-feat-b { display: flex; flex-direction: column; min-width: 0; }
.cs-feat-b b { font-size: 16px; color: #fff; font-weight: 700; }
.cs-feat-b small { font-size: 12.5px; color: rgba(237, 230, 216, .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-folders { margin-top: 38px; }
.cs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cs-fold {
  position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--cs-line); color: inherit; text-decoration: none;
  transition: transform .3s var(--ease-out), border-color .3s, box-shadow .3s;
}
.cs-fold:hover { transform: translateY(-3px); border-color: var(--cs-gold); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.cs-fold-art { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3)); padding: 10px 18px 0; }
.cs-fold-art svg { width: 100%; height: 100%; display: block; }
.cs-fold-b { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.cs-fold-n { font-family: var(--serif); font-size: 13px; color: var(--cs-gold); letter-spacing: .1em; }
.cs-fold-b b { font-size: 17px; color: #fff; font-weight: 700; }
.cs-fold-b small { font-size: 13px; line-height: 1.55; color: rgba(237, 230, 216, .66); }
.cs-fold-b em { margin-top: 6px; font-style: normal; font-size: 12.5px; color: var(--cs-gold-2); font-weight: 600; }
.cs-foot-note { margin: 36px 0 0; font-size: 12.5px; color: rgba(237, 230, 216, .5); }

/* 폴더 안 주제 목록 */
.cs-shelf { max-width: 900px; }
.cs-back { display: inline-flex; align-items: center; gap: 4px; color: var(--cs-gold-2); text-decoration: none; font-size: 14px; font-weight: 600; }
.cs-back:hover { color: #fff; }
.cs-shelf-h { display: flex; align-items: center; gap: 18px; margin: 18px 0 22px; }
.cs-shelf-art { width: 120px; flex: none; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, var(--g1), var(--g3)); padding: 6px 10px 0; }
.cs-shelf-art svg { display: block; width: 100%; height: auto; }
.cs-shelf-h h2 { margin: 0; font-family: var(--serif); font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); color: #fff; font-weight: 700; }
.cs-shelf-h .cs-sec-t { margin: 0 0 6px; letter-spacing: .04em; font-size: 13px; }
.cs-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cs-topics a {
  display: grid; grid-template-columns: 30px 40px minmax(0, 1fr) 24px; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--cs-line); background: rgba(255, 255, 255, .04);
  color: inherit; text-decoration: none; transition: border-color .2s, background .2s;
}
.cs-topics a:hover { border-color: var(--cs-gold); background: rgba(201, 169, 110, .1); }
.cs-tn { font-family: var(--serif); color: var(--cs-gold); font-size: 15px; text-align: center; }
.cs-ti { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, var(--g1), var(--g3)); color: #fff; }
.cs-ti .li { width: 20px; height: 20px; }
.cs-tt { display: flex; flex-direction: column; min-width: 0; }
.cs-tt b { font-size: 16px; color: #fff; }
.cs-tt small { font-size: 13px; color: rgba(237, 230, 216, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-go { color: var(--cs-gold-2); }

/* ---------- 넘겨 보기 ---------- */
.cs.is-deck { overflow: hidden; }
.cs-deck { display: flex; flex-direction: column; height: calc(100vh - var(--cs-top-h)); height: calc(100dvh - var(--cs-top-h)); }
.cs-stage { flex: 1; min-height: 0; display: flex; justify-content: center; padding: clamp(12px, 2.4vh, 26px) clamp(10px, 3vw, 36px) 8px; touch-action: pan-y; }
.cs-paper {
  position: relative; width: 100%; max-width: 1080px; height: 100%;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--cs-ivory); color: var(--ink); border-radius: 22px;
  padding: clamp(22px, 3.6vh, 40px) clamp(20px, 4vw, 56px) clamp(22px, 3.6vh, 36px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(201, 169, 110, .35);
  outline: none;
}
.cs-paper::before { content: ""; position: absolute; left: clamp(20px, 4vw, 56px); right: clamp(20px, 4vw, 56px); top: 0; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, transparent, var(--cs-gold), transparent); }
.cs-paper .cs-u { display: flow-root; }
.cs-paper .cs-u + .cs-u { margin-top: 18px; }
.cs-paper .cs-u > .m-block { margin-top: 0; }
.cs-cont { font-family: var(--sans); font-size: .8em; font-weight: 600; color: var(--slate); }
.cs-src { margin: 10px 2px 0; font-size: 12.5px; color: var(--slate); }
.cs-paper.is-in { animation: cs-in .45s var(--ease-out) both; }
.cs-paper.is-in.from-l { animation-name: cs-in-l; }
@keyframes cs-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes cs-in-l { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.cs-measure { position: absolute; left: -30000px; top: 0; height: auto; overflow: visible; box-shadow: none; }

/* 주제 머리 */
.cs-head { position: relative; padding-bottom: 4px; }
/* 오른쪽 위 폴더 그림 (넓은 화면만). 제목·한눈에 상자가 그림 밑으로 들어가지 않게 오른쪽을 비워요 */
.cs-h-art { position: absolute; right: 0; top: 0; width: 160px; height: 100px; padding: 6px 8px; border-radius: 16px; background: linear-gradient(135deg, var(--g1), var(--g3)); box-shadow: 0 10px 24px rgba(13, 27, 46, .16); }
.cs-h-art svg { display: block; width: 100%; height: 100%; }
.cs-h-art ~ .cs-h-k, .cs-h-art ~ .cs-h-t { padding-right: 180px; }
@media (max-width: 820px) {
  .cs-h-art { display: none; }
  .cs-h-art ~ .cs-h-k, .cs-h-art ~ .cs-h-t { padding-right: 0; }
}
.cs-h-k { margin: 0 0 10px; display: flex; align-items: center; gap: 10px; font-size: 12.5px; letter-spacing: .16em; color: var(--gold-ink); font-weight: 700; }
.cs-h-k::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-soft), transparent); }
.cs-h-t { margin: 0; display: flex; align-items: center; gap: 14px; font-family: var(--serif); font-weight: 700; font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.5rem); line-height: 1.3; color: var(--navy-900); letter-spacing: -0.01em; }
.cs-h-i { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 16px; background: linear-gradient(135deg, var(--g1), var(--g3)); color: #fff; box-shadow: 0 8px 20px rgba(13, 27, 46, .18); }
.cs-h-i .li { width: 26px; height: 26px; }
.cs-easy { margin-top: 16px; padding: 16px 20px; border-radius: 16px; background: #F4EDDF; border: 1px solid #E5D6B8; }
.cs-easy-l { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--gold-ink); }
.cs-easy p { margin: 6px 0 0; font-size: var(--step-1); line-height: 1.75; color: var(--ink); }
.cs-paper .b-title { font-family: var(--serif); }
.cs-foot { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid #E8DFCC; font-size: 12.5px; line-height: 1.6; color: var(--slate); }

/* 아래 넘기기 막대 */
.cs-nav { flex: none; height: var(--cs-nav-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1140px; width: 100%; margin: 0 auto; padding: 0 clamp(10px, 3vw, 36px) env(safe-area-inset-bottom); }
.cs-arrow {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--cs-line); background: rgba(255, 255, 255, .05); color: #EDE6D8;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.cs-arrow.is-next { background: linear-gradient(135deg, var(--cs-gold), #A8874E); color: #1A1407; border-color: transparent; }
.cs-arrow:hover:not(:disabled) { border-color: var(--cs-gold); }
.cs-arrow.is-next:hover:not(:disabled) { filter: brightness(1.06); }
.cs-arrow:disabled { opacity: .35; cursor: default; }
.cs-prog { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.cs-dots { display: flex; gap: 6px; }
.cs-dots i { width: 7px; height: 7px; border-radius: 999px; background: rgba(237, 230, 216, .25); transition: width .3s, background .3s; }
.cs-dots i.on { width: 22px; background: var(--cs-gold); }
.cs-count { margin: 0; font-size: 13px; color: rgba(237, 230, 216, .72); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 목차 ---------- */
.cs-toc {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(380px, 92vw);
  display: flex; flex-direction: column; background: #0E1C30; border-left: 1px solid var(--cs-line);
  transform: translateX(100%); transition: transform .25s var(--ease-out); box-shadow: -20px 0 60px rgba(0, 0, 0, .4);
}
.cs-toc.is-open { transform: none; }
.cs-toc-h { display: flex; align-items: center; justify-content: space-between; height: var(--cs-top-h); padding: 0 18px; border-bottom: 1px solid var(--cs-line); }
.cs-toc-h b { font-family: var(--serif); font-size: 18px; color: #fff; }
.cs-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(237, 230, 216, .2); background: transparent; color: #EDE6D8; font-size: 15px; cursor: pointer; }
.cs-toc-body { flex: 1; overflow-y: auto; padding: 8px 18px 30px; }
.cs-toc-f h3 { margin: 18px 0 6px; font-size: 12.5px; letter-spacing: .12em; color: var(--cs-gold); }
.cs-toc-f ol { list-style: none; margin: 0; padding: 0; }
.cs-toc-f a { display: block; padding: 8px 10px; border-radius: 10px; color: rgba(237, 230, 216, .85); text-decoration: none; font-size: 14.5px; line-height: 1.45; }
.cs-toc-f a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.cs-toc-f a[aria-current] { background: rgba(201, 169, 110, .16); color: var(--cs-gold-2); font-weight: 700; }
.cs-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(4, 9, 16, .5); }

/* ---------- 화면 크기별 ---------- */
@media (max-width: 1000px) {
  .cs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-feat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cs { --cs-top-h: 58px; --cs-nav-h: 68px; }
  .cs-brand-t small, .cs-now, .cs-ic-t { display: none; }
  .cs-top { gap: 10px; }
  .cs-actions { margin-left: auto; }
  .cs-ic { width: 40px; padding: 0; justify-content: center; }
  .cs-feat-row { grid-template-columns: minmax(0, 1fr); }
  .cs-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .cs-fold-b small { display: none; }
  .cs-fold-b b { font-size: 15px; }
  .cs-lead { font-size: 15.5px; }
  .cs-stage { padding: 10px 8px 4px; }
  .cs-paper { border-radius: 16px; }
  .cs-h-i { width: 42px; height: 42px; border-radius: 12px; }
  .cs-arrow { height: 46px; padding: 0 16px; font-size: 14px; }
  .cs-topics a { grid-template-columns: 24px 36px minmax(0, 1fr); }
  .cs-go { display: none; }
  .cs-shelf-art { width: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-paper.is-in { animation: none; }
  .cs-feat, .cs-fold, .cs-toc { transition: none; }
}
