/* 마감:후 링크 아카이브 — 노드 그래프 배치 */
:root {
  --lime: #D7FF3F;
  --lime-2: #C4F01F;
  --lime-soft: #F2FFC9;
  --ink: #111111;
  --ink-2: #34342F;
  --ink-3: #6B6A62;
  --paper: #F5F3EC;
  --line: rgba(17,17,17,.07);
  --glass: rgba(255,255,255,.78);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "D2Coding", monospace;
  --raise: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255,255,255,.6), 0 8px 16px -12px rgba(17,17,17,.35);
  --hdr: 59px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px; line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(55% 38% at 0% 0%, rgba(215,255,63,.38), transparent 70%),
    radial-gradient(55% 40% at 100% 18%, rgba(17,17,17,.06), transparent 70%),
    radial-gradient(60% 40% at 15% 58%, rgba(215,255,63,.22), transparent 70%),
    radial-gradient(55% 40% at 95% 82%, rgba(215,255,63,.26), transparent 70%),
    var(--paper);
  background-attachment: fixed;
  word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--lime); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- 머리 ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--hdr);
  background: rgba(245,243,236,.76);
  -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}
.top__in { position: relative; max-width: 980px; height: 58px; margin: 0 auto; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; }
.brand__mark { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 9px; background: var(--ink); }
.brand__mark img { height: 18px; width: auto; }
.top__btns { display: flex; align-items: center; gap: 8px; }
.round {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.85); box-shadow: var(--raise);
}
.pill-dark {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px;
  border-radius: 999px; background: var(--ink); color: var(--lime);
  font-size: 13.5px; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 18px -10px rgba(17,17,17,.7);
}
.now {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  height: 30px; padding: 0 12px; border-radius: 999px;
  display: inline-flex; align-items: center;
  background: var(--lime-soft); color: var(--ink); font-size: 12.5px; font-weight: 800;
  box-shadow: var(--raise); white-space: nowrap;
  opacity: 0; transition: opacity .2s ease;
}
.now.is-on { opacity: 1; }
@media (max-width: 379px) { .now { display: none; } }
.prog { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--ink); }

/* ---------- 그래프 ---------- */
.graph { position: relative; max-width: 980px; margin: 0 auto; padding: 28px 14px 50px; }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.wires path { fill: none; stroke: rgba(17,17,17,.12); stroke-width: 7; stroke-linecap: round; }
.port {
  position: absolute; z-index: 3; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: var(--lime); border: 3px solid var(--ink);
  box-shadow: 0 0 0 6px rgba(215,255,63,.35);
  pointer-events: none;
}
.noscript { padding: 24px; text-align: center; color: var(--ink-3); }

.node {
  position: relative; z-index: 1;
  width: calc(100% - 10px);
  margin-top: 70px;
  border-radius: 24px;
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(17,17,17,.05), 0 24px 48px -28px rgba(17,17,17,.28);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.node:first-of-type { margin-top: 0; }
.node.alt { margin-left: 10px; }

.nh {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px 13px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(95deg, rgba(215,255,63,.30), transparent 78%);
  border-bottom: 1px solid var(--line);
}
.node.dark-h .nh { background: linear-gradient(95deg, rgba(17,17,17,.10), transparent 78%); }
.ni {
  flex: none; width: 50px; height: 50px; border-radius: 23%;
  display: grid; place-items: center;
  background: linear-gradient(#2B2B27, #111 60%, #000); color: var(--lime);
  box-shadow: inset 0 0 0 .5px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.25), 0 7px 14px -6px rgba(0,0,0,.45);
}
.ni.lime { background: linear-gradient(#EEFF9E, var(--lime) 60%, #B5E016); color: var(--ink); }
.ni svg { width: 26px; height: 26px; }
.ht { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ht b { display: flex; flex-direction: column; align-items: flex-start; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.035em; }
.ht i { margin-top: 3px; font-style: normal; font-size: 14.5px; font-weight: 600; color: var(--ink-3); }
.ey {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  height: 24px; padding: 0 9px 0 4px; margin-bottom: 4px;
  border-radius: 999px; background: var(--ink); color: var(--lime);
  font-size: 12px; font-weight: 800; letter-spacing: 0;
}
.ey img { width: 18px; height: 18px; border-radius: 50%; }
.acts { flex: none; display: flex; gap: 6px; align-self: flex-start; margin-top: 10px; }
.ab {
  width: 30px; height: 30px; border-radius: 10px; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #3E3E38;
  background: rgba(255,255,255,.6); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255,255,255,.6), 0 8px 14px -9px rgba(17,17,17,.5);
}
.ab svg { width: 15px; height: 15px; }

.nb { padding: 22px 20px 24px; }

/* 공용 알약 */
.cap {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 12px; border-radius: 99px;
  font-size: 13px; font-weight: 800; line-height: 1.2; text-align: center;
  color: var(--ink);
  background: linear-gradient(#FAFFE8 0%, var(--lime-soft) 50%, #E2FF8A 100%);
  box-shadow: inset 0 2px 1px rgba(255,255,255,.95), inset 0 -3px 6px rgba(160,200,20,.22), 0 8px 16px -9px rgba(140,180,10,.75), 0 1px 2px rgba(17,17,17,.08);
}
.cap.mono { background: linear-gradient(#fff 0%, #F1EFE8 50%, #E3E0D6 100%); box-shadow: inset 0 2px 1px rgba(255,255,255,.95), inset 0 -3px 6px rgba(17,17,17,.06), 0 8px 16px -10px rgba(17,17,17,.4), 0 1px 2px rgba(17,17,17,.08); }
.cap.solid { background: var(--ink); color: var(--lime); box-shadow: 0 6px 14px -8px rgba(17,17,17,.8); }
.cap.md { min-height: 40px; padding: 8px 16px; font-size: 14px; }

/* ---------- 프로필 ---------- */
.prof { display: flex; gap: 14px; align-items: center; }
.bt { flex: none; width: 64px; height: 64px; border-radius: 18px; overflow: hidden; box-shadow: var(--raise); background: #fff; display: grid; place-items: center; }
.bt img { width: 100%; height: 100%; object-fit: cover; }
.prof .ttl { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.prof p { margin-top: 3px; font-size: 14px; color: var(--ink-3); line-height: 1.5; }
.w {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 10px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(rgba(255,255,255,.75), rgba(255,255,255,.35)); box-shadow: var(--raise);
}
.prof + .w { margin-top: 18px; }
.w span { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.w b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; text-align: right; }
.bl { display: flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.bl svg { width: 16px; height: 16px; }
.pt { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pt .cap { min-height: 30px; padding: 4px 12px; font-size: 12.5px; }
.sns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.sns a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 16px; font-size: 12px; font-weight: 700; color: var(--ink-2); background: linear-gradient(rgba(255,255,255,.75), rgba(255,255,255,.35)); box-shadow: var(--raise); }
.sns .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--ink); color: var(--lime); }
.sns .ic.lime { background: var(--lime); color: var(--ink); }
.sns .ic svg { width: 24px; height: 24px; }

/* ---------- 큰 배너 카드 ---------- */
.feat {
  position: relative; overflow: hidden; display: flex; gap: 6px;
  min-height: 188px; margin-top: 18px; padding: 24px 0 0 22px;
  border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, #111 0%, #2A2A25 60%, #5E6B1C 140%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 18px 30px -16px rgba(17,17,17,.8);
}
.feat:first-child { margin-top: 0; }
.feat .tx { position: relative; z-index: 2; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 22px; }
.feat .tx b { font-size: 27px; line-height: 1.15; font-weight: 800; letter-spacing: -.035em; white-space: pre-line; }
.feat .tx b em { font-style: normal; color: var(--lime); }
.feat .tx > span { font-size: 14px; color: rgba(255,255,255,.75); white-space: pre-line; line-height: 1.5; }
.feat .fb { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.feat .fph {
  position: relative; z-index: 1; flex: 0 0 42%; align-self: flex-end;
  margin-bottom: -14px; margin-right: -10px;
  border-radius: 14px 0 0 0; overflow: hidden;
  box-shadow: -10px -8px 24px -10px rgba(0,0,0,.6);
  transform: rotate(-4deg); transform-origin: bottom right;
}
.feat .fph img { width: 100%; height: auto; }
.feat:has(.fph.wide) { min-height: 232px; }
.feat .fph.wide { position: absolute; right: -18px; bottom: -12px; width: 60%; margin: 0; border-radius: 12px 0 0 0; }
.feat .fph.tall { flex-basis: 34%; border-radius: 14px; margin-bottom: -40px; }
.feat .fph.tall img { aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }

/* ---------- 빠른 메뉴 ---------- */
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.chips .cap { width: 100%; min-height: 39px; padding: 6px 4px; font-size: 12.5px; }

/* ---------- 탭 ---------- */
.seg {
  display: flex; gap: 4px; padding: 5px; margin: 0 0 20px;
  border-radius: 18px; background: linear-gradient(#26261F, #111);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 24px -14px rgba(17,17,17,.8);
}
.seg button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 10px 6px; border: 0; border-radius: 13px; cursor: pointer;
  background: transparent; color: rgba(255,255,255,.78); font-size: 12.5px; font-weight: 800;
}
.seg button svg { width: 15px; height: 15px; }
.seg button em { font-style: normal; display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 6px; background: rgba(255,255,255,.14); font-size: 11px; }
.seg button.on { background: linear-gradient(#ECFF9A, var(--lime)); color: var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset 0 -3px 6px rgba(0,0,0,.12), 0 0 0 2px rgba(215,255,63,.35), 0 8px 18px -8px var(--lime); }
.seg button.on em { background: rgba(17,17,17,.12); }
.pane[hidden] { display: none; }

/* ---------- 최신 릴스 카드 ---------- */
.tops { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 0 16px; margin: 0 -2px; scrollbar-width: none; }
.tops::-webkit-scrollbar { display: none; }
.tc { flex: none; width: 138px; scroll-snap-align: start; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 12px 22px -14px rgba(17,17,17,.55); }
.tci { display: block; }
.tc .im { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--paper); }
.tc .im img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.tc .im .cap { position: absolute; left: 7px; top: 7px; min-height: 22px; padding: 2px 8px; font-size: 11.5px; }
.tc .sv { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px; font-size: 13.5px; font-weight: 800; }
.tc .sv svg { width: 16px; height: 16px; flex: none; }
.tc .sv span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcb { display: flex; border-top: 1px solid var(--line); }
.tcb a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.tcb a + a { border-left: 1px solid var(--line); }
.tcb a svg { width: 14px; height: 14px; }

/* ---------- 찾기 ---------- */
.search { margin-top: 18px; }
.search input {
  width: 100%; min-height: 48px; padding: 0 16px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: rgba(255,255,255,.9); border: 0; border-radius: 14px; box-shadow: var(--raise);
}
.search input:focus { outline: 2px solid var(--ink); }
.empty { margin-top: 16px; padding: 18px; text-align: center; font-size: 14px; color: var(--ink-3); }

/* ---------- 댓글 자료실 항목 ---------- */
.ep {
  margin-top: 16px; padding: 20px 18px;
  border-radius: 20px;
  background: linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.6));
  box-shadow: var(--raise);
  transition: box-shadow .2s ease;
}
.ep.is-target { box-shadow: 0 0 0 3px var(--lime), 0 0 0 4.5px var(--ink), 0 16px 30px -16px rgba(17,17,17,.5); }
.ep__head { display: flex; gap: 14px; align-items: flex-start; }
.ep__ic { flex: none; width: 64px; height: 64px; border-radius: 18px; overflow: hidden; box-shadow: 0 7px 14px -6px rgba(0,0,0,.45); background: var(--ink); }
.ep__ic img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.ep__head h3 { font-size: 19px; line-height: 1.3; font-weight: 800; letter-spacing: -.025em; }
.ep__head p { margin-top: 4px; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags .cap { min-height: 26px; padding: 2px 10px; font-size: 12px; }

.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.res { display: grid; grid-template-columns: 22px 1fr; column-gap: 9px; }
.res__n { width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(#ECFF9A, var(--lime)); color: var(--ink); font-size: 12px; font-weight: 800; box-shadow: inset 0 -2px 3px rgba(0,0,0,.12), 0 0 0 1.5px var(--ink); }
.res__t { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.res__d { grid-column: 2; margin-top: 4px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.res__b { grid-column: 2; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.res__note { grid-column: 2; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

.code {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 12px 10px 12px 16px;
  border-radius: 14px; background: #EFEDE4;
  box-shadow: inset 0 1px 2px rgba(17,17,17,.06);
}
.code span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.code small { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.code code { font-family: var(--mono); font-size: 13px; color: var(--ink); line-height: 1.5; word-break: break-all; }
.code button {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--lime); font-size: 13.5px; font-weight: 800;
  box-shadow: 0 8px 16px -8px rgba(17,17,17,.8);
}
.code button svg { width: 15px; height: 15px; }
.ulink { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 목록 줄 ---------- */
.rows { display: grid; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 15px; padding: 15px 16px; border-radius: 16px;
  background: linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.55));
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255,255,255,.6), 0 10px 18px -14px rgba(17,17,17,.45);
}
.row .ic { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #fff; box-shadow: 0 6px 12px -6px rgba(17,17,17,.4); color: var(--ink); }
.row .ic.dark { background: var(--ink); color: var(--lime); }
.row .ic svg { width: 22px; height: 22px; }
.row b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.row i { display: block; margin-top: 2px; font-style: normal; font-size: 13px; color: var(--ink-3); }
.row .arr { margin-left: auto; flex: none; color: var(--ink-3); }

/* ---------- 문의 ---------- */
.out { display: flex; flex-direction: column; align-items: center; text-align: center; }
.av { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 6px rgba(215,255,63,.45), 0 16px 30px -14px rgba(17,17,17,.6); }
.out p { margin-top: 18px; font-size: 14px; color: var(--ink-3); }
.bigbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; margin-top: 16px; border-radius: 16px;
  font-size: 15px; font-weight: 800;
  background: linear-gradient(#ECFF9A, var(--lime)); color: var(--ink);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset 0 -3px 6px rgba(0,0,0,.1), 0 12px 22px -12px rgba(150,190,10,.9);
}
.bigbtn.white { margin-top: 10px; background: linear-gradient(#fff, #F3F1EA); box-shadow: var(--raise); }
.bigbtn svg { width: 18px; height: 18px; }

/* ---------- 바닥·알림 ---------- */
.foot { padding: 0 18px calc(36px + env(safe-area-inset-bottom)); text-align: center; font-size: 12px; color: var(--ink-3); }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 16px); padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--lime); font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 넓은 화면: 노드를 지그재그로 배치 (위치는 app.js가 계산) ---------- */
@media (min-width: 900px) {
  .graph.is-canvas .node { position: absolute; margin: 0; }
  .nh { padding: 17px 20px 16px; gap: 12px; }
  .ht b { font-size: 30px; }
  .ab { width: 34px; height: 34px; border-radius: 11px; }
  .acts { margin-top: 8px; }
  .node.side .chips { grid-template-columns: 1fr 1fr; }
  .node.side .chips .cap { min-height: 40px; font-size: 13px; }
  .tc { width: 173px; }
  .feat { min-height: 214px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
