/* 마이위키 — 우글 디자인 시스템 계열 (밝은 바탕, 얇은 테두리 카드, 둥근 제목체, 아이콘 타일)
   이벤트 테마는 event-*.css 에서 변수만 덮어쓴다 */
@font-face { font-family: 'NanumSquareRound'; font-weight: 700; font-display: swap; src: url('/fonts/NanumSquareRoundB.woff2') format('woff2'); }
@font-face { font-family: 'NanumSquareRound'; font-weight: 800; font-display: swap; src: url('/fonts/NanumSquareRoundEB.woff2') format('woff2'); }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1a1d24;
  --ink2: #4b5263;
  --muted: #7a8293;
  --line: #e4e7ee;
  --line-strong: #d3d8e2;
  --brand: #5b4fe9;
  --brand-deep: #4134c4;
  --brand-soft: #f0eeff;
  --brand-tint: #f8f7ff;
  --brand-line: #dcd8fd;
  --brand-fold: #a59dff;
  --heart: #ff4d6d;
  --heart-soft: #fff0f3;
  --gold: #b7790a;
  --gold-soft: #fff5dc;
  --green: #0f8a5f;
  --green-soft: #e9f7f0;
  --blue: #2468e8;
  --blue-soft: #edf3ff;
  --danger: #c4433c;
  --shadow: 0 2px 8px rgba(26, 29, 36, .045);
  --shadow-raised: 0 14px 34px rgba(26, 29, 36, .12);
  --shadow-ink: rgba(40, 40, 80, .08);
  --r-card: 16px;
  --r: 10px;
  --font: 'Wanted Sans Variable', 'Wanted Sans', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --display: 'NanumSquareRound', var(--font);
  --top-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; letter-spacing: -0.012em; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .08em .38em; }
.inline { display: inline; }
.linkish { background: none; border: 0; padding: 0; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.linkish:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.fine { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.fine a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 상단 ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; height: var(--top-h); max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.logo { display: inline-flex; align-items: center; gap: 8px; justify-self: start; }
.mk { overflow: visible; }
.mk-hat { display: none; }
.wm { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; line-height: 1; padding-top: 2px; }
.wm-b { color: var(--brand); }
.pnav { display: flex; gap: 4px; }
.pnav a { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; border-radius: var(--r); font-size: 13.5px; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.pnav a:hover { color: var(--ink); background: var(--bg); }
.pnav a.on { background: var(--brand-soft); color: var(--brand-deep); box-shadow: 0 4px 14px rgba(25, 31, 40, .08); }
.top-r { display: flex; align-items: center; gap: 8px; justify-self: end; }
.ibtn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink2); transition: background .15s, border-color .15s; }
.ibtn:hover { background: var(--bg); border-color: var(--line-strong); color: var(--ink); }
.chip-me { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 4px; border: 1px solid var(--line); border-radius: var(--r); font-weight: 700; font-size: 13.5px; background: var(--surface); max-width: 180px; }
.chip-me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-me .av { width: 30px; height: 30px; font-size: 13px; }
.search-pop { border-top: 1px solid var(--line); background: var(--surface); padding: 12px 20px; }
.search-in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 6px 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--muted); }
.search-in:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-in input { flex: 1; border: 0 !important; box-shadow: none !important; padding: 0 !important; height: 100%; outline: none; background: transparent; color: var(--ink); }

/* 하단 탭 (모바일) */
.tabbar { display: none; }
@media (max-width: 760px) {
  :root { --top-h: 58px; }
  .top-in { grid-template-columns: 1fr auto; padding: 0 14px; }
  .pnav, .hide-m { display: none; }
  .chip-me span:last-child { display: none; }
  .chip-me { padding: 0 4px; }
  .wm { font-size: 19px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0 3px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 700; border-radius: 12px; }
  .tabbar .on { color: var(--brand-deep); }
  .tabbar .on svg { stroke-width: 2.4; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--ink); color: #fff; font-weight: 700; font-size: 14.5px; white-space: nowrap; transition: transform .08s, background .15s, opacity .15s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-brand { background: var(--brand); }
.btn-brand:hover { background: var(--brand-deep); }
.btn-line { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-line:hover { background: var(--bg); }
.btn-white { background: #fff; color: var(--ink); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: var(--r); }
.btn-lg { height: 52px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

/* ---------- 페이지 틀 ---------- */
.main { min-height: 70vh; }
.page { max-width: 1040px; margin: 0 auto; padding: 24px 20px 56px; }
.narrow { max-width: 720px; }
@media (max-width: 760px) { .page { padding: 16px 14px 40px; } }
.greet { margin: 6px 0 2px; font-size: 13px; color: var(--muted); font-weight: 600; }
.title { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 16px; }
@media (max-width: 760px) { .title { font-size: 25px; } }
.br-m { display: none; }
@media (max-width: 520px) { .br-m { display: inline; } }
.eyebrow { margin: 0 0 2px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin-bottom: 14px; }
@media (max-width: 760px) { .card { padding: 16px; } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 14px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-h h2 { font-family: var(--display); font-weight: 800; font-size: 18px; margin: 0; letter-spacing: -0.02em; }
.sec-h .eyebrow { color: var(--brand-deep); }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.more:hover { color: var(--ink); }

/* 공지 줄 */
.ann { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 12px; height: 52px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); margin-bottom: 18px; font-weight: 700; font-size: 14.5px; }
.ann-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12.5px; flex-shrink: 0; }
.ann-t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.ann-track { display: inline-flex; width: max-content; animation: ann-roll 14s linear infinite; will-change: transform; }
.ann-track > span { padding-right: 48px; }
.ann:hover .ann-track { animation-play-state: paused; }
@keyframes ann-roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ann-r { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-deep); font-size: 13px; flex-shrink: 0; }

/* 프로모 카드 (우글 '질문하기' 카드 계열) */
.promo { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 22px 22px 22px; border-radius: var(--r-card); background: linear-gradient(100deg, var(--brand-tint), var(--brand-soft)); border: 1px solid var(--brand-line); margin-bottom: 14px; overflow: hidden; min-height: 132px; }
.promo-txt { position: relative; z-index: 1; min-width: 0; }
.promo .eyebrow { color: var(--brand-deep); }
.promo h2 { display: flex; align-items: center; gap: 2px; font-family: var(--display); font-weight: 800; font-size: 24px; margin: 2px 0 4px; letter-spacing: -0.02em; }
.promo .sub { margin: 0; color: var(--ink2); font-size: 14px; }
.promo .btn { margin-top: 14px; }
.promo-art { flex-shrink: 0; margin: -10px -4px -12px 0; }
.promo-sm { min-height: 0; padding: 18px 20px; }
.promo-sm h2 { font-size: 20px; }
.promo-h { font-family: var(--font); font-size: 15px; color: var(--heart); margin-left: 8px; }
.promo-line { background: var(--surface); border-color: var(--line); }
.promo-dark { background: linear-gradient(110deg, #22263a, #1a1d24); border-color: transparent; color: #fff; }
.promo-dark .eyebrow { color: #c9c4ff; }
.promo-dark .sub { color: rgba(255, 255, 255, .78); }
a.promo { transition: box-shadow .2s, transform .2s; }
a.promo:hover { box-shadow: var(--shadow-raised); transform: translateY(-1px); }
@media (max-width: 520px) { .promo h2 { font-size: 21px; } .promo-art .mascot { width: 92px; height: auto; } }

/* 아이콘 타일 */
.it { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r); flex-shrink: 0; border: 1px solid transparent; }
.it-brand { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--brand-line); }
.it-gold { background: var(--gold-soft); color: var(--gold); border-color: #f3e1b0; }
.it-blue { background: var(--blue-soft); color: var(--blue); border-color: #d6e3ff; }
.it-green { background: var(--green-soft); color: var(--green); border-color: #cdebdd; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 14px; overflow: hidden; }
.tile { display: flex; align-items: center; gap: 12px; padding: 20px 18px; border: 0; background: none; text-align: left; transition: background .15s; }
.tile + .tile { border-left: 1px solid var(--line); }
.tile:hover { background: var(--bg); }
.tile small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.tile b { display: block; font-size: 15px; }
@media (max-width: 520px) { .tile { padding: 14px 12px; gap: 10px; } .tile b { font-size: 14px; } .tile .it { width: 34px; height: 34px; } }

/* 사용법 */
.how-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.how-g > div { padding: 16px; }
.how-g > div + div { border-left: 1px solid var(--line); }
.how-g b { display: block; margin-top: 10px; font-size: 15px; }
.how-g p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink2); }
.stat { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.stat b { color: var(--brand-deep); }
@media (max-width: 640px) { .how-g { grid-template-columns: 1fr; } .how-g > div + div { border-left: 0; border-top: 1px solid var(--line); } }

/* 아바타 */
.av { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; font-size: 14.5px; color: #fff; flex-shrink: 0; font-family: var(--display); background: var(--brand); }
.av-sm { width: 28px; height: 28px; font-size: 12px; }
.av-lg { width: 52px; height: 52px; font-size: 21px; }
.av[data-c="1"] { background: #0f8a5f; } .av[data-c="2"] { background: #e0582b; } .av[data-c="3"] { background: #2468e8; }
.av[data-c="4"] { background: #c2338a; } .av[data-c="5"] { background: #c98a12; } .av[data-c="6"] { background: #14919b; } .av[data-c="7"] { background: #7a4fd1; }

/* 목록 */
.plist, .rank { list-style: none; margin: 0; padding: 0; }
.plist a, .rank a { display: flex; align-items: center; gap: 12px; padding: 9px 8px; margin: 0 -8px; border-radius: 12px; transition: background .15s; }
.plist a:hover, .rank a:hover { background: var(--bg); }
.pl-n, .rn { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pl-n b, .rn b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.pl-n small, .rn small { font-size: 12.5px; color: var(--muted); }
.pl-t { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rk { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; font-weight: 800; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.rk1 { background: #ffe9a8; color: #8a5a00; }
.rk2 { background: #e8ebf1; color: #4b5263; }
.rk3 { background: #f8dcc8; color: #8f4a1c; }
.rank .is-me a { background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand-line); }
.rh { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 14px; color: var(--heart); font-variant-numeric: tabular-nums; }
.rh svg { fill: var(--heart); stroke: var(--heart); }
.crown::after { content: '👑'; font-size: 13px; }
.crown { display: none; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }

/* 세그먼트 탭 (우글 상단 내비 스타일) */
.seg { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--r); border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13.5px; white-space: nowrap; transition: background .15s, color .15s; }
.seg a:hover, .seg button:hover { color: var(--ink); background: var(--bg); }
.seg .on { background: var(--brand-soft) !important; color: var(--brand-deep) !important; box-shadow: 0 4px 14px rgba(25, 31, 40, .07); }
.seg-doc { margin: 16px -4px 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.seg-sm { margin: 0; }
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--heart); color: #fff; font-size: 11px; font-weight: 800; }

/* 안내 줄 */
.note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; margin: 0 0 16px; color: var(--ink2); }
.note span { flex: 1; }
.note-brand { background: var(--brand-tint); border-color: var(--brand-line); color: var(--brand-deep); }
.note-warn { background: #fff6e6; border-color: #ffe2ad; color: #7a4b00; text-align: left; }

/* ---------- 문서 ---------- */
.doc { padding: 24px 26px 16px; }
@media (max-width: 760px) { .doc { padding: 18px 16px 12px; } }
.doc-h { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.doc-t { flex: 1; min-width: 0; }
.doc-t .eyebrow { font-weight: 600; }
.doc-t .ig { color: var(--brand-deep); font-weight: 700; }
.doc-t h1 { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.25; margin: 0; letter-spacing: -0.02em; }
.doc-sfx { color: var(--muted); font-size: .7em; }
.doc-act { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .doc-t h1 { font-size: 25px; } .doc-act { width: 100%; } }
.heart { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px 0 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; transition: transform .1s, border-color .15s, background .15s; }
.heart .heart-i { color: var(--heart); }
.heart:hover:not(:disabled) { border-color: #ffc2ce; background: var(--heart-soft); }
.heart.on, .heart.on:hover:not(:disabled) { background: var(--heart); border-color: var(--heart); color: #fff; }
.heart.on .heart-i { color: #fff; fill: #fff; }
.heart:disabled { cursor: default; }
.heart.pop { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.14); } }
.rank-chip { display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 12px; border-radius: var(--r); background: var(--gold-soft); color: var(--gold); font-weight: 800; font-size: 14px; border: 1px solid #f3e1b0; }
.doc-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 12px; font-size: 12.5px; color: var(--muted); }

.toc { display: inline-block; min-width: 220px; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px 12px 14px; margin: 0 0 8px; background: var(--bg); }
.toc-h { font-family: var(--display); font-weight: 800; font-size: 14.5px; margin-bottom: 4px; }
.toc ol { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.toc li { padding: 1.5px 0; }
.toc li.l1 { padding-left: 16px; }
.toc li.l2 { padding-left: 32px; }
.toc a:hover { text-decoration: underline; }
.toc a span { color: var(--brand); font-weight: 800; }

/* 위키 본문 */
.wiki { font-size: 16px; line-height: 1.78; }
.wiki p { margin: 0 0 10px; }
.wiki .sh { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; border-bottom: 1px solid var(--line); padding-bottom: 7px; margin: 28px 0 12px; line-height: 1.35; }
.wiki h2.sh { font-size: 23px; }
.wiki h3.sh { font-size: 19px; }
.wiki h4.sh { font-size: 17px; border-bottom-style: dashed; }
.wiki .sn { color: var(--brand); margin-right: 3px; }
.wiki ul { margin: 0 0 10px; padding-left: 22px; }
.wiki li { margin: 2px 0; }
.wiki li::marker { color: var(--brand); }
.wiki blockquote { margin: 0 0 12px; padding: 10px 16px; border-left: 4px solid var(--brand-line); background: var(--brand-tint); border-radius: 0 12px 12px 0; color: var(--ink2); }
.wiki hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.wiki del { color: var(--muted); }
.wiki a.wl { color: var(--brand-deep); font-weight: 700; }
.wiki a.ext { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.fn-ref a { color: var(--brand); font-size: 11.5px; font-weight: 800; padding: 0 1px; }
.footnotes { margin: 26px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 13.5px; color: var(--ink2); }
.footnotes li { margin: 3px 0; }
.footnotes a { color: var(--brand); font-weight: 800; margin-right: 4px; }

/* 틀 */
.tpl { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin: 0 0 8px; border-radius: 12px; border: 1px solid; font-size: 14.5px; line-height: 1.5; font-weight: 600; }
.tpl-i { font-size: 17px; line-height: 1.3; }
.tpl-info { background: var(--blue-soft); border-color: #d6e3ff; color: #1d3f8f; }
.tpl-pink { background: #fff0f6; border-color: #ffd3e6; color: #8a1d4d; }
.tpl-warn { background: #fff6e6; border-color: #ffe0a8; color: #7a4b00; }
.tpl-gray { background: var(--bg); border-color: var(--line); color: var(--ink2); }
.tpl-gold { background: var(--gold-soft); border-color: #f3e1b0; color: #6d5200; }
.tpl-xmas { background: #ecf7f0; border-color: #c9e7d4; color: #165a36; }
.tpl-xmas-red { background: #fdeef0; border-color: #f6c9cf; color: #8e1222; }
.doc-body > .wiki:first-child { margin-bottom: 12px; }
.tpl-list { display: grid; gap: 10px; }
.tpl-list code { display: inline-block; margin-bottom: 5px; }

/* 편집 요청 */
.req-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.req-h h2 { font-family: var(--display); font-weight: 800; font-size: 18px; margin: 2px 0 2px; }
.req-h p { margin: 0; font-size: 13.5px; color: var(--muted); }
.req-form, .form { display: grid; gap: 12px; }
.req-form label, .form label { display: grid; gap: 6px; }
.req-form label > span, .form label > span { font-weight: 700; font-size: 13px; color: var(--ink2); }
select, input:not([type=checkbox]), textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); padding: 11px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
select { height: 48px; padding: 0 12px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8293' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
textarea { resize: vertical; line-height: 1.6; }
select:focus, input:not([type=checkbox]):focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.req-row, .editor-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.req-row .fine { margin: 0; }
.req-btns { display: inline-flex; gap: 8px; }
@media (max-width: 520px) { .req-btns { width: 100%; } .req-btns .btn-brand { flex: 1; } }
.rank-chip.off { background: var(--surface); color: var(--ink2); border-color: var(--line); font-weight: 700; }
.switch { position: relative; display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.switch > span { display: flex; flex-direction: column; gap: 3px; }
.switch b { font-size: 15px; color: var(--ink); }
.switch small { font-size: 13px; color: var(--ink2); font-weight: 500; line-height: 1.45; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { flex-shrink: 0; position: relative; width: 50px; height: 30px; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 역사 */
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.hist li:first-child { border-top: 0; }
.hist-rev { font-weight: 800; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.hist-by a { font-weight: 700; }
.hist-t { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .hist li { grid-template-columns: 44px 1fr; gap: 2px 10px; } .hist-by, .hist-t { grid-column: 2; font-size: 12.5px; } }

/* 받은 요청 */
.inbox { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.req-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; transition: opacity .2s; }
.req-item.done { opacity: .35; pointer-events: none; }
.req-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink2); margin-bottom: 10px; }
.req-meta a { font-weight: 800; color: var(--ink); }
.req-meta .arrow { color: var(--muted); }
.req-meta .t { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.req-body { background: var(--bg); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 15px; }
.req-body p:last-child, .req-body ul:last-child { margin-bottom: 0; }
.req-body .footnotes { margin-top: 8px; padding-top: 8px; }
.req-btns { display: flex; gap: 8px; }

/* 편집기 */
.editor { display: grid; gap: 10px; }
.editor textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; min-height: 420px; }
.editor .preview { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 16px; min-height: 420px; }
.editor-row input { flex: 1; min-width: 200px; }

/* 로그인 */
.auth { max-width: 440px; margin: 32px auto; padding: 28px 26px; text-align: center; }
.auth-art { display: flex; justify-content: center; margin: -4px 0 6px; }
.auth h1 { font-family: var(--display); font-weight: 800; font-size: 24px; margin: 0 0 6px; }
.auth .sub { margin: 0 0 18px; color: var(--ink2); font-size: 14.5px; }
.auth .form { text-align: left; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 14px; border: 1px solid var(--line-strong); background: #fff; font-weight: 700; font-size: 15.5px; color: #1f1f1f; margin: 4px 0 4px; transition: background .15s, box-shadow .15s; }
.gbtn:hover { background: var(--bg); box-shadow: var(--shadow); }
.dev { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-strong); display: grid; gap: 8px; }
.prefix-input { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.prefix-input em { font-style: normal; padding: 0 0 0 14px; color: var(--muted); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.prefix-input input { border: 0 !important; padding-left: 2px; box-shadow: none !important; }
.prefix-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.check { display: flex !important; align-items: flex-start; gap: 8px !important; font-size: 13.5px; color: var(--ink2); }
.check input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--brand); }
.check a { text-decoration: underline; }

/* 빈 상태 */
.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px 8px; text-align: center; color: var(--muted); font-size: 14px; }
.empty p { margin: 4px 0 8px; }

/* 정책 */
.policy { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.policy li { display: flex; gap: 12px; }
.policy b { display: block; margin-top: 2px; }
.policy p { margin: 2px 0 0; color: var(--ink2); font-size: 14px; }
.code { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 13.5px; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 마스코트 */
.mascot .ms-limb { fill: none; stroke: var(--brand-deep); stroke-width: 5.5; stroke-linecap: round; }
.mascot .ms-hand { fill: var(--brand-deep); }
.mascot { --heart: #ff4d6d; }
.ms-hat, .ms-scarf { display: none; }

/* 아래 */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { max-width: 1040px; margin: 0 auto; padding: 24px 20px 34px; font-size: 13px; color: var(--muted); }
.foot-logo { display: flex; align-items: center; gap: 7px; color: var(--ink); font-family: var(--display); font-size: 15px; }
.foot p { margin: 8px 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot-links a:hover { color: var(--ink); }

/* 토스트 */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow-raised); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) { #toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media (max-width: 520px) { .seg-doc a svg { display: none; } .seg-doc a { padding: 0 12px; } }
.req-meta small { color: var(--muted); font-size: 12.5px; }

/* ---------- 가입·로그인 (토스 스타일) ---------- */
.focus .foot, .focus .tabbar { display: none !important; }
.focus { background: var(--surface); padding-bottom: 0 !important; }
.focus #snow { opacity: .5; }
.flow { max-width: 460px; margin: 0 auto; padding: 18px 22px 0; min-height: calc(100dvh - var(--top-h)); display: flex; flex-direction: column; }
.flow-back { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: -10px; border-radius: 12px; color: var(--ink); }
.flow-back:hover { background: var(--bg); }
.flow-t { font-family: var(--display); font-weight: 800; font-size: 27px; line-height: 1.38; letter-spacing: -0.02em; margin: 14px 0 8px; }
.flow-sub { margin: 0 0 30px; color: var(--muted); font-size: 15px; min-height: 1.6em; }
.flow-fields { display: flex; flex-direction: column; gap: 26px; }
.fld { animation: fldIn .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes fldIn { from { opacity: 0; transform: translateY(14px); } }
.fld label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 2px; transition: color .15s; }
.fld:focus-within label { color: var(--brand); }
.fld-row { display: flex; align-items: center; gap: 6px; border-bottom: 2px solid var(--line-strong); transition: border-color .15s; }
.fld > input { border-bottom: 2px solid var(--line-strong) !important; }
.fld-row:focus-within, .fld > input:focus { border-color: var(--brand) !important; }
.fld input { width: 100%; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent; padding: 8px 0 10px !important; font-size: 23px !important; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); outline: none; }
.fld input::placeholder { color: #c3c8d2; font-weight: 600; }
.fld-pre { font-size: 17px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.fld-eye { border: 0; background: var(--bg); color: var(--ink2); font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 8px; flex-shrink: 0; }
.fld-msg { margin: 8px 0 0; font-size: 13.5px; min-height: 1.2em; color: var(--muted); }
.fld-msg.err { color: var(--danger); }
.fld-msg.ok { color: var(--green); }
.fld.done input { color: var(--ink2); font-size: 19px !important; }
.flow-cta { margin-top: auto; position: sticky; bottom: 0; padding: 18px 0 calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--surface) 28%); }
.btn-cta { width: 100%; height: 56px; border-radius: 16px; font-size: 17px; }
.btn-cta:disabled { background: var(--brand-line); opacity: 1; color: #fff; }
.flow-terms { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.flow-terms a, .flow-alt a { color: var(--brand-deep); font-weight: 700; }
.flow-alt { text-align: center; font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.flow-alt.fine { font-size: 12.5px; margin-top: 6px; }
.focus .top-r, .focus .pnav { display: none !important; }
.focus .top-in { grid-template-columns: 1fr; }
.fld.done .fld-msg { display: none; }
.fld.done { margin-bottom: -8px; }
.fld.done label { font-size: 12px; }

/* ---------- 나무마크 요소 ---------- */
.wiki .sh { display: flex; align-items: baseline; gap: 4px; cursor: pointer; }
.wiki .sh .st { flex: 1; }
.sec-edit { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--muted); margin-left: auto; padding-left: 8px; white-space: nowrap; }
.sec-edit:hover { color: var(--brand-deep); }
.sec.shut > .sec-body, .sec.folded:not(.shut-open) > .sec-body { display: none; }
.sec.folded.shut > .sec-body { display: block; }
.sec.shut > .sh, .sec.folded > .sh { color: var(--muted); }
.sec.folded.shut > .sh { color: inherit; }
.indent { padding-left: 1.4em; margin: 0 0 6px; }
.fs { line-height: 1.4; }
.fsp1 { font-size: 1.15em; } .fsp2 { font-size: 1.3em; } .fsp3 { font-size: 1.5em; } .fsp4 { font-size: 1.75em; } .fsp5 { font-size: 2.05em; }
.fsm1 { font-size: .9em; } .fsm2 { font-size: .8em; } .fsm3 { font-size: .7em; } .fsm4 { font-size: .6em; } .fsm5 { font-size: .5em; }
.wiki code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .05em .35em; font-size: .9em; }
.wiki pre.code { background: #1d2130; color: #e6e9f2; border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; margin: 0 0 12px; }
.wiki pre.code code { background: none; border: 0; padding: 0; color: inherit; }
.wiki a.wl-x { color: #d63a3a; }
.wimg { display: block; margin: 6px 0 10px; }
.wimg img { max-width: 100%; height: auto; border-radius: 10px; vertical-align: middle; }
.wimg-center { text-align: center; }
.wimg-right { text-align: right; }
.wimg-x { color: var(--muted); font-size: .9em; }
.yt { display: block; position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin: 6px 0 12px; border-radius: 12px; overflow: hidden; background: #000; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wtable-wrap { overflow-x: auto; margin: 0 0 12px; }
.wtable-wrap.tbl-center .wtable { margin: 0 auto; }
.wtable-wrap.tbl-right .wtable { margin-left: auto; }
.wtable { border-collapse: collapse; font-size: 15px; }
.wtable caption { font-weight: 700; padding: 4px; }
.wtable td { border: 1px solid var(--line-strong); padding: 6px 10px; vertical-align: middle; }
.wtable .ta-center { text-align: center; } .wtable .ta-right { text-align: right; }
.fold { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; overflow: hidden; }
.fold > summary { cursor: pointer; padding: 10px 14px; font-weight: 700; background: var(--bg); list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: '▸ '; color: var(--brand); }
.fold[open] > summary::before { content: '▾ '; }
.fold-body { padding: 10px 14px 2px; }
.wbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 2px; margin: 0 0 12px; }
.cats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 22px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; }
.cats b { margin-right: 4px; color: var(--muted); }
.cats span { padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.anchor { position: relative; top: -70px; }
.clear { clear: both; }

/* ---------- 편집기 ---------- */
.page-wide { max-width: 1280px; }
.ed { position: relative; display: grid; gap: 10px; }
.ed-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); position: sticky; top: calc(var(--top-h) + 6px); z-index: 5; }
.tb { min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; background: none; font-size: 15px; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; line-height: 1; white-space: nowrap; }
.tb:hover { background: var(--surface); border-color: var(--line); }
.tb sup, .tb sub { font-size: 10px; line-height: 0; }
.tb-color { color: #e03131; font-weight: 900; text-decoration: underline; text-decoration-color: #e03131; text-underline-offset: 3px; }
.tb-sep { width: 1px; background: var(--line-strong); margin: 6px 4px; }
.tb-pop { position: absolute; z-index: 20; min-width: 200px; max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-raised); padding: 6px; display: grid; }
.tb-pop button { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tb-pop button:hover { background: var(--bg); }
.tb-pop .sw { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.ed-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.ed-src textarea { width: 100%; min-height: 70vh; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.65; }
.ed-prev { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; min-height: 70vh; max-height: 78vh; overflow: auto; position: sticky; top: calc(var(--top-h) + 64px); }
.ed-hint { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-deep); font-size: 13px; }
.ed-prev .sec:hover > .sh, .ed-prev .sec:hover > .sec-body { background: var(--brand-tint); border-radius: 6px; }
.ed-prev .sec-edit { color: var(--brand-deep); }
.ed-inline { border: 2px solid var(--brand); border-radius: 14px; padding: 10px; margin: 10px 0; background: var(--surface); box-shadow: 0 6px 22px rgba(26, 29, 36, .08); }
.ed-inline-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ed-inline-h b { color: var(--brand-deep); }
.ed-inline textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.6; }
.ed-inline-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ed-mtabs { display: none; }
@media (max-width: 980px) {
  .ed-mtabs { display: flex; }
  .ed-panes { grid-template-columns: 1fr; }
  .ed-panes.show-prev .ed-src, .ed-panes.show-src .ed-prev { display: none; }
  .ed-panes:not(.show-prev):not(.show-src) .ed-src { display: none; }
  .ed-prev { position: static; max-height: none; min-height: 50vh; padding: 12px; }
  .ed-src textarea { min-height: 60vh; }
  .ed-bar { top: calc(var(--top-h) + 4px); }
}
.ed-prev .sec > .sec-body { display: block !important; } .ed-prev .sec > .sh { color: inherit !important; }

/* 소개·개인정보 처리방침 본문 */
.prose { line-height: 1.75; font-size: 15px; color: var(--ink); }
.prose h2 { font-family: var(--display); font-weight: 800; font-size: 19px; margin: 0 0 10px; letter-spacing: -0.02em; }
.prose h3 { font-size: 15.5px; font-weight: 800; margin: 18px 0 4px; }
.prose p { margin: 0 0 10px; color: var(--ink2); }
.prose a:not(.btn) { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 3px; }
.page.narrow > .card + .card { margin-top: 14px; }

/* 친구 버튼 · 자동 반영 라디오 · 친구 목록 */
.fr-btn .fr-on { display: none; }
.fr-btn.on { color: var(--brand-deep); background: var(--brand-soft); border-color: var(--brand-line); }
.fr-btn.on .fr-on { display: inline-flex; }
.fr-btn.on .fr-add { display: none; }
.fr-btn span { display: inline-flex; }
.radio-grp { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 6px; margin: 0; display: grid; gap: 4px; }
.radio-grp legend { font-weight: 700; font-size: 13px; color: var(--ink2); padding: 0 4px; }
.form label.radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 2px; cursor: pointer; }
.radio input { margin-top: 3px; accent-color: var(--brand); width: 18px; height: 18px; flex-shrink: 0; }
.radio span { display: flex; flex-direction: column; gap: 2px; }
.radio b { font-size: 15px; color: var(--ink); }
.radio small { font-size: 13px; color: var(--ink2); font-weight: 500; line-height: 1.45; }
.fr-list { list-style: none; margin: 0; padding: 0; }
.fr-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.fr-list li:first-child { border-top: 0; }
.fr-list a { display: flex; flex-direction: column; min-width: 0; }
.fr-list a span { font-size: 13px; color: var(--ink2); }

/* ---- 스크롤 중 화면 깨짐 방지 ---- */
@media (max-width: 760px) {
  /* iOS/안드로이드에서 고정 요소 + backdrop-filter 는 스크롤할 때 깜빡이거나 늦게 따라와서 불투명 배경으로 */
  .top { background: rgba(255, 255, 255, .985); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar { background: rgba(255, 255, 255, .985); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .top, .tabbar { transform: translateZ(0); }
  .ed-bar .tb-sep { display: none; }
  .auth { margin: 20px 12px; }
}
.home-about { margin-top: 14px; }
