@font-face {
  font-family: "Paperlogy";
  src: url("/static/fonts/Paperlogy-4Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("/static/fonts/Paperlogy-6SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("/static/fonts/Paperlogy-7Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("/static/fonts/Paperlogy-8ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

/* ------------------------------------------------------------------ 토큰 */
/* Rowiki 팔레트 — CONDERI 고유 배색. 다른 위키의 브랜드 색·로고·문구는 쓰지 않는다. */
:root {
  --teal: #0E7C66;               /* 주색 */
  --teal-deep: #0A5A4A;
  --teal-ink: #085445;
  --teal-soft: #E8F3EF;
  --teal-fill: #0A5A4A;          /* 흰 글자를 얹는 버튼 바탕(대비 7.2:1) */
  --teal-fill-hover: #085445;
  --ink: #16212A;
  --ink-soft: #3A4A54;
  --brand-ink: #16212A;

  --bg: #F5F7F8;
  --surface: #FFFFFF;
  --surface-2: #FAFBFB;
  --line: #E3E8EA;
  --line-strong: #CFD6DB;
  --text: #16212A;
  --text-2: #5A6A73;
  --text-3: #6F7C85;
  --link: #0A6B58;
  --link-hover: #085445;
  --missing: #B3261E;
  --warn: #B26A00;
  --warn-bg: #FDF3E7;
  --ok-bg: #E8F3EF;
  --ok-text: #0A5A4A;
  --err-bg: #FCEDEC;
  --err-text: #A3221B;
  --code-bg: #F2F5F5;
  --shadow: 0 1px 2px rgba(16, 42, 86, .06), 0 8px 24px rgba(16, 42, 86, .05);
  --radius: 12px;
  --radius-sm: 8px;
  --sp: 4px;
  --max: 1320px;
  --font: "Paperlogy", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --teal: #34D3B6;               /* 다크 주색 */
  --teal-deep: #5EEAD4;
  --teal-ink: #9BF3E3;
  --teal-soft: #122A27;
  --teal-fill: #0F6B58;          /* 흰 글자 대비 6.4:1 */
  --teal-fill-hover: #0C5849;
  --ink: #E4EAEE;
  --ink-soft: #C3CFD7;
  --bg: #0F1417;
  --surface: #171E23;
  --surface-2: #131A1E;
  --line: #1E272E;
  --line-strong: #27323A;
  --text: #E4EAEE;
  --text-2: #AEBCC4;
  --text-3: #8B9AA2;
  --link: #5EEAD4;
  --link-hover: #8FF3E2;
  --missing: #FF9A90;
  --warn: #E5B074;
  --warn-bg: #2A2013;
  --ok-bg: #122A27;
  --ok-text: #7FEBD5;
  --err-bg: #2A1616;
  --err-text: #FFB4AD;
  --code-bg: #10171B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .35);
}

/* ------------------------------------------------------------------ 기본 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.01em;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  background: var(--teal);
  z-index: 40;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}
img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.35; }
p { margin: 0 0 12px; }
code, pre, kbd { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
button { font-family: inherit; }
.muted { color: var(--text-3); }
.dot { color: var(--text-3); margin: 0 4px; }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  width: 1px; height: 1px; overflow: hidden;
  background: var(--teal); color: #fff; padding: 12px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; width: auto; height: auto; overflow: visible; }

/* ------------------------------------------------------------------ 안내 바 */
.bar {
  padding: 8px 24px;
  font-size: 14px;
  text-align: center;
  border-bottom: 1px solid transparent;
}
.bar--ok { background: var(--ok-bg); color: var(--ok-text); }
.bar--err { background: var(--err-bg); color: var(--err-text); }
.bar--block { background: var(--warn-bg); color: var(--warn); font-weight: 600; }

/* ------------------------------------------------------------------ 셸 */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.main { min-width: 0; }
.rail { display: grid; gap: 16px; position: sticky; top: 88px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card__h {
  font-size: 14px; font-weight: 700; color: var(--text);
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.card__h::before {
  content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--teal);
}
.card__foot { margin: 8px 0 0; font-size: 12px; color: var(--text-3); }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rank__i { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.rank__n {
  flex: 0 0 16px; text-align: center; font-size: 12px; font-weight: 700; color: var(--teal-deep);
}
.rank__a {
  flex: 1 1 auto; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rank__a:hover { color: var(--link); }
.rank__c { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rank__empty, .rc__empty { font-size: 13px; color: var(--text-3); padding: 4px 0; }
.rc { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rc__i { font-size: 13px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.rc__i:last-child { border-bottom: none; padding-bottom: 0; }
.rc__t { display: block; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc__m { color: var(--text-3); font-size: 12px; }

/* ------------------------------------------------------------------ 대문 */
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.hero__eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--teal-deep); margin-bottom: 12px;
}
.hero__h { font-size: 40px; font-weight: 800; line-height: 1.25; color: var(--ink); margin-bottom: 16px; }
.hero__p { font-size: 16px; color: var(--text-2); max-width: 720px; margin-bottom: 24px; }
.hero__c { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.hero__stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  margin: 0; padding-top: 20px; border-top: 1px solid var(--line);
}
.hero__stats dt { font-size: 13px; color: var(--text-3); font-weight: 600; }
.hero__stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.home-main, .home-side { display: grid; gap: 16px; min-width: 0; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel__h {
  font-size: 18px; font-weight: 700; margin-bottom: 12px;
  padding-left: 10px; border-left: 3px solid var(--teal);
}
.panel__head .panel__h { margin-bottom: 0; }
.panel__more { font-size: 13px; font-weight: 600; }
.panel__body { color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-ink);
  font-size: 13px; font-weight: 600; border: 1px solid transparent;
}
.chip:hover { background: var(--teal); color: #fff; text-decoration: none; }
.chip--cat { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }
.chip--cat:hover { background: var(--teal-soft); color: var(--teal-ink); border-color: var(--teal); }
.deflist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.deflist li { color: var(--text-2); }
.deflist__meta { display: block; font-size: 12px; color: var(--text-3); }
.deflist__empty { color: var(--text-3); }

/* ------------------------------------------------------------------ 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px;
  border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; border-color: var(--teal); color: var(--teal-ink); }
.btn--primary { background: var(--teal-fill); border-color: var(--teal-fill); color: #fff; }
.btn--primary:hover { background: var(--teal-fill-hover); border-color: var(--teal-fill-hover); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--text-2); }
.btn--danger { background: var(--missing); border-color: var(--missing); color: #fff; }
.btn--block { width: 100%; }
.btn--sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn--roblox { background: #17191d; border-color: #17191d; color: #fff; font-weight: 700; }
.btn--roblox:hover { background: #000; color: #fff; }
.oauth__mark {
  width: 14px; height: 14px; background: #fff; display: inline-block;
  transform: rotate(-12deg); border-radius: 3px;
  box-shadow: inset 0 0 0 3px #17191d;
}

/* ------------------------------------------------------------------ 문서 */
.doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px 24px;
  box-shadow: var(--shadow);
}
.doc__head { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.doc__titlerow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.doc__title {
  font-size: 32px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.02em; word-break: keep-all;
}
.doc__sub {
  font-size: 15px; font-weight: 600; color: var(--text-3);
  padding: 2px 8px; border-radius: 6px; background: var(--surface-2);
  vertical-align: middle;
}
.doc__badge {
  font-size: 12px; font-weight: 700; color: var(--teal-ink);
  background: var(--teal-soft); padding: 2px 8px; border-radius: 4px;
}
.doc__meta { font-size: 13px; color: var(--text-3); margin: 8px 0 12px; }
.doc__tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tool {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 32px; padding: 4px 12px;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-2);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.tool:hover { border-color: var(--teal); color: var(--teal-ink); text-decoration: none; }
.tool--primary { background: var(--teal-fill); border-color: var(--teal-fill); color: #fff; }
.tool--primary:hover { background: var(--teal-fill-hover); border-color: var(--teal-fill-hover); color: #fff; }
.tool__n { font-size: 11px; background: var(--teal-soft); color: var(--teal-ink); border-radius: 999px; padding: 0 6px; }
.tool__more { position: relative; }
.tool__sum { list-style: none; }
.tool__sum::-webkit-details-marker { display: none; }
.tool__pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
  min-width: 180px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px;
}
.tool__pop a { padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text); }
.tool__pop a:hover { background: var(--teal-soft); text-decoration: none; }
.doc__acl {
  background: var(--warn-bg); color: var(--warn);
  border: 1px solid var(--warn); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; margin-bottom: 16px;
}
.doc__h2 {
  font-size: 20px; font-weight: 700; color: var(--ink);
  margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.doc__foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc__lic, .doc__credit { font-size: 12px; color: var(--text-3); margin: 0 0 4px; }

/* 제휴 광고(텐핑 소문박스) — 문서 본문 끝. 골드 없이 기존 회색·청록 토큰만 쓴다. */
.ad-slot {
  margin: 28px 0 8px; padding: 10px 12px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); text-align: center;
}
.ad-slot .ad-label {
  display: block; margin-bottom: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .18em; color: var(--text-3);
}
/* 스크립트가 클래스명을 바꿔도(발급 스크립트의 className 대입) 배치가 유지되게 태그로 잡는다. */
.ad-slot.ad-tenping tenping { display: block; width: 100%; max-width: 768px; margin: 0 auto; }
.ad-slot.ad-tenping tenping iframe { display: block; width: 100%; max-width: 100%; border: 0; margin: 0 auto; }
/* 여러 자리에 놓는 슬롯 — 문서 흐름 안에서는 위아래 여백만 준다(위키형 다중 배치). */
.doc > .ad-slot { margin: 0 0 20px; }
.doc__body > .ad-slot { margin: 0 0 20px; }
.doc__body > .ad-slot:first-child { margin-top: 0; }
/* 우측 레일 광고 — 레일 카드 폭에 맞춘다. 900px 이하(레일이 본문 아래로 내려갈 때)에는 숨긴다. */
.rail .ad-slot { margin: 0; padding: 8px 8px 10px; }
.rail .ad-slot.ad-tenping tenping { max-width: 100%; }
@media (max-width: 900px) {
  .rail .ad-slot { display: none; }
}

/* 목차 */
.toc {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 12px 16px; margin-bottom: 20px;
}
.toc__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.toc__title { font-size: 14px; font-weight: 700; color: var(--text-2); }
.toc__toggle {
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text-2); font-size: 12px; font-weight: 600;
  border-radius: 4px; padding: 2px 8px; cursor: pointer;
}
.toc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc__i { font-size: 14px; }
.toc__i--h1 { font-weight: 700; }
.toc__i--h2 { padding-left: 0; }
.toc__i--h3 { padding-left: 16px; }
.toc__i--h4 { padding-left: 32px; font-size: 13px; }
.toc__i--h5, .toc__i--h6 { padding-left: 48px; font-size: 13px; color: var(--text-2); }
.toc__i a { color: var(--text-2); }
.toc__i a:hover { color: var(--link); }
.toc[data-collapsed="1"] .toc__list { display: none; }

/* 위키 본문 */
.wiki { font-size: 16px; line-height: 1.8; color: var(--text); word-break: keep-all; }
.wiki p { margin: 0 0 14px; }
.wiki .ws { margin: 0; }
.wiki .ws__h {
  display: flex; align-items: center; gap: 8px;
  margin: 32px 0 12px; padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  font-size: 22px; color: var(--ink); font-weight: 700;
  scroll-margin-top: 96px;
}
.wiki .ws--h1 > .ws__h { font-size: 26px; border-bottom: 2px solid var(--teal); }
.wiki .ws--h3 > .ws__h { font-size: 19px; border-bottom: 1px solid var(--line); }
.wiki .ws--h4 > .ws__h, .wiki .ws--h5 > .ws__h, .wiki .ws--h6 > .ws__h {
  font-size: 17px; border-bottom: none; margin-bottom: 8px;
}
.ws__edit, .ws__toggle {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 4px; padding: 1px 6px; cursor: pointer; text-decoration: none;
  order: 1;
}
.ws__toggle { order: 2; }
.ws__edit:hover, .ws__toggle:hover { color: var(--teal-ink); border-color: var(--teal); text-decoration: none; }
.ws[data-collapsed="1"] .ws__body { display: none; }
.wikilink { color: var(--link); font-weight: 500; }
.wikilink--missing { color: var(--missing); }
.wikilink--missing:hover { color: var(--missing); }
.ext { color: var(--link); }
.ext__mark { font-size: 10px; margin-left: 2px; color: var(--teal-deep); }
.ext--blocked { color: var(--text-3); text-decoration: line-through; }
.icode {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; font-size: .92em;
}
.code {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px;
  overflow-x: auto; font-size: 14px; line-height: 1.6;
  margin: 0 0 16px; color: var(--text);
}
.fold {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin: 0 0 16px; background: var(--surface-2);
}
.fold__sum {
  padding: 10px 16px; cursor: pointer; font-weight: 600; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  list-style: none;
}
.fold__sum::-webkit-details-marker { display: none; }
.fold__hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.fold__body { padding: 4px 16px 16px; }
.quote {
  margin: 0 0 16px; padding: 12px 16px;
  border-left: 3px solid var(--teal); background: var(--surface-2);
  border-radius: 0 8px 8px 0; color: var(--text-2);
}
.quote--d2 { margin-left: 16px; }
.quote--d3 { margin-left: 32px; }
.wiki-hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.wiki-list { margin: 0 0 16px; padding-left: 20px; }
.wiki-list__sub { margin: 4px 0; padding-left: 20px; }
.wiki-list__item { margin: 4px 0; }
.wiki-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  border: 1px solid var(--line-strong);
}
.wiki-table th, .wiki-table td {
  border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top;
}
.wiki-table thead th, .wiki-table tr:first-child th {
  background: var(--surface-2); font-weight: 700; color: var(--text);
}
.wiki-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table-wrap { overflow-x: auto; margin: 0 0 16px; border-radius: var(--radius-sm); }
.fn { font-size: .75em; margin-left: 1px; position: relative; }
.fn__link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 4px; background: var(--teal-soft); color: var(--teal-ink);
  font-weight: 700; text-decoration: none;
}
.fn__tip {
  display: none; position: absolute; left: 0; top: 130%; z-index: 25;
  min-width: 200px; max-width: 320px;
  background: var(--ink); color: #fff;
  padding: 8px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5;
  box-shadow: var(--shadow);
}
.fn:hover .fn__tip, .fn:focus-within .fn__tip { display: block; }
html[data-theme="dark"] .fn__tip { background: #2b333c; }
.fnotes {
  margin-top: 32px; padding: 16px 20px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.fnotes__h { font-size: 15px; font-weight: 700; margin-bottom: 8px; color: var(--text-2); }
.fnotes__list { margin: 0; padding-left: 20px; font-size: 14px; color: var(--text-2); }
.fnotes__i { margin: 4px 0; }
.fnotes__back { font-size: 12px; margin-left: 4px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 24px; }
.cats__l { font-size: 13px; font-weight: 700; color: var(--text-3); }
.include { margin: 0 0 16px; }
.include--missing, .include--limit {
  border: 1px dashed var(--line-strong); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--text-3);
}
.catlist, .aplist, .blist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cat__i, .apl__i, .blist li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.cat__m, .apl__m { font-size: 12px; color: var(--text-3); }

/* ------------------------------------------------------------------ 편집기 */
.editor {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow);
}
.editor__head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.editor__h { font-size: 24px; color: var(--ink); }
.editor__meta { font-size: 13px; color: var(--text-3); margin: 8px 0 0; }
.editor__hint { font-size: 13px; color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 8px; }
.editor__form { display: grid; gap: 16px; }
.field { display: grid; gap: 4px; }
.field__l { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field__in, .field__ta {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 15px;
}
.field__in--sm { width: auto; padding: 4px 8px; font-size: 13px; }
.field__ta {
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; line-height: 1.7;
  resize: vertical; min-height: 420px;
}
.field__hint { font-size: 12px; color: var(--text-3); margin: 4px 0 0; }
.editor__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.editor__count { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.editor__agree { font-size: 12px; color: var(--text-3); }
.preview { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.preview__h { font-size: 16px; color: var(--text-2); margin-bottom: 12px; }
.help { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.help__sum { padding: 12px 16px; font-weight: 700; font-size: 15px; cursor: pointer; }
.help__table { margin: 0 16px 12px; }
.help__table th[scope="row"] { width: 42%; font-weight: 500; }
.help__more { padding: 0 16px 16px; font-size: 13px; color: var(--text-3); margin: 0; }

/* ------------------------------------------------------------------ 역사·비교 */
.doc--sub { padding: 24px 28px; }
.cmp {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 16px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 16px;
}
.cmp__l { font-size: 13px; font-weight: 700; color: var(--text-2); }
.cmp__sel {
  padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 13px; max-width: 260px;
}
.cmp__arrow { color: var(--text-3); }
.hist td, .hist th { font-size: 13px; }
.hist__rev { font-weight: 700; font-variant-numeric: tabular-nums; }
.hist__delta { font-variant-numeric: tabular-nums; color: var(--teal-deep); font-weight: 600; }
.hist__size { font-variant-numeric: tabular-nums; color: var(--text-3); }
.hist__ip { color: var(--text-3); font-variant-numeric: tabular-nums; }
.hist__form { margin: 0; }
.hist__btn {
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text-2); font-size: 12px; font-weight: 600;
  border-radius: 4px; padding: 2px 8px; cursor: pointer;
}
.hist__btn:hover { border-color: var(--teal); color: var(--teal-ink); }
.hist__note { font-size: 12px; color: var(--text-3); margin-top: 12px; }
.diff td { font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; padding: 2px 8px; }
.diff .df__n { width: 48px; text-align: right; color: var(--text-3); background: var(--surface-2); }
.df--ins .df__c--r { background: var(--ok-bg); color: var(--ok-text); }
.df--del .df__c--l { background: var(--err-bg); color: var(--err-text); }
.df--rep .df__c--l { background: var(--err-bg); color: var(--err-text); }
.df--rep .df__c--r { background: var(--ok-bg); color: var(--ok-text); }
.df__add { color: var(--ok-text); font-weight: 700; }
.df__sub { color: var(--err-text); font-weight: 700; }

/* ------------------------------------------------------------------ 토론 */
.thrlist { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; }
.thr__a {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "s t" "s m";
  gap: 2px 12px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
}
.thr__a:hover { border-color: var(--teal); text-decoration: none; }
.thr__status {
  grid-area: s; align-self: start;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-ink); white-space: nowrap;
}
.thr__status--paused { background: var(--warn-bg); color: var(--warn); }
.thr__status--closed { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line); }
.thr__topic { grid-area: t; font-weight: 600; font-size: 15px; }
.thr__meta { grid-area: m; font-size: 12px; color: var(--text-3); }
.thr--empty { color: var(--text-3); font-size: 14px; padding: 12px 0; }
.thrnew, .cmtnew {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; background: var(--surface-2); display: grid; gap: 12px;
}
.thrnew__h { font-size: 16px; color: var(--ink); }
.thrnew__blocked, .cmtnew__blocked {
  font-size: 14px; color: var(--warn); background: var(--warn-bg);
  padding: 8px 12px; border-radius: 8px;
}
.cmtlist { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.cmt {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; background: var(--surface);
}
.cmt:target { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.cmt__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.cmt__no { font-size: 12px; font-weight: 800; color: var(--teal-deep); }
.cmt__by { font-size: 14px; font-weight: 700; }
.cmt__time { font-size: 12px; color: var(--text-3); }
.cmt__body { font-size: 15px; color: var(--text); }
.mod {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 12px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 8px;
}
.mod__l { font-size: 13px; font-weight: 700; color: var(--text-3); }

/* ------------------------------------------------------------------ 검색·목록 */
.reslist { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 16px; }
.res { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.res__t { font-size: 18px; font-weight: 700; color: var(--link); }
.res__s { font-size: 14px; color: var(--text-2); margin: 8px 0; }
.res__m { font-size: 12px; color: var(--text-3); }
.res__new {
  padding: 16px; border: 1px dashed var(--teal); border-radius: var(--radius-sm);
  background: var(--teal-soft); margin-bottom: 16px;
}
.res__new p { margin: 0 0 8px; color: var(--teal-ink); }
.res--empty { color: var(--text-3); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0 0 24px; }
.stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.stats dt { font-size: 12px; color: var(--text-3); font-weight: 600; }
.stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ 운영 */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  padding: 8px 14px; border-radius: 8px 8px 0 0;
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.tab:hover { background: var(--surface-2); text-decoration: none; }
.tab--on { background: var(--teal-soft); color: var(--teal-ink); box-shadow: inset 0 -2px 0 var(--teal); }
.admin__note { font-size: 13px; color: var(--text-3); background: var(--surface-2); padding: 8px 12px; border-radius: 8px; }
.blknew { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; background: var(--surface-2); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.field--grow { grid-column: span 2; }
.inl { display: flex; gap: 4px; align-items: center; margin: 0; }
.hash { font-size: 11px; color: var(--text-3); }
.multibox { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; }
.multibox__h { font-size: 14px; font-weight: 700; margin: 0 0 4px; }
.multibox ul { margin: 0; padding-left: 20px; font-size: 14px; color: var(--text-2); }
.aclform { display: grid; gap: 16px; max-width: 420px; }

/* ------------------------------------------------------------------ 인증 */
.auth { display: flex; justify-content: center; padding: 24px 0; }
.auth__card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow);
}
.auth__card--wide { max-width: 620px; }
.auth__h { font-size: 26px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.auth__p { font-size: 14px; color: var(--text-2); margin-bottom: 16px; }
.auth__form { display: grid; gap: 12px; }
.auth__form--narrow { max-width: 420px; margin-bottom: 24px; }
.auth__alt { font-size: 14px; color: var(--text-2); margin: 16px 0 0; text-align: center; }
.auth__or {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
  color: var(--text-3); font-size: 12px;
}
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth { display: grid; gap: 8px; margin: 16px 0 0; }
.oauth__consent {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12px; color: var(--text-2); line-height: 1.5;
}
.oauth__consent input { margin-top: 3px; }
.oauth__note { font-size: 11px; color: var(--text-3); margin: 0; text-align: center; }
.oauth--off .oauth__off { font-size: 13px; color: var(--text-3); background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }
.acct__roblox { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.acct__rbav { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.acct__rbname { font-weight: 700; margin: 0; }
.acct__rbid { font-size: 13px; color: var(--text-3); margin: 2px 0 0; }
.user__head { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; }
.user__av { width: 88px; height: 88px; border-radius: 16px; object-fit: cover; }
.user__av--t {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-fill); color: #fff; font-size: 36px; font-weight: 800;
}
.user__meta { font-size: 13px; color: var(--text-3); margin: 4px 0; }
.user__rb { font-size: 14px; margin: 4px 0; }
.user__bio { font-size: 14px; color: var(--text-2); margin: 8px 0 0; }
.user__note, .privacy__note { font-size: 12px; color: var(--text-3); margin-top: 16px; }

/* ------------------------------------------------------------------ 오류 */
.errbox {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 48px 32px; text-align: center; box-shadow: var(--shadow);
}
.errbox__code { font-size: 56px; font-weight: 800; color: var(--teal); margin: 0; line-height: 1; }
.errbox__h { font-size: 24px; margin: 12px 0 8px; color: var(--ink); }
.errbox__p { font-size: 15px; color: var(--text-2); margin-bottom: 24px; }
.errbox__c { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.alert { border-radius: 8px; padding: 8px 12px; font-size: 14px; margin-bottom: 16px; }
.alert--err { background: var(--err-bg); color: var(--err-text); }
.alert--ok { background: var(--ok-bg); color: var(--ok-text); }

/* ------------------------------------------------------------------ 푸터 */
.foot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 40px; }
.foot__in {
  max-width: var(--max); margin: 0 auto; padding: 40px 24px 32px;
  display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 32px;
}
.foot__brand img { height: 28px; width: auto; margin-bottom: 8px; }
.foot__tag { font-size: 14px; color: var(--text-2); margin: 0 0 12px; }
.foot__lic { font-size: 12px; color: var(--text-3); line-height: 1.6; margin: 0; }
.foot__cols { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 24px; }
.foot__h { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.foot__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.foot__list a { color: var(--text-2); }
.foot__addr {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 16px;
  font-style: normal; font-size: 12px; color: var(--text-3);
}
.foot__copy {
  grid-column: 1 / -1; font-size: 11px; color: var(--text-3);
  border-top: 1px solid var(--line); padding-top: 16px; margin: 8px 0 0;
}

/* ------------------------------------------------------------------ 반응형 */
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); display: grid; }
  .foot__in { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .foot__cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .doc { padding: 20px 16px; }
  .doc__title { font-size: 24px; }
  .doc__h2 { font-size: 18px; }
  .wiki { font-size: 15px; }
  .wiki .ws__h { font-size: 19px; margin-top: 24px; }
  .hero { padding: 24px 20px; }
  .hero__h { font-size: 26px; }
  .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { padding: 16px; }
  .field__ta { min-height: 320px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth__card { padding: 24px 20px; }
  .foot__cols { grid-template-columns: 1fr; }
  .res__t { font-size: 16px; }
  .toc { padding: 12px; }
}
@media (max-width: 420px) {
  .acct__name { display: none; }
  .doc__title { font-size: 22px; }
  .hero__h { font-size: 22px; }
  .hero__stats dd { font-size: 20px; }
  .wiki .ws__edit, .wiki .ws__toggle { display: none; }
}

/* ------------------------------------------------------------------ */
/* Rowiki 수준 고도화 (2026-11-15) — 툴바·미리보기·별표·diff 단어·특수 문서 */
/* ------------------------------------------------------------------ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.bar--redirect { background: var(--teal-soft); color: var(--teal-ink); }
.bar--redirect a { font-weight: 700; color: inherit; text-decoration: underline; }
.bar__muted { color: var(--text-3); font-weight: 400; }

.rc__sum {
  display: -webkit-box; margin-top: 2px; font-size: 12px; color: var(--text-3);
  -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}

/* 뱃지·검색 강조·이미지·매크로 */
.badge {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; vertical-align: middle; white-space: nowrap;
}
.badge--admin { background: #e8eefc; color: #1d3f8f; border: 1px solid #c9d8f7; }
.badge--mod { background: var(--teal-soft); color: var(--teal-ink); border: 1px solid #bfe7e2; }
html[data-theme="dark"] .badge--admin { background: #16224a; color: #a9c3ff; border-color: #26386b; }
html[data-theme="dark"] .badge--mod { background: #102b28; color: #5eead4; border-color: #1d4a44; }
mark.hit { background: #fff3bf; color: inherit; padding: 0 1px; border-radius: 3px; }
html[data-theme="dark"] mark.hit { background: #5c4a00; color: #ffe89a; }
.fig { display: inline-block; max-width: 100%; }
.fig--center { display: block; text-align: center; }
.fig--right { float: right; margin: 0 0 8px 12px; }
.fig--left { float: left; margin: 0 12px 8px 0; }
.fig__img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.file-missing { color: var(--missing); }
.macro { font-variant-numeric: tabular-nums; }
.macro--dday { font-weight: 700; color: var(--teal-deep); }
ruby rt { font-size: 11px; color: var(--text-3); }
.clearfix { display: block; clear: both; }
.cmt__report { margin-left: auto; font-size: 12px; color: var(--text-3); }
.cmt__report:hover { color: var(--missing); }
.user__links { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.tool--report { border-color: #e0c3c3; color: #a12626; }
html[data-theme="dark"] .tool--report { border-color: #5a2b2b; color: #ff9b9b; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }

/* 게시판 */
.board .st, .st { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.st--open { background: var(--warn-bg); color: var(--warn); }
.st--reviewing { background: #eef2fb; color: #2b4a8b; }
.st--done { background: var(--ok-bg); color: var(--ok-text); }
.st--rejected { background: var(--surface-2); color: var(--text-3); }
html[data-theme="dark"] .st--reviewing { background: #17233a; color: #9dbbf5; }
.board__form { display: grid; gap: 10px; margin: 20px 0 0; }

/* 업로드 */
.upload__form { display: grid; gap: 10px; margin: 12px 0 20px; }
.up { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.up__a { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line);
         border-radius: var(--radius-sm); background: var(--surface); }
.up__a:hover { border-color: var(--teal); text-decoration: none; }
.up__img { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.up__n { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden;
         text-overflow: ellipsis; white-space: nowrap; }
.up__m { font-size: 11px; color: var(--text-3); }
.up__empty { color: var(--text-3); font-size: 14px; }

/* 별표 */
.star__form { margin: 0 0 0 auto; }
.star {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--text-3); font-size: 13px; font-weight: 700; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.star:hover { border-color: var(--teal); color: var(--teal-deep); }
.star--on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-deep); }
.star__ico { font-size: 14px; line-height: 1; }

/* 대문 */
.main--home { max-width: none; }

.hero__search { display: flex; gap: 8px; max-width: 560px; margin: 0 0 16px; }
.hero__in {
  flex: 1 1 auto; min-width: 0; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  color: var(--text); font-family: inherit;
}
.home-grid--rail { grid-template-columns: minmax(0, 1fr) 320px; }
.panel__foot { margin: 10px 0 0; font-size: 13px; }
.panel__foot a { color: var(--text-2); }
.chip__n {
  display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-3); font-size: 11px; font-weight: 700;
}
.feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.feat__a {
  display: grid; gap: 4px; padding: 12px 14px; height: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.feat__a:hover { border-color: var(--teal); background: var(--teal-soft); text-decoration: none; }
.feat__t { font-weight: 700; color: var(--ink); }
.feat__d { font-size: 13px; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feat__m { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.disc { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.disc__i { font-size: 14px; display: grid; gap: 2px; }
.disc__m { font-size: 12px; color: var(--text-3); }

/* 편집기 툴바·탭 */
.tb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.tb__l { font-size: 12px; font-weight: 700; color: var(--text-3); margin-right: 4px; }
.tb__b {
  padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--surface); color: var(--text-2); font-size: 13px; font-family: inherit;
  cursor: pointer;
}
.tb__b:hover { border-color: var(--teal); color: var(--teal-deep); background: var(--teal-soft); }
.tb__b:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.tb__hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.edtabs { display: flex; align-items: center; gap: 4px; margin: 8px 0 0; }
.edtab {
  padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 8px 8px 0 0;
  background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.edtab--on { background: var(--surface); color: var(--teal-deep); border-bottom-color: var(--surface); }
.edtabs__note { margin-left: auto; font-size: 12px; color: var(--text-3); }
.preview--live { margin-top: 0; border-top-left-radius: 0; }
.editor__section {
  margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--teal-soft); color: var(--teal-ink); font-size: 14px;
}
.editor__section a { color: inherit; text-decoration: underline; }

/* diff — 단어 단위 강조 */
.df--ins td { background: rgba(14, 124, 102, .08); }
.df--del td { background: rgba(198, 40, 40, .08); }
.df--rep td { background: rgba(178, 106, 0, .07); }
.df__w { border-radius: 3px; padding: 0 1px; }
.df__w--ins { background: rgba(14, 124, 102, .28); font-weight: 600; }
.df__w--del { background: rgba(198, 40, 40, .26); text-decoration: line-through; }
.df__empty { display: inline-block; min-width: 2px; }
/* 기존 diff 규칙이 셀 배경을 덮지 않도록 우선순위 보정 */
.diff .df--ins .df__c--r, .diff .df--del .df__c--l { background: transparent; }

/* 기여 내역 */
.ctb__k { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.ctb__k--edit { background: var(--teal-soft); color: var(--teal-ink); }
.ctb__k--thread { background: #eef2fb; color: #2b4a8b; }
.ctb__k--comment { background: var(--surface-2); color: var(--text-2); }
html[data-theme="dark"] .ctb__k--thread { background: #17233a; color: #9dbbf5; }
.ctb__rev { margin-left: 6px; font-size: 12px; color: var(--text-3); }
.ctb__t, .ctb__s { color: var(--text-2); font-size: 13px; }

/* 편집 요청 */
.ereq { display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.ereq--open { background: var(--warn-bg); color: var(--warn); }
.ereq--accepted { background: var(--ok-bg); color: var(--ok-text); }
.ereq--rejected { background: var(--err-bg); color: var(--err-text); }
.panel--review { border-color: var(--teal); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0; }
.tool--req { border-color: var(--warn); color: var(--warn); }

/* 특수 문서 */
.spc { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
       grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.spc__a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.spc__a:hover { border-color: var(--teal); background: var(--teal-soft); text-decoration: none; }
.spc__t { font-weight: 700; color: var(--ink); }
.spc__d { grid-column: 1 / -1; font-size: 13px; color: var(--text-2); }
.spc__n { font-size: 13px; font-weight: 700; color: var(--teal-deep); font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .home-grid--rail { grid-template-columns: 1fr; }
  .hero__search { flex-direction: column; }
  .star__form { margin-left: 0; }
  .tb__hint { display: none; }
}
@media (max-width: 560px) {
  .doc__titlerow { flex-wrap: wrap; }
  .edtabs__note { display: none; }
}

@media print {
  .hdr, .rail, .foot__cols, .doc__tools, .theme, .toc__toggle { display: none; }
  body { background: #fff; }
  .doc { box-shadow: none; border: none; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ================================================================== */
/* UI/UX 패리티 컴포넌트 (P0-U) — Rowiki 자체 클래스 체계               */
/* ================================================================== */
:root {
  --nav-h: 56px;
  --rail-w: 278px;
  --ctrl-h: 40px;
  --seg-h: 36px;
}

/* 배너 행 */
.banners { display: grid; margin: 12px 0 0; }
.banner {
  display: flex; align-items: center; gap: 9px; padding: 9px 2px;
  border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--text-2);
}
.banner:first-child { border-top: 1px solid var(--line); }
.banner__ico {
  flex: 0 0 18px; width: 18px; height: 18px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 50%; background: var(--teal-soft);
  color: var(--teal-ink); font-size: 11px; font-weight: 700;
}
.banner--protect .banner__ico { background: var(--warn-bg); color: var(--warn); }
.banner--redirect .banner__ico { background: var(--teal-soft); color: var(--teal-ink); }
.banner--talk .banner__ico { background: var(--teal-fill); color: #fff; }
.banner--delete .banner__ico { background: var(--err-bg); color: var(--err-text); }
.banner--acl .banner__ico { background: var(--warn-bg); color: var(--warn); }
.banner a { font-weight: 700; }

/* 분류 링크 줄 */
.cats { display: block; margin: 14px 0 0; font-size: 14px; }
.cats__l { font-weight: 700; color: var(--text-3); margin-right: 6px; font-size: 13px; }
.cat-line { display: inline; }
.cat-line__a { color: var(--link); font-size: 14px; }
.cat-line__sep { color: var(--text-3); margin: 0 7px; }
.cat-line__more {
  margin-left: 8px; border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--text-2); font-size: 12px; font-weight: 600; border-radius: 6px;
  padding: 1px 8px; cursor: pointer;
}
.cat-line[data-more="1"] .cat-line__i--extra { display: inline; }
.cat-line__i--extra { display: none; }
.cats--bottom { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.chip--blur { filter: blur(3px); }

/* 목차 박스 */
.toc { width: 256px; max-width: 100%; padding: 10px 12px 10px 20px; }
.toc__title::after { content: " 목차"; }
.toc__title { font-size: 0; }
.toc__title::before { content: "목차"; font-size: 14px; }
.toc__toggle { width: 22px; height: 22px; padding: 0; font-size: 0; }
.toc__toggle::before { content: "⌄"; font-size: 14px; line-height: 1; }
.toc[data-collapsed="1"] .toc__toggle::before { content: "›"; }
.toc__i { font-size: 14px; line-height: 1.5; }
.toc__i a { display: inline-block; padding: 1px 0; }

/* 문단 접기 — 제목 클릭 토글, V표 */
.ws__h { cursor: pointer; }
.ws__h::before {
  content: ""; width: 10px; height: 10px; flex: 0 0 10px;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg) translateY(-2px); transition: transform .12s ease; margin-right: 2px;
}
.ws[data-collapsed="1"] > .ws__body { display: none; }
.ws[data-collapsed="1"] > .ws__h::before { transform: rotate(-45deg) translateX(-2px); }
.ws__toggle { display: none; }
.ws__edit { font-size: 12.5px; font-weight: 700; color: var(--link); }
.ws--folded > .ws__body { display: none; }
.ws--folded[data-open="1"] > .ws__body { display: block; }

/* 각주 — 팝오버 / 팝업 / 펼침 */
.fn { position: relative; }
.fn__link {
  font-size: 11.5px; font-weight: 700; color: var(--link); text-decoration: none;
  padding: 0 1px;
}
.fn__tip { display: none; }
.fn-pop {
  position: absolute; z-index: 50; left: 0; top: calc(100% + 6px);
  max-width: 340px; min-width: 180px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.6;
  color: var(--text); white-space: normal;
}
.fn-pop__no { font-weight: 700; color: var(--teal-ink); margin-right: 4px; }
.fn-pop[hidden] { display: none; }
html[data-fn="open"] .fn-pop { position: static; display: none !important; }
html[data-fn="open"] .fn__tip { display: none; }
.fnotes[hidden] { display: none; }
.fnotes__i:target { background: var(--teal-soft); }

/* 우측 레일 */
.shell { grid-template-columns: minmax(0, 1fr) var(--rail-w); }
.rail { width: var(--rail-w); }
.rail .card { padding: 14px 16px; }
.rail-card__h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail-card__more { font-size: 12px; color: var(--text-3); }
.rc { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rc__i { display: grid; gap: 1px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.rc__i:last-child { border-bottom: 0; }
.rc__t { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc__m { font-size: 11.5px; color: var(--text-3); display: flex; gap: 4px; align-items: center; }

/* 플로팅 3버튼 */
.float {
  position: fixed; right: 18px; bottom: 22px; z-index: 45;
  display: grid; gap: 8px;
}
.float__b {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text-2); font-size: 15px; font-weight: 700;
  box-shadow: var(--shadow); cursor: pointer;
}
.float__b:hover { border-color: var(--teal); color: var(--teal-ink); text-decoration: none; }
.float__b[hidden] { display: none; }

/* 모바일 서랍 */
.drawer-btn { display: none; }
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(84vw, 320px); z-index: 80;
  background: var(--surface); border-left: 1px solid var(--line-strong);
  box-shadow: -8px 0 30px rgba(0,0,0,.18); padding: 18px 16px;
  display: grid; align-content: start; gap: 6px; overflow: auto;
}
.drawer[hidden] { display: none; }
.drawer__h { font-size: 13px; font-weight: 700; color: var(--text-3); margin: 12px 0 4px; }
.drawer a {
  display: flex; align-items: center; min-height: 44px; padding: 0 10px;
  border-radius: 8px; color: var(--text); font-size: 15px;
}
.drawer a:hover { background: var(--teal-soft); text-decoration: none; }
.drawer__close {
  justify-self: end; width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 16px; cursor: pointer;
}
.drawer-mask { position: fixed; inset: 0; background: rgba(8, 20, 24, .42); z-index: 70; }
.drawer-mask[hidden] { display: none; }

/* 필터 탭 */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.tab {
  height: 40px; display: inline-flex; align-items: center; padding: 0 13px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--teal-ink); text-decoration: none; }
.tab--on { color: var(--teal-ink); border-bottom-color: var(--teal); font-weight: 700; }
.tab__n { font-size: 11px; color: var(--text-3); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* 역사·리비전 */
.rev-row__acts { display: flex; gap: 4px; flex-wrap: wrap; }
.rev-btn {
  display: inline-flex; align-items: center; height: 26px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2);
  font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.rev-btn:hover { border-color: var(--teal); color: var(--teal-ink); text-decoration: none; }
.rev-btn--on { background: var(--teal-fill); border-color: var(--teal-fill); color: #fff; }
.hist__cmp { width: 34px; }
.hist__row[data-sel="1"] { background: var(--teal-soft); }
.blame { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.blame th, .blame td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.blame__meta { white-space: nowrap; font-size: 11.5px; color: var(--text-3); }
.blame__row--new { background: var(--teal-soft); }

/* 사용자 설정 */
.settings { display: grid; gap: 18px; }
.setting {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.setting__l { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.setting__d { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.setting__opts { display: flex; flex-wrap: wrap; gap: 8px; }
.setting__opt {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2);
  font-size: 13.5px; color: var(--text-2); cursor: pointer;
}
.setting__opt input { accent-color: var(--teal); }
.setting__actions { display: flex; gap: 8px; align-items: center; }

/* 분류 문서 */
.catdoc__sec { margin: 22px 0 0; }
.catdoc__h {
  font-size: 18px; font-weight: 700; color: var(--ink); margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.catdoc__n { font-size: 12px; font-weight: 700; color: var(--teal-ink); background: var(--teal-soft); border-radius: 999px; padding: 1px 8px; }
.catdoc__letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 12px; }
.catdoc__letter {
  min-width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2);
  font-size: 12.5px; font-weight: 700; color: var(--text-2); padding: 0 6px;
}
.catdoc__letter:hover { border-color: var(--teal); color: var(--teal-ink); text-decoration: none; }
.catdoc__group { margin: 10px 0 0; }
.catdoc__gl { font-size: 13px; font-weight: 700; color: var(--teal-deep); margin: 0 0 4px; }
.catdoc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.catdoc__li { font-size: 14.5px; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.catdoc__m { font-size: 11.5px; color: var(--text-3); }

/* 토론 절차 */
.agree { border: 1px solid var(--teal); border-radius: 10px; background: var(--teal-soft); padding: 12px 14px; margin: 14px 0; }
.agree__h { font-size: 14px; font-weight: 700; color: var(--teal-ink); margin: 0 0 6px; }
.agree__m { font-size: 12.5px; color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 0; }
.agree__acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thread__frozen { border: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* 편집 화면 */
.editor__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.editor__tools { display: flex; gap: 6px; flex-wrap: wrap; }
.editor__del { color: var(--err-text); border-color: var(--err-text); }
.tb { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); }
.tb__b { height: 30px; padding: 0 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.tb__b:hover { background: var(--surface); border-color: var(--line-strong); color: var(--teal-ink); }
.tb__l { font-size: 11px; font-weight: 700; color: var(--text-3); margin-right: 4px; }
.field__ta { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; font-size: 15px; line-height: 1.6; }
.edtabs { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); padding: 4px 6px 0; }
.edtab { height: 34px; padding: 0 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: transparent; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; font-family: inherit; }
.edtab--on { background: var(--surface); border-color: var(--line); color: var(--teal-ink); }
.edtab__note, .edtabs__note { margin-left: auto; font-size: 12px; color: var(--text-3); padding: 0 6px 6px; }

/* 위키 문법 확장 */
.sz { line-height: 1.45; }
.sz--p1 { font-size: 1.28889em; } .sz--p2 { font-size: 1.38889em; } .sz--p3 { font-size: 1.48144em; }
.sz--p4 { font-size: 1.57400em; } .sz--p5 { font-size: 1.66667em; }
.sz--m1 { font-size: .92589em; } .sz--m2 { font-size: .83333em; } .sz--m3 { font-size: .74067em; }
.sz--m4 { font-size: .64811em; } .sz--m5 { font-size: .62222em; }
.col { color: inherit; }
.wikivis { margin: 12px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.wikivis--center { text-align: center; } .wikivis--right { text-align: right; } .wikivis--left { text-align: left; }
.wikivis--border { border: 1px solid var(--line-strong); }
.wikivis--float-left { float: left; margin: 4px 14px 10px 0; }
.wikivis--float-right { float: right; margin: 4px 0 10px 14px; }
.anchor { scroll-margin-top: 96px; }
.wiki-table th { font-weight: 700; }
.wiki-table td, .wiki-table th { padding: 5px 10px; }
.table-wrap { overflow-x: auto; }
figcaption { font-size: 12.5px; color: var(--text-3); text-align: center; margin-top: 4px; }
.fig__img--only-dark { display: none; }
html[data-theme="dark"] .fig__img--only-dark { display: inline-block; }
html[data-theme="dark"] .fig__img--only-light { display: none; }
html[data-theme="dark"] .df--ins td { background: rgba(52, 211, 182, .1); }

/* 900px 이하 — 서랍·아이콘 액션바·하단 목차 */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: 12px; gap: 16px; }
  .rail { width: auto; position: static; }
  .toc { width: 100%; }
  .setting { grid-template-columns: 1fr; }
  .catdoc__letters { gap: 3px; }
  .fn-pop {
    position: fixed; left: 8px; right: 8px; bottom: 12px; top: auto; max-width: none;
    border-radius: 12px; box-shadow: 0 -6px 28px rgba(0,0,0,.24); padding: 14px;
  }
}
@media (max-width: 560px) {
  .viewchip { display: none; }
  .banner { font-size: 13.5px; }
}

/* 운영진 이용 관리 */
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px;
  font-weight: 700; background: var(--teal-soft); color: var(--teal-ink);
}
.badge--block { background: var(--err-bg); color: var(--err-text); }
.badge--lock { background: var(--warn-bg); color: var(--warn); }
.bulkbar {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px;
  align-items: flex-end; margin: 12px 0 0; padding: 12px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
}
.bulkbar strong { font-size: 14px; color: var(--ink); margin-right: 4px; }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface); }
.panel__h { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; }
.kv dt { color: var(--text-3); font-weight: 700; font-size: 13px; }
.kv dd { margin: 0; color: var(--text); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.mail-body { white-space: pre-wrap; max-width: 620px; }
.field--inline { display: inline-flex; flex-direction: column; gap: 4px; min-width: 0; }
.field--inline .field__in { height: 38px; }
.btn--danger { background: var(--err-text); border-color: var(--err-text); color: #fff; }
.btn--danger:hover { filter: brightness(.94); color: #fff; }
.alert--ok { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-text); }
.auth__links { margin: 10px 0 0; font-size: 13.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.auth__links a { font-weight: 600; color: var(--link); }

/* 글자 크기 설정 */
html[data-fs="0"] .wiki { font-size: 16px; }
html[data-fs="1"] .wiki { font-size: 16.5px; }
html[data-fs="2"] .wiki { font-size: 17px; }
html[data-fs="3"] .wiki { font-size: 18px; }
html[data-fs="4"] .wiki { font-size: 19px; }
html[data-fs="5"] .wiki { font-size: 20px; }

.seg__form { display: contents; }
.seg .tool__n { background: var(--teal-soft); color: var(--teal-ink); }
.seg__b--fill .tool__n { background: rgba(255,255,255,.22); color: #fff; }
.wikivis--fw-bold { font-weight: 700; }
.wikivis--fw-normal { font-weight: 400; }
.ta--left { text-align: left; } .ta--center { text-align: center; } .ta--right { text-align: right; }
.fnotes-wrap[hidden] { display: block; }
html[data-fn="open"] .fnotes { display: block; }
.fnotes__back { color: var(--link); text-decoration: none; }
.hist__hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: var(--text-3); margin-left: 4px; }
.hist__tools { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin: 0 0 14px; }
.hist__cmp-acts { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; }
.hist__row[data-sel="1"] td { background: var(--teal-soft); }
.cmt__body a { color: var(--link); }
.agreements .agree { background: var(--surface-2); border-color: var(--line-strong); }
.agreements form.agree { background: var(--teal-soft); border-color: var(--teal); }
.agreements .agree textarea { width: 100%; }

@media (max-width: 900px) {
  .drawer .srch, .drawer .srch--drawer { display: flex; max-width: none; width: 100%; }
}

/* 목차 번호 · 틀 인포박스 */
.toc__n { display: inline-block; min-width: 22px; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.toc__i--h1 > a > .toc__n { font-weight: 700; }
.table-wrap--infobox {
  float: right; width: min(300px, 100%); margin: 4px 0 16px 20px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
}
.table-wrap--infobox .wiki-table { border: 0; }
.table-wrap--infobox th { background: var(--teal-soft); }
@media (max-width: 900px) {
  .table-wrap--infobox { float: none; width: 100%; margin: 0 0 16px; }
}

/* 목차·문단 번호 */
.ws__num { color: var(--text-3); font-weight: 700; margin-right: 6px; font-variant-numeric: tabular-nums; }
.ws--h1 > .ws__h > .ws__num, .ws--h2 > .ws__h > .ws__num { font-size: .82em; }

/* ==================================================================
   상단 크롬 v3 (2026-11-15 전면 재설계)
   — 모든 상단 컨트롤·액션바는 아래 토큰만 쓴다.
     높이 36px · 모서리 8px · 테두리 1px · 아이콘 18×18 stroke 1.8
   ================================================================== */
:root {
  --ctl-h: 36px;
  --ctl-r: 8px;
  --ctl-bw: 1px;
  --ctl-gap: 8px;
  --ico-sz: 18px;
  --nav-h: 56px;
}

/* 공통 아이콘 */
.ico {
  width: var(--ico-sz); height: var(--ico-sz); flex: 0 0 var(--ico-sz);
  display: block; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}

/* 공통 버튼 */
.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl-h); padding: 0 12px;
  border: var(--ctl-bw) solid var(--line-strong); border-radius: var(--ctl-r);
  background: var(--surface); color: var(--text-2);
  font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer; flex: 0 0 auto;
}
.ctl:hover { background: var(--surface-2); color: var(--teal-ink); border-color: var(--teal); text-decoration: none; }
.ctl--icon { width: var(--ctl-h); padding: 0; }

/* ------------------------------------------------------------ 헤더 */
/* 위키 관례상 스크롤 시에도 상단에 붙지만, 본문을 가리지 않도록 흐름 안에 둔다 */
.hdr {
  position: relative; top: auto; z-index: 20;
  height: auto; min-height: var(--nav-h);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.hdr__in {
  display: flex; align-items: center; flex-wrap: nowrap;
  gap: var(--ctl-gap); height: var(--nav-h);
  max-width: var(--max); margin: 0 auto; padding: 0 20px;
}
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand__img { height: 28px; width: auto; display: block; }

/* 상단 메뉴 */
.nav { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.nav__a {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--ctl-h); padding: 0 11px;
  border-radius: var(--ctl-r); color: var(--text-2);
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
}
.nav__a:hover { background: var(--surface-2); color: var(--teal-ink); text-decoration: none; }
.nav__a--on { background: var(--teal-soft); color: var(--teal-ink); font-weight: 700; }
.nav__a--ico .ico { width: 16px; height: 16px; flex: 0 0 16px; }
.nav__menu { position: relative; display: flex; }
.nav__sum { cursor: pointer; list-style: none; }
.nav__chev { width: 14px; height: 14px; flex: 0 0 14px; opacity: .75; }
.nav__menu[open] > .nav__sum { background: var(--surface-2); color: var(--teal-ink); }
.nav__pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 380px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px;
  padding: 8px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
}
.nav__pop a {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  border-radius: 6px; color: var(--text); font-size: 14px;
}
.nav__pop a::before {
  content: ""; width: 5px; height: 5px; border-radius: 2px;
  background: var(--teal); opacity: .5; flex: 0 0 5px;
}
.nav__pop a:hover { background: var(--teal-soft); color: var(--teal-ink); text-decoration: none; }

/* 검색 — 컨테이너 하나가 테두리를 갖고, 입력창·버튼이 그 안에 정렬된다 */
.srch {
  position: relative; display: flex; align-items: center; gap: 2px;
  flex: 1 1 auto; min-width: 140px; max-width: 380px; margin-left: auto;
  height: var(--ctl-h); padding: 0 4px 0 0;
  border: var(--ctl-bw) solid var(--line-strong); border-radius: var(--ctl-r);
  background: var(--surface);
}
.srch:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.srch__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.srch__in {
  flex: 1 1 auto; min-width: 0; height: 100%; margin: 0;
  padding: 0 6px 0 12px; border: 0; background: transparent;
  color: var(--text); font-family: inherit; font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.srch__in::-webkit-search-cancel-button, .srch__in::-webkit-search-decoration { display: none; }
.srch__in:focus { outline: none; }
.srch__in::placeholder { color: var(--text-3); }
.srch__tools { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.srch__tool {
  width: 26px; height: 26px; flex: 0 0 26px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--text-3); cursor: pointer;
}
.srch__tool:hover { background: var(--teal-soft); color: var(--teal-ink); }
.srch__tool .ico { width: 16px; height: 16px; flex: 0 0 16px; }
.srch__tool[hidden] { display: none; }
.ac {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  max-height: 340px; overflow: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: var(--shadow);
}
.ac[hidden] { display: none; }
.ac__i { display: flex; align-items: center; height: 40px; padding: 0 10px; border-radius: 6px;
         font-size: 14.5px; cursor: pointer; }
.ac__i[aria-selected="true"], .ac__i:hover { background: var(--teal-soft); }
.ac__i mark { background: transparent; color: var(--teal-deep); font-weight: 700; }
.ac__empty { padding: 10px 12px; font-size: 13px; color: var(--text-3); }
.ac__cta { display: flex; align-items: center; justify-content: space-between; gap: 8px;
           margin-top: 4px; padding: 9px 10px; border-top: 1px solid var(--line);
           font-size: 13px; color: var(--text-2); }
.ac__cta a { font-weight: 700; color: var(--teal-ink); }

/* 계정 */
.acct { position: relative; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.acct__login {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl-h); padding: 0 11px; border: 1px solid transparent; border-radius: var(--ctl-r);
  color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.acct__login .ico { display: none; }
.acct__login:hover { background: var(--surface-2); border-color: var(--line); color: var(--teal-ink); text-decoration: none; }
.acct__join {
  display: inline-flex; align-items: center; height: var(--ctl-h); padding: 0 14px;
  border: 1px solid var(--teal-fill); border-radius: var(--ctl-r);
  background: var(--teal-fill); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.acct__join:hover { background: var(--teal-fill-hover); border-color: var(--teal-fill-hover); color: #fff; text-decoration: none; }
.acct__menu { position: relative; display: flex; }
.acct__sum {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--ctl-h); padding: 0 10px 0 6px;
  border: var(--ctl-bw) solid var(--line-strong); border-radius: var(--ctl-r);
  background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer; list-style: none; white-space: nowrap;
}
.acct__sum::-webkit-details-marker { display: none; }
.acct__menu[open] > .acct__sum { border-color: var(--teal); background: var(--surface-2); }
.acct__av { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: block; flex: 0 0 24px; }
.acct__av--t {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-fill); color: #fff; font-weight: 800; font-size: 12px;
}
.acct__chev { width: 14px; height: 14px; flex: 0 0 14px; opacity: .7; }
.acct__pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 220px; display: grid; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: var(--shadow);
}
.acct__pop a, .acct__out {
  display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font-family: inherit; font-size: 13.5px;
  text-align: left; cursor: pointer;
}
.acct__pop a:hover, .acct__out:hover { background: var(--teal-soft); color: var(--teal-ink); text-decoration: none; }
.acct__form { margin: 0; }

/* 테마 */
.theme { width: auto; padding: 0 10px; gap: 6px; }
.theme__ico { display: inline-flex; align-items: center; justify-content: center; }
.theme__i--sun { display: none; }
html[data-theme="dark"] .theme__i--sun { display: block; }
html[data-theme="dark"] .theme__i--moon { display: none; }
.theme__txt { font-size: 13px; font-weight: 600; color: var(--text-2); }

/* 데스크톱에서는 모바일 전용 아이콘 버튼을 감춘다 */
.hdr-icon, .drawer-btn { display: none; }

/* ------------------------------------------------- 문서 머리말·액션바 */
.doc { padding: 24px 28px 22px; }
.doc__head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.doc__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.doc__titlerow { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1 1 auto; }
.doc__title {
  font-size: 30px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.02em; word-break: keep-all; line-height: 1.25;
}
.doc__badge {
  font-size: 12px; font-weight: 700; color: var(--teal-ink);
  background: var(--teal-soft); padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}
.doc__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0;
  margin: 12px 0 0; font-size: 13px; color: var(--text-3);
}
.doc__meta a { color: var(--text-2); }
.doc__meta-i { width: 13px; height: 13px; flex: 0 0 13px; display: inline-block; vertical-align: -2px; }
.docbar { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; margin: 0; }
.viewchip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
.viewchip .ico { opacity: .8; }
.seg {
  display: inline-flex; align-items: stretch; height: var(--ctl-h);
  border: var(--ctl-bw) solid var(--line-strong); border-radius: var(--ctl-r);
  background: var(--surface); flex: 0 1 auto; min-width: 0;
}
.seg__form { display: contents; }
.seg__b {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 100%; padding: 0 12px;
  border: 0; border-left: 1px solid var(--line); background: transparent;
  color: var(--text-2); font-family: inherit; font-size: 13px; font-weight: 600;
  white-space: nowrap; text-decoration: none; cursor: pointer;
}
.seg__b:first-child { border-left: 0; border-radius: calc(var(--ctl-r) - 1px) 0 0 calc(var(--ctl-r) - 1px); }
.seg__b:last-child { border-radius: 0 calc(var(--ctl-r) - 1px) calc(var(--ctl-r) - 1px) 0; }
.seg__b:hover { background: var(--surface-2); color: var(--teal-ink); text-decoration: none; }
.seg__b--primary { color: var(--teal-ink); font-weight: 700; }
.seg__b--fill { background: var(--teal-fill); color: #fff; }
.seg__b--fill:hover { background: var(--teal-fill-hover); color: #fff; }
.seg__b--star { min-width: 54px; font-variant-numeric: tabular-nums; }
.seg__b--star .star__ico { width: 15px; height: 15px; flex: 0 0 15px; }
.seg__b--star .star__n { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.star--on { background: var(--teal-soft); color: var(--teal-ink); }
.star--on .star__ico { fill: currentColor; }
.star--on .star__n { color: var(--teal-ink); }
.seg__ico { width: 15px; height: 15px; flex: 0 0 15px; }
.seg__more { width: 16px; height: 16px; flex: 0 0 16px; }
.seg__chev { width: 13px; height: 13px; flex: 0 0 13px; }
.seg__menu { position: relative; display: flex; }
.seg__menu > summary { list-style: none; }
.seg__menu > summary::-webkit-details-marker { display: none; }
.seg__menu[open] > .seg__b--menu { background: var(--surface-2); color: var(--teal-ink); }
.seg__pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 186px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: var(--shadow);
}
.seg__pop a, .seg__pop button {
  display: flex; align-items: center; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--text); font-family: inherit; font-size: 13.5px;
  text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.seg__pop a:hover, .seg__pop button:hover { background: var(--teal-soft); color: var(--teal-ink); text-decoration: none; }
.seg__pop form { margin: 0; }

/* 분류 줄 — 라벨·구분선 간격 */
.cats { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; font-size: 14px; }
.cats__l { font-weight: 700; color: var(--text-3); font-size: 13px; }
.cat-line { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0; }
.cat-line__a { color: var(--link); font-size: 14px; }
.cat-line__sep { color: var(--line-strong); margin: 0 10px; }
.cat-line__more {
  margin-left: 10px; height: 24px; padding: 0 9px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.cats--bottom { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }

/* 목차 — 번호 뒤 ". " 간격 */
.toc { width: 288px; max-width: 100%; padding: 12px 14px; border-radius: var(--ctl-r); }
.toc__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.toc__title { font-size: 14px; font-weight: 700; color: var(--text); }
.toc__toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--text-2); cursor: pointer;
}
.toc__list { margin: 0; padding: 0; list-style: none; }
.toc__i { font-size: 14px; line-height: 1.5; }
.toc__i a { display: inline-flex; align-items: baseline; gap: 2px; padding: 2px 0; color: var(--text-2); }
.toc__i a:hover { color: var(--link); }
.toc__n {
  display: inline-block; min-width: 26px; margin-right: 4px;
  color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums;
  text-align: right;
}

/* 본문 제목 번호 */
.ws__num {
  color: var(--text-3); font-weight: 700; margin-right: 0;
  font-variant-numeric: tabular-nums;
}
.wiki .ws__h { gap: 0; }
.wiki .ws__h .ws__num { margin-right: 2px; }
.wiki .ws__h .ws__num + * { margin-left: 0; }

/* 플로팅 퀵버튼 — 화면 우측 하단 고정 */
.float {
  position: fixed; left: auto; top: auto; right: 20px; bottom: 20px; z-index: 40;
  display: grid; gap: 8px; width: auto;
}
.float__b {
  width: 40px; height: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: var(--ctl-r);
  background: var(--surface); color: var(--text-2);
  box-shadow: var(--shadow); cursor: pointer;
}
.float__b:hover { border-color: var(--teal); color: var(--teal-ink); }
.float__b[hidden] { display: none; }

/* 서랍 */
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(86vw, 330px); z-index: 80;
  display: grid; align-content: start; gap: 4px; padding: 14px 14px 24px;
  background: var(--surface); border-left: 1px solid var(--line-strong);
  box-shadow: -8px 0 30px rgba(0, 0, 0, .18); overflow: auto;
}
.drawer[hidden] { display: none; }
.drawer__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.drawer__brand { font-size: 13px; font-weight: 700; color: var(--text-3); }
.drawer .srch { display: flex; max-width: none; width: 100%; margin: 0 0 6px; }
.drawer__h { font-size: 12.5px; font-weight: 700; color: var(--text-3); margin: 12px 0 2px; }
.drawer a {
  display: flex; align-items: center; min-height: 42px; padding: 0 10px;
  border-radius: var(--ctl-r); color: var(--text); font-size: 14.5px;
}
.drawer a:hover { background: var(--teal-soft); color: var(--teal-ink); text-decoration: none; }
.drawer a.drawer__cta {
  background: var(--teal-fill); color: #fff; font-weight: 700; justify-content: center;
}
.drawer a.drawer__cta:hover { background: var(--teal-fill-hover); color: #fff; }
.drawer__close { display: inline-flex; }

/* 모든 details 팝오버 공통 카드 + 기본 삼각형 제거 */
.details-clean > summary, .nav__sum, .acct__sum, .seg__menu > summary, .tool__sum { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { content: ""; }

/* ------------------------------------------------------------ 반응형 */
@media (max-width: 1180px) {
  .hdr__in { flex-wrap: nowrap; gap: 8px; }
  .nav { order: 0; }
  .srch { order: 0; flex: 1 1 auto; width: auto; max-width: 320px; }
  .acct { margin-left: 0; }
  .nav__a { padding: 0 9px; font-size: 14px; }
}
@media (max-width: 1024px) {
  .theme { width: var(--ctl-h); padding: 0; }
  .theme__txt { display: none; }
  .hdr__in { padding: 0 16px; }
  .srch { max-width: 260px; }
}
@media (max-width: 900px) {
  .hdr, .hdr__in { height: auto; }
  .hdr__in { min-height: var(--nav-h); }
  .doc { padding: 18px 16px; }
  .doc__title { font-size: 25px; }
  .seg { width: auto; overflow: visible; }
}

/* 모바일 — 로고 + 아이콘 3개(검색·테마·메뉴) 한 줄 */
@media (max-width: 820px) {
  :root { --nav-h: 52px; }
  .hdr__in { padding: 0 12px; gap: 6px; height: var(--nav-h); }
  .nav, .hdr__in .srch { display: none; }
  .hdr-icon, .drawer-btn { display: inline-flex; }
  .brand__img { height: 26px; }
  .acct { margin-left: auto; gap: 4px; }
  .acct__join { display: none; }
  .acct__login { width: var(--ctl-h); padding: 0; border-color: var(--line-strong); }
  .acct__login .ico { display: block; }
  .acct__login span { display: none; }
  .doc__top { flex-direction: column; align-items: stretch; gap: 12px; }
  .doc__titlerow { justify-content: flex-start; }
  .docbar { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .docbar::-webkit-scrollbar { display: none; }
  .seg { flex: 0 0 auto; }
  .seg__b { padding: 0 10px; font-size: 12.5px; }
  .float { right: 12px; bottom: 12px; gap: 6px; }
  .float__b { width: 36px; height: 36px; }
  .shell { padding: 14px 12px 20px; }
}
@media (max-width: 560px) {
  .seg__ico { display: none; }
  .seg__menu-t { display: none; }
  .seg__b--star { min-width: 46px; }
  .doc__title { font-size: 23px; }
  .doc__meta { font-size: 12.5px; }
}
@media (max-width: 359px) {
  .hdr__in { gap: 4px; padding: 0 8px; }
  .brand__img { height: 22px; }
}

/* ---- 목차 제목 중복 제거·문서 머리 보정 (v3.1) */
.toc__title { font-size: 14px; font-weight: 700; color: var(--text); }
.toc__title::before, .toc__title::after { content: none; display: none; }
.toc__toggle { font-size: 0; }
.toc__toggle::before { content: none; }
.toc__toggle .ico { width: 14px; height: 14px; }
.doc__rev { font-weight: 600; }
.doc__meta-i { width: 12px; height: 12px; flex: 0 0 12px; opacity: .75; vertical-align: -1px; }
.ws__num { margin-right: 1px; }
.wiki .ws__h { gap: 8px; }
.wiki .ws__h .ws__num { margin-right: 0; }
/* 문서 액션바 — 좁은 화면에서 아래 버튼 숨김 */
@media (max-width: 560px) {
  .float [data-float="bottom"] { display: none; }
  .doc__title { font-size: 22px; }
  .doc__meta { gap: 0; line-height: 1.7; }
}
.toc__toggle:hover { border-color: var(--teal); color: var(--teal-ink); }
.toc__chev { width: 14px; height: 14px; transition: transform .12s ease; }
.toc[data-collapsed="1"] .toc__chev { transform: rotate(-90deg); }
.toc__head { margin-bottom: 8px; }
.toc__i--h2 { padding-left: 0; }

/* ---- 서브페이지 도구 버튼도 같은 규격(36px·r8·1px) */
.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl-h); min-height: var(--ctl-h); padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--ctl-r);
  background: var(--surface); color: var(--text-2);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.tool:hover { border-color: var(--teal); color: var(--teal-ink); text-decoration: none; }
.tool--primary { background: var(--teal-fill); border-color: var(--teal-fill); color: #fff; }
.tool--primary:hover { background: var(--teal-fill-hover); border-color: var(--teal-fill-hover); color: #fff; }
.doc__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

/* ---- 인포박스: 컬러 헤더 + 라벨 열 */
.table-wrap--infobox { border-radius: var(--ctl-r); overflow: hidden; }
.table-wrap--infobox .wiki-table { border: 0; }
.table-wrap--infobox tr:first-child th {
  background: var(--teal-fill); color: #fff; font-size: 15px; font-weight: 700;
  text-align: left; padding: 9px 12px; letter-spacing: -.01em;
}
.table-wrap--infobox tr:first-child th strong { color: #fff; font-weight: 700; }
.table-wrap--infobox td:first-child {
  width: 34%; background: var(--surface-2); color: var(--text-2);
  font-weight: 600; white-space: nowrap;
}
.table-wrap--infobox td, .table-wrap--infobox th { border-color: var(--line); }

/* ---- 분류 문서 목록 — 제목·메타 분리 */
.catdoc__li { align-items: center; padding: 6px 0; gap: 12px; }
.catdoc__li > a {
  min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 14.5px; color: var(--link);
}
.catdoc__m {
  flex: 0 0 auto; font-size: 11.5px; color: var(--text-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 7px;
}
.catdoc__gl { margin: 12px 0 2px; }
.catdoc__list { gap: 2px; }

/* ---- 모바일 플로팅 버튼 더 컴팩트 */
@media (max-width: 820px) {
  .float__b { width: 34px; height: 34px; opacity: .94; }
}

/* ---- 문서 본문: 데스크톱에서 좌측 목차 + 우측 본문(인포박스 포함) 2단 */
.doc__body { display: block; }
@media (min-width: 1100px) {
  .doc__body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; align-items: start; }
  .doc__body > .toc { width: auto; margin: 0; position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow: auto; }
  .doc__body > .wiki { min-width: 0; }
}

/* 번호 뒤 마침표는 표시 전용(데이터는 숫자만 유지) */
.ws__num::after { content: "."; }
.toc__n::after { content: "."; }
.toc__n { min-width: 24px; margin-right: 2px; }
/* ==================================================================
   v4 — 토론·역사·비교·편집기 디테일 (2026-11-15)
   참고 화면을 직접 눌러 보고 관찰한 구조를 Rowiki 팔레트로 다시 지은 블록.
   외부 서비스의 색·로고·문구는 쓰지 않는다(금지 팔레트는 테스트가 검사한다).
   ================================================================== */

/* ---------------------------------------------------- 공통: 페이지 도구 버튼 */
.doc__actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.toolbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.toolbtn:hover { border-color: var(--teal); color: var(--teal-ink); background: var(--teal-soft); text-decoration: none; }
.toolbtn--off { color: var(--text-3); border-color: var(--line); background: transparent; cursor: default; }
.toolbtn--off:hover { border-color: var(--line); color: var(--text-3); background: transparent; }

/* ---------------------------------------------------- 토론 스레드 (댓글 말풍선) */
.thread .doc__head { padding-bottom: 14px; }
.thread__topicrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.thread__topic { font-size: 21px; line-height: 1.35; font-weight: 700; color: var(--ink); margin: 0; }
.thread__h { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.thread__cnt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-deep);
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}

.cmtlist { display: grid; gap: 10px; margin: 0 0 26px; padding: 0; list-style: none; }
.cmt {
  width: fit-content; max-width: 100%;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); overflow: visible;
}
.cmt:target { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.cmt__head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 6px 0 14px; min-height: 38px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
}
.cmt__no {
  font-size: 13px; font-weight: 800; color: var(--teal);
  font-variant-numeric: tabular-nums; text-decoration: none;
}
.cmt__no:hover { text-decoration: underline; }
.cmt__by { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.cmt__spacer { flex: 1 1 auto; min-width: 8px; }
.cmt__time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmt__tools { position: relative; }
.cmt__toolsum {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  color: var(--text-3); font-size: 15px; line-height: 1;
}
.cmt__toolsum::-webkit-details-marker { display: none; }
.cmt__toolsum:hover { background: var(--surface); color: var(--teal-deep); }
.cmt__menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  min-width: 132px; padding: 6px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow);
  display: grid; gap: 2px;
}
.cmt__menu a {
  display: block; padding: 7px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text-2); text-decoration: none; white-space: nowrap;
}
.cmt__menu a:hover { background: var(--teal-soft); color: var(--teal-ink); text-decoration: none; }
.cmt__body { padding: 12px 15px 14px; font-size: 14.5px; line-height: 1.75; color: var(--text); }
.cmt__body > :first-child { margin-top: 0; }
.cmt__body > :last-child { margin-bottom: 0; }
.cmt__body blockquote {
  margin: 8px 0; padding: 6px 12px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-2); color: var(--text-2);
}
.cmt__body .wiki-h2, .cmt__body h2, .cmt__body h3 { font-size: 15px; margin: 10px 0 4px; }

/* 댓글 작성 */
.cmtnew {
  margin-top: 6px; padding: 16px 16px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.cmtnew__h { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
.cmtnew__tools { display: flex; gap: 6px; margin-bottom: 8px; }
.cmtnew .field--area { margin: 0; }
.cmtnew .field__ta { min-height: 128px; font-size: 14.5px; line-height: 1.7; }
.cmtnew__note { margin: 8px 0 0; font-size: 12.5px; color: var(--missing); line-height: 1.5; }
.cmtnew__bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.cmtnew__count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-right: auto; }
.cmtnew__blocked { margin: 18px 0; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; }

/* 운영자 조치·서술 고정 — 라벨이 붙은 한 줄 도구 막대 */
.thread .mod, .thread .mod--freeze {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 9px 12px;
  border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2);
}
.thread .mod__l { font-size: 12px; font-weight: 800; color: var(--text-3); letter-spacing: .01em; }
.thread .mod .field__in { height: 32px; font-size: 13px; }
.thread__frozen {
  margin: 0 0 12px; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn);
  font-size: 13px; line-height: 1.55;
}

/* 합의안 절차 — 카드 무게를 줄이고 댓글 뒤로 */
.agreements { margin: 26px 0 18px; }
.agreements .doc__h2 { margin-bottom: 10px; }
.agree {
  margin: 0 0 10px; padding: 14px 16px;
  border: 1px solid var(--line); border-left: 3px solid var(--teal);
  border-radius: 10px; background: var(--surface);
}
.agree__h { margin: 0 0 8px; font-size: 13.5px; font-weight: 800; color: var(--teal-deep); }
.agree__m { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 0; font-size: 12px; color: var(--text-3); }
.agree__acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.agree textarea.field__ta { min-height: 84px; }

/* ---------------------------------------------------- 토론 목록 */
.discuss .doc__head { padding-bottom: 6px; }
.ds-section { margin: 0 0 8px; }
.ds-section .doc__h2 { display: flex; align-items: center; gap: 8px; }
.ds-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-deep); font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ds-more { margin: 4px 0 20px; font-size: 13px; }
.ds-more a { color: var(--link); font-weight: 600; }
.ds-sep { border: 0; border-top: 1px dashed var(--line-strong); margin: 22px 0 20px; }
.thr__idx { font-size: 13px; font-weight: 800; color: var(--text-3); font-variant-numeric: tabular-nums; }
.thr__a { grid-template-columns: auto auto 1fr; align-items: baseline; }
.thr__a .thr__meta { grid-column: 2 / -1; }
.thrlist { gap: 6px; }
.thr { border-radius: 10px; }
.thr__a { padding: 11px 14px; border-radius: 10px; background: var(--surface); }
.thr__topic { font-size: 14.5px; }

/* 새 주제 생성 */
.thrnew { margin-top: 4px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.thrnew__h { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.thrnew__row { display: flex; gap: 12px; flex-wrap: wrap; }
.thrnew__row .field--inline { flex: 1 1 260px; margin: 0 0 10px; }
.thrnew .field--area { margin: 0; }
.thrnew .field__ta { min-height: 150px; font-size: 14.5px; line-height: 1.7; }
.thrnew__note { margin: 8px 0 0; font-size: 12.5px; color: var(--missing); }
.thrnew__bar { display: flex; justify-content: flex-end; margin-top: 12px; }
.thrnew__bar .btn { min-width: 112px; height: 38px; }
.thrnew__blocked { padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; }

/* ---------------------------------------------------- 역사 목록 */
.hist__tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; justify-content: space-between; margin: 0 0 10px; }
.hist__jump { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.hist__field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.hist__field--wide { min-width: 206px; }
.hist__label { font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.hist__in {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit;
}
.hist__in:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.hist__compare { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.hist__arrow { padding-bottom: 9px; color: var(--text-3); font-size: 14px; }
.hist__hint { margin: 0 0 12px; font-size: 12px; color: var(--text-3); }

table.hist { border-collapse: separate; border-spacing: 0; }
table.hist thead th {
  padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--text-3);
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.hist thead th.hist__act-h { text-align: right; }
table.hist td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
table.hist tr.rev-row:hover td { background: var(--surface-2); }
table.hist tr.rev-row[data-sel="1"] td { background: var(--teal-soft); }
.hist__radios { display: inline-flex; gap: 2px; align-items: center; }
.hist__radio { width: 15px; height: 15px; margin: 0; accent-color: var(--teal); cursor: pointer; }
.hist__cmp { width: 46px; }
.hist__time { white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.hist__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 2px; font-size: 12px; }
.hist__acts .rev-btn { padding: 0; height: auto; border: 0; background: none; font-size: 12px; color: var(--link); }
.hist__acts .rev-btn:hover { background: none; text-decoration: underline; color: var(--link-hover); }
.rev-sep { color: var(--line-strong); font-size: 11px; }
.hist__rev { white-space: nowrap; }
.hist__link { font-weight: 800; color: var(--teal-deep); font-variant-numeric: tabular-nums; }
.hist__hash { font-size: 11px; color: var(--text-3); margin-left: 5px; }
.hist__by { white-space: nowrap; font-weight: 600; }
.hist__delta { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; }
.hist__delta--plus { color: var(--ok-text); }
.hist__delta--minus { color: var(--err-text); }
.hist__delta--zero { color: var(--text-3); }
.hist__sum {
  max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2);
}
.hist__act { text-align: right; white-space: nowrap; }
.hist__act .rev-row__acts { justify-content: flex-end; flex-wrap: nowrap; }
.hist__act .rev-btn { height: 26px; padding: 0 8px; font-size: 12px; }
.hist__form { margin: 0; }

.pager { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 18px 0 0; }
.pager__b {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 9px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none;
}
.pager__b:hover { border-color: var(--teal); color: var(--teal-ink); background: var(--teal-soft); text-decoration: none; }
.pager__b--on { background: var(--teal-fill); border-color: var(--teal-fill); color: #fff; font-weight: 800; }
.pager__b--on:hover { background: var(--teal-fill-hover); border-color: var(--teal-fill-hover); color: #fff; }
.hist--title td { font-size: 13px; }

/* ---------------------------------------------------- 비교(diff) */
.diffpage .doc__head { padding-bottom: 10px; }
.dfbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.dfbar__rev { font-size: 14px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.dfbar__arrow { color: var(--text-3); margin: 0 4px; }
.dfbar__chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums;
}
.dfbar__chip--del { background: var(--err-bg); border-color: transparent; color: var(--err-text); }
.dfbar__chip--ins { background: var(--ok-bg); border-color: transparent; color: var(--ok-text); }
.dfbar__by { font-size: 12.5px; color: var(--text-3); margin-left: auto; }
.df__thby { font-size: 12px; font-weight: 600; color: var(--text-3); margin-left: 8px; }
table.diff thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
table.diff td.df__n {
  width: 44px; padding: 3px 8px; text-align: right;
  font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums;
  background: var(--surface-2); border-right: 1px solid var(--line);
}
table.diff td.df__c { padding: 3px 10px; line-height: 1.65; font-size: 13.5px; vertical-align: top; }
table.diff tr.df--eq td.df__c { color: var(--text-2); }
table.diff tr.df--del td.df__c--l { background: var(--err-bg); color: var(--err-text); }
table.diff tr.df--ins td.df__c--r { background: var(--ok-bg); color: var(--ok-text); }
table.diff tr.df--rep td.df__c--l { background: var(--err-bg); color: var(--err-text); }
table.diff tr.df--rep td.df__c--r { background: var(--ok-bg); color: var(--ok-text); }
table.diff .df__w { border-radius: 3px; padding: 0 2px; }
table.diff .df__w--del { background: rgba(179, 38, 30, .22); text-decoration: line-through; text-decoration-thickness: 1px; }
table.diff .df__w--ins { background: rgba(14, 124, 102, .24); font-weight: 700; }
html[data-theme="dark"] table.diff .df__w--del { background: rgba(255, 154, 144, .24); }
html[data-theme="dark"] table.diff .df__w--ins { background: rgba(52, 211, 182, .24); }
table.diff tr:hover td.df__c { box-shadow: inset 0 0 0 999px rgba(14, 124, 102, .04); }

/* ---------------------------------------------------- 편집기 툴바·탭 */
.editor .tb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 9px 12px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 10px 10px 0 0; background: var(--surface-2);
  position: sticky; top: 0; z-index: 12;
}
.tb__grp { display: flex; align-items: center; gap: 6px; }
.tb__grp + .tb__grp { padding-left: 14px; border-left: 1px solid var(--line-strong); }
.tb__bs { display: flex; flex-wrap: wrap; gap: 3px; }
.tb__l { font-size: 11px; font-weight: 800; color: var(--text-3); letter-spacing: .02em; }
.tb__b {
  height: 30px; padding: 0 9px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  font-family: inherit; cursor: pointer;
}
.tb__b:hover { background: var(--surface); border-color: var(--line-strong); color: var(--teal-ink); }
.tb__b:active { background: var(--teal-soft); border-color: var(--teal); }
.tb__hint { margin-left: auto; font-size: 11.5px; color: var(--text-3); }

.edtabs {
  display: flex; align-items: center; gap: 2px;
  padding: 0; margin: 0; border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 10px 10px; background: var(--surface);
}
.edtabs .edtab {
  height: 38px; padding: 0 18px; border: 0; background: transparent;
  font-size: 13.5px; font-weight: 700; color: var(--text-3);
  border-bottom: 2px solid transparent; border-radius: 0; cursor: pointer; font-family: inherit;
}
.edtabs .edtab:hover { color: var(--teal-deep); background: var(--surface-2); }
.edtabs .edtab--on { color: var(--teal-deep); border-bottom-color: var(--teal); background: transparent; border-radius: 0; }
.edtabs__note { margin-left: auto; padding: 0 12px; font-size: 12px; color: var(--text-3); }

.editor .field--area { margin-top: 10px; }
.editor .field__ta {
  min-height: 440px; padding: 14px 16px;
  font-size: 14.5px; line-height: 1.75;
}
.editor .editor__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.editor .editor__bar .btn--primary { min-width: 96px; height: 38px; }
.editor .editor__count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.editor .editor__agree { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.editor .help { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.editor .help__sum { cursor: pointer; padding: 12px 14px; font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.editor .help__sum:hover { color: var(--teal-deep); }
.editor .help[open] .help__sum { border-bottom: 1px solid var(--line); }
.editor .help .table-wrap { margin: 0; }
.editor .help__more { padding: 0 14px 12px; font-size: 12.5px; color: var(--text-3); }
.editor .preview h2.preview__h { font-size: 13px; font-weight: 800; color: var(--text-3); margin: 18px 0 8px; }

/* ---------------------------------------------------- 좁은 화면 */
@media (max-width: 900px) {
  .doc__actions { width: 100%; }
  .cmt { width: 100%; }
  .hist__tools { flex-direction: column; align-items: stretch; }
  .hist__compare { width: 100%; }
  .hist__field--wide { flex: 1 1 140px; min-width: 0; }
  table.hist thead { display: none; }
  table.hist tr.rev-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: start; gap: 2px 8px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  table.hist td { border: 0; padding: 1px 0; }
  table.hist td.hist__cmp { grid-row: 1 / span 2; padding-top: 3px; }
  table.hist td.hist__time { font-size: 12px; }
  table.hist td.hist__rev, table.hist td.hist__by, table.hist td.hist__delta { display: inline-block; margin-right: 8px; }
  table.hist td.hist__sum { grid-column: 2 / -1; max-width: none; white-space: normal; }
  table.hist td.hist__act { grid-column: 2 / -1; text-align: left; margin-top: 4px; }
  table.hist td.hist__act .rev-row__acts { justify-content: flex-start; }
  table.hist td.hist__size { display: none; }
  .tb__hint { display: none; }
  .tb__grp + .tb__grp { padding-left: 0; border-left: 0; }
  .editor .tb { position: static; }
  .thrnew__row { flex-direction: column; }
  .thrnew__row .field--inline { flex: 1 1 auto; width: 100%; }
  .dfbar__by { margin-left: 0; }
  table.diff td.df__n { width: 30px; padding: 3px 4px; }
}

/* ---------------------------------------------------- v4.1 보정 */
.thr__a {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-areas: "i s t" "i m m";
  column-gap: 8px; row-gap: 3px;
}
.thr__idx { grid-area: i; align-self: baseline; }
.thr__a .thr__status { grid-area: s; justify-self: start; }
.thr__a .thr__topic { grid-area: t; }
.thr__a .thr__meta { grid-area: m; }
.thrnew p.thr--empty { display: none; }

/* 역사 표 — 바깥 테두리·세로줄 없이 행 구분선만 */
table.wiki-table.hist { border: 0; background: transparent; }
table.wiki-table.hist thead th { border-bottom: 1px solid var(--line-strong); }
table.wiki-table.hist tbody td { border-left: 0; border-right: 0; }
table.wiki-table.hist tbody tr:last-child td { border-bottom: 0; }

/* 운영자 도구 — 한 줄에 컴팩트하게 */
.thread .mod .btn { flex: 0 0 auto; }
.thread .mod .field__in { flex: 0 1 220px; min-width: 140px; }
.thread .mod form { display: contents; }

/* 합의안 카드 — 무게 줄이기 */
.agree { background: var(--surface-2); border-left-width: 3px; }
.agree textarea.field__ta { min-height: 76px; background: var(--surface); }

.edtabs__hint { margin-left: auto; padding: 0 4px; font-size: 11.5px; color: var(--text-3); }
.edtabs .edtabs__note { margin-left: 0; padding: 0 12px 0 0; }

@media (max-width: 900px) {
  table.hist tr.rev-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas: "c t r" "c a d" "c s s" "c b b";
    row-gap: 4px;
  }
  table.hist td.hist__cmp { grid-area: c; grid-row: auto; }
  table.hist td.hist__time { grid-area: t; }
  table.hist td.hist__rev { grid-area: r; justify-self: end; }
  table.hist td.hist__by { grid-area: a; }
  table.hist td.hist__delta { grid-area: d; justify-self: end; margin-right: 0; }
  table.hist td.hist__sum { grid-area: s; }
  table.hist td.hist__act { grid-area: b; }
  .hist__acts { row-gap: 2px; }
  .edtabs__hint { display: none; }
}

/* ---------------------------------------------------- v4.2 보정 */
.edtabs__hint { margin-left: auto; margin-right: 10px; }
.edtabs .edtabs__note:empty { display: none; }
.editor .tb { gap: 6px 12px; }
@media (max-width: 1100px) {
  .tb__hint { display: none; }
}

/* ------------------------------------------------ 회원가입 이메일 인증 (v4.3) */
.evmail { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2); }
.evmail--ok { border-color: var(--teal); background: var(--teal-soft); }
.evmail__row { display: flex; gap: 8px; align-items: stretch; }
.evmail__row .field__in { flex: 1 1 auto; min-width: 0; }
.evmail__btn { flex: 0 0 auto; white-space: nowrap; height: 40px; min-height: 40px; }
.evmail__btn[disabled] { opacity: .65; cursor: not-allowed; }
.evmail__state { margin: 0; font-size: 13px; min-height: 18px; color: var(--text-2); }
.evmail__state:empty { display: none; }
.evmail__state--ok { color: var(--ok-text); font-weight: 600; }
.evmail__state--err { color: var(--err-text); font-weight: 600; }
.evmail__state--busy { color: var(--text-2); }
.evmail__code { display: grid; gap: 6px; margin-top: 4px; }
.evmail__code .field__in { letter-spacing: .18em; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .evmail { padding: 12px; }
  .evmail__row { flex-wrap: wrap; }
  .evmail__row .field__in { flex: 1 1 100%; }
  .evmail__btn { flex: 1 1 100%; height: 38px; min-height: 38px; }
}
