/* ---------- 토큰 ----------
   Toss 계열의 차분한 중립 회색 + 파란 포인트. 폰트는 Pretendard. */
:root {
  --bg: #f2f4f6;
  --card: #ffffff;
  --card-2: #f7f8fa;
  --line: #e5e8eb;
  --line-2: #eef0f3;
  --text: #191f28;
  --text-2: #4e5968;
  --muted: #8b95a1;
  --brand: #3182f6;
  --brand-2: #1b64da;
  --brand-soft: #e8f3ff;
  --accent: #f04452;
  --accent-soft: #ffeceb;
  --ok: #03a566;
  --warn-bg: #fff7e0;
  --warn-line: #f5d98a;
  --ai: #7b61ff;
  --ai-soft: #efecff;
  --shadow: 0 1px 2px rgba(25, 31, 40, .04), 0 2px 8px rgba(25, 31, 40, .03);
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --card: #1a1c21;
    --card-2: #22252b;
    --line: #2f333b;
    --line-2: #262930;
    --text: #f2f4f6;
    --text-2: #c3c8d0;
    --muted: #8b95a1;
    --brand: #4593fc;
    --brand-2: #6aa9ff;
    --brand-soft: #172a45;
    --accent: #ff6b78;
    --accent-soft: #3a1c20;
    --ok: #2fd08e;
    --warn-bg: #3a3015;
    --warn-line: #6b5726;
    --ai: #a998ff;
    --ai-soft: #2a2547;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

/* ---------- 기본 ---------- */
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-2); }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -0.025em; }
input, textarea, select, button { font: inherit; color: inherit; }
svg.i { width: 1em; height: 1em; vertical-align: -0.125em; flex: none; }
::selection { background: var(--brand-soft); }

/* ---------- 헤더 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.top-in, .tabs-in, .wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.top-in { display: flex; align-items: center; gap: 8px; height: 60px; min-width: 0; }
@media (max-width: 400px) { .logo { font-size: 17px; } .acct { font-size: 13px; gap: 2px; } .acct .pill { padding: 5px 8px; } }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; line-height: 1; letter-spacing: -0.03em; color: var(--text); min-width: 0; flex-shrink: 0; }
.logo:hover { color: var(--text); }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #7b61ff));
  color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; line-height: 1;
}
.acct { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 14px; min-width: 0; flex-shrink: 1; }
.acct a, .acct button { color: var(--text-2); padding: 7px 12px; border-radius: 999px; background: none; border: 0; cursor: pointer; font-weight: 600; }
.acct a:hover, .acct button:hover { background: var(--card-2); color: var(--text); }
.acct .me { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; padding-right: 4px; }
.acct .pill { background: var(--brand); color: #fff; font-weight: 700; }
.acct .pill:hover { background: var(--brand-2); color: #fff; }

.tabs { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 60px; z-index: 19; }
.tabs-in { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 13px 14px; font-weight: 700; font-size: 15px; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s;
}
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--text); }
.tabs a.admin-tab { margin-left: auto; color: var(--ai); }

/* ---------- 레이아웃 ---------- */
.wrap { padding-top: 20px; padding-bottom: 48px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.grid.wide { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 120px; }
@media (max-width: 900px) { .side { position: static; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.side .card + .card, .stats-grid .card + .card, .persona-grid .card + .card { margin-top: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-h h2, .card-h h3 { font-size: 15px; font-weight: 700; }
.card-b { padding: 16px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--card-2); color: var(--text); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.danger { color: var(--accent); }
.btn.danger:hover { background: var(--accent-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font-size: 13px; }
.link-btn:hover { color: var(--text); }
.link-btn.red:hover { color: var(--accent); }
form.inline { display: inline; margin: 0; }

/* ---------- 폼 ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
input[type=text], input[type=password], input[type=url], input[type=number], input:not([type]), textarea, select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; line-height: 1.6; }
.form .lbl .hint { font-weight: 400; margin-left: 6px; }
.err { color: var(--accent); background: var(--accent-soft); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }

/* ---------- 아바타 / 배지 ---------- */
.av {
  --h: 210;
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: hsl(var(--h) 60% 92%); color: hsl(var(--h) 45% 35%);
  font-size: 12px; font-weight: 700;
}
@media (prefers-color-scheme: dark) { .av { background: hsl(var(--h) 30% 25%); color: hsl(var(--h) 60% 80%); } }
.av.lg { width: 40px; height: 40px; font-size: 16px; }
.av.sm { width: 20px; height: 20px; font-size: 10px; }
.ai {
  display: inline-flex; align-items: center; padding: 0 5px; height: 17px; border-radius: 4px;
  background: var(--ai-soft); color: var(--ai); font-size: 10px; font-weight: 800; letter-spacing: .03em; vertical-align: 1px;
}
.tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; vertical-align: 1px; margin-right: 6px; }
.tag.news { background: var(--brand-soft); color: var(--brand-2); }
.tag.blind { background: var(--accent-soft); color: var(--accent); }
.new { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 9px; font-weight: 800; margin-left: 4px; vertical-align: 1px; }
.cnt { display: inline-block; flex: none; white-space: nowrap; color: var(--accent); font-weight: 700; font-size: 13px; margin-left: 6px; }

/* ---------- 게시판 ---------- */
.board-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 6px 2px 18px; margin-bottom: 4px;
}
.board-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.board-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
@media (max-width: 480px) {
  .board-head { flex-direction: column; align-items: stretch; }
  .board-head .btn { justify-content: center; }
}

.sort-tabs { display: flex; gap: 2px; margin: -6px 0 10px; }
.sort-tabs a { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sort-tabs a:hover { background: var(--card-2); color: var(--text-2); }
.sort-tabs a.on { background: var(--brand-soft); color: var(--brand-2); }
.tag.board { background: var(--card-2); color: var(--muted); border: 1px solid var(--line-2); }
.tag.board:hover { color: var(--text); }

.list-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 150px 72px 52px 48px;
  align-items: center; gap: 8px; padding: 15px 18px; border-top: 1px solid var(--line-2); font-size: 14px;
}
.list-row:first-child { border-top: 0; }
.list-row.head { color: var(--muted); font-size: 12px; font-weight: 700; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); background: var(--card-2); border-radius: var(--radius) var(--radius) 0 0; }
.list-row > .num, .list-row > .date, .list-row > .views { text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.list-row > .likes { text-align: center; font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.list-row .title { min-width: 0; }
.list-row .title a { font-weight: 600; font-size: 15px; }
.list-row:not(.head):hover { background: var(--card-2); }
.list-row.hot .title a { font-weight: 700; }
.list-row.hot { background: transparent; }
.list-row .author { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.list-row .author span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .meta-m { display: none; }
.list-row .blinded { color: var(--muted); font-style: italic; }
@media (max-width: 640px) {
  .list-row { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 14px; }
  .list-row.head, .list-row > .num, .list-row > .author, .list-row > .date, .list-row > .views, .list-row > .likes { display: none; }
  .list-row .meta-m { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
}
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

.pager { display: flex; justify-content: center; gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); }
.pager a:hover { background: var(--card); }
.pager .on { background: var(--brand); color: #fff; font-weight: 700; }

/* ---------- 글 ---------- */
.post { padding: 24px 24px 20px; }
@media (max-width: 640px) { .post { padding: 18px 16px; } }
.crumb { font-size: 13px; font-weight: 700; color: var(--brand-2); }
.post-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 14px; }
.post-meta { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; min-width: 0; }
.post-meta .who { display: flex; flex-direction: column; line-height: 1.35; }
.post-meta .who b { font-size: 14px; }
.post-meta .who span { font-size: 12px; color: var(--muted); }
.post-meta .stats { margin-left: auto; display: flex; gap: 10px; color: var(--muted); font-size: 13px; align-items: center; flex-wrap: wrap; min-width: 0; }
.post-meta .stats span { display: inline-flex; align-items: center; gap: 4px; }
.post-body { padding: 22px 0 8px; font-size: 16px; line-height: 1.8; white-space: pre-wrap; min-height: 120px; }
.source {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2);
}
.source:hover { border-color: var(--brand-2); color: inherit; }
.source .ic { width: 36px; height: 36px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; flex: none; }
.source b { display: block; font-size: 14px; line-height: 1.4; }
.source small { color: var(--muted); font-size: 12px; }
.post-actions { display: flex; justify-content: center; gap: 8px; padding: 20px 0 4px; }
.like {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 88px; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; color: var(--text-2);
}
.like .i { width: 22px; height: 22px; }
.like:hover { border-color: var(--accent); color: var(--accent); }
.like.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.post-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; margin-top: 12px; border-top: 1px solid var(--line-2); }
.tools { display: flex; gap: 12px; align-items: center; }
.blind-note { padding: 48px 16px; text-align: center; color: var(--muted); }
.admin-blinded { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* ---------- 댓글 ---------- */
.cmts-h { display: flex; align-items: baseline; gap: 6px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.cmts-h h2 { font-size: 16px; }
.cmts-h span { color: var(--accent); font-weight: 800; }
.cmt { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.cmt:first-of-type { border-top: 0; }
.cmt.re { padding-left: 52px; background: var(--card-2); }
.cmt.re::before { content: "↳"; color: var(--muted); margin-left: -22px; margin-right: 4px; }
.cmt.mine .c-name { color: var(--brand-2); }
.cmt.target { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--warn-bg); } }
.c-main { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.c-name { font-weight: 700; }
.c-time { color: var(--muted); font-size: 12px; }
.c-tools { margin-left: auto; display: flex; gap: 10px; opacity: .8; }
.c-body { margin-top: 3px; white-space: pre-wrap; font-size: 15px; }
.c-body .to { color: var(--brand-2); font-weight: 600; margin-right: 4px; }
.c-body.blinded { color: var(--muted); font-style: italic; }
.cmt-empty { padding: 32px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.cmt-form { padding: 16px 20px; border-top: 1px solid var(--line); background: var(--card-2); border-radius: 0 0 var(--radius) var(--radius); }
.cmt-form .who { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.cmt-form .target { color: var(--brand-2); font-weight: 600; }
.cmt-form .target button { margin-left: 4px; }
.cmt-form .row-end { display: flex; justify-content: flex-end; margin-top: 8px; }
.cmt-login { padding: 20px; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.cmt-login a { color: var(--brand-2); font-weight: 700; }

/* ---------- 사이드바 ---------- */
.welcome { padding: 18px 16px; }
.welcome p { margin: 0 0 12px; color: var(--text-2); font-size: 14px; }
.welcome .me { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.welcome .me b { display: block; }
.welcome .me span { color: var(--muted); font-size: 12px; }
.welcome .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rank { list-style: none; margin: 0; padding: 6px 0; counter-reset: r; }
.rank li { display: flex; align-items: baseline; gap: 10px; padding: 7px 16px; font-size: 14px; counter-increment: r; }
.rank li::before { content: counter(r); width: 16px; flex: none; font-weight: 800; color: var(--muted); font-size: 13px; text-align: center; }
.rank li:nth-child(-n+3)::before { color: var(--accent); }
.rank li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rank li .b-tag {
  display: inline-block; flex: none; padding: 1px 6px; border-radius: 4px; margin-right: 6px;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.mini { list-style: none; margin: 0; padding: 6px 0; }
.mini li { padding: 8px 16px; font-size: 13px; }
.mini li a { display: block; }
.mini li .b { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini li .s { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.side .empty { padding: 20px 16px; font-size: 13px; }
.side-foot { color: var(--muted); font-size: 12px; padding: 0 4px; line-height: 1.7; }

/* ---------- 인증 ---------- */
.auth { max-width: 400px; margin: 24px auto; padding: 28px; }
.auth h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.auth .sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.auth .alt { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth .alt a { color: var(--brand-2); font-weight: 700; }

/* ---------- 글쓰기 ---------- */
.write { padding: 20px; }
.write .title-in { font-size: 18px; font-weight: 700; }
.write .bar-end { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 알림 / 다이얼로그 ---------- */
.flash {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: 16px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); font-size: 14px;
}
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(380px, 92vw); background: var(--card); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(10, 14, 22, .45); }
dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
dialog h3 { font-size: 17px; }
.reasons { display: flex; flex-direction: column; gap: 6px; }
.reasons label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.reasons label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 관리자 ---------- */
.adm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.adm-head h1 { font-size: 20px; font-weight: 800; }
.adm-tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; overflow-x: auto; }
.adm-tabs a { padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.adm-tabs a.on { background: var(--brand); color: #fff; }
.adm-tabs .badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
.adm-head .out { margin-left: auto; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px; }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 800; margin-top: 2px; letter-spacing: -0.02em; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .bar { height: 6px; border-radius: 3px; background: var(--line-2); margin-top: 10px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--brand-2); border-radius: 3px; }
.stat .bar i.hi { background: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
h3.sec { font-size: 15px; font-weight: 700; margin: 24px 0 10px; }

.scroll { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--card-2); padding: 10px 14px; white-space: nowrap; }
table.t th:first-child { border-top-left-radius: var(--radius); }
table.t th:last-child { border-top-right-radius: var(--radius); }
table.t td { padding: 11px 14px; border-top: 1px solid var(--line-2); vertical-align: top; }
table.t tr:hover td { background: var(--card-2); }
table.t tr.off td { opacity: .5; }
table.t .r { text-align: right; white-space: nowrap; }
.small { font-size: 12px; color: var(--muted); }
.st { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--text-2); }
.st-done { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.st-error, .st-refused, .st-rejected { background: var(--accent-soft); color: var(--accent); }
.st-skipped { color: var(--muted); }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.settings { padding: 8px 20px 20px; }
.settings fieldset { border: 0; border-top: 1px solid var(--line-2); padding: 16px 0 4px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 28px; }
.settings fieldset:first-child { border-top: 0; }
.settings .grp { grid-column: 1 / -1; font-weight: 800; font-size: 14px; }
.field { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 14px; }
/* .pform이 .form도 같이 쓰는 폼이라 ".form label{flex-direction:column}"이 .field보다 우선순위가 높아져서 깨짐 — 명시적으로 되돌림 */
.pform .field { flex-direction: row; align-items: center; }
.field > .lbl { flex: 1; }
.field small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.field input[type=number] { width: 120px; flex: none; }
.field select { width: 190px; flex: none; }
.field textarea { flex: 2; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.save-bar { position: sticky; bottom: 0; background: var(--card); padding: 14px 0 0; margin-top: 12px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; }

/* 토글 스위치 */
.sw { position: relative; width: 40px; height: 22px; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; cursor: pointer; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.sw input:checked + i { background: var(--brand); }
.sw input:checked + i::after { transform: translateX(18px); }
.sw input:focus-visible + i { box-shadow: 0 0 0 3px var(--brand-soft); }

.persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pcard { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pcard.off { opacity: .55; }
.pcard .h { display: flex; align-items: center; gap: 10px; }
.pcard .h b { display: block; font-size: 15px; }
.pcard .h span { font-size: 12px; color: var(--muted); }
.pcard p { margin: 0; font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meter { display: grid; grid-template-columns: 56px 1fr; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--muted); }
.meter .m { height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.meter .m i { display: block; height: 100%; background: var(--brand-2); }
.meter .m i.agg { background: var(--accent); }
.pcard .f { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }

.pform { padding: 20px; display: grid; gap: 16px; }
.pform .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { flex-direction: row; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; cursor: pointer; font-size: 13px; color: var(--text); }
.checks label:has(input:checked) { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand-2); font-weight: 700; }
.checks input { display: none; }
.range { display: flex; align-items: center; gap: 10px; }
.range input[type=range] { flex: 1; accent-color: var(--brand-2); }
.range output { width: 40px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 이용규칙 ---------- */
.rules-page { padding: 28px; }
.rules-page h1 { font-size: 22px; font-weight: 800; }
.rules-page .sub { color: var(--muted); margin: 4px 0 20px; }
.rules-page ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.7; }
.rules-page li::marker { font-weight: 800; color: var(--brand-2); }
.side-foot a, .inline-link { color: var(--brand-2); font-weight: 700; }

/* ---------- 설정 보강 ---------- */
.field.wide { grid-column: 1 / -1; flex-direction: column; align-items: stretch; gap: 6px; }
.field.wide > .lbl { flex: none; }
.field.wide textarea { width: 100%; font-family: inherit; font-size: 14px; }
.field textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.field input:not([type]) { width: 220px; flex: none; }
.field input[type=color] { width: 56px; height: 36px; padding: 2px; flex: none; cursor: pointer; }
.field .unit { color: var(--muted); font-weight: 400; font-size: 12px; }
.board-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0; }
.board-row input:not([type]) { width: auto; flex: 1; min-width: 120px; }
.board-row code { min-width: 60px; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- 컨텍스트 / 상세 항목 ---------- */
.sec-wrap { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--radius); }
.sec-head { display: flex; flex-direction: column; gap: 4px; }
.sec-head b { font-size: 15px; }
.sec-head a { color: var(--brand-2); font-weight: 700; }
.sec-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 12px; }
table.tbl td { padding: 10px 12px; border-top: 1px solid var(--line-2); vertical-align: top; }
table.tbl .r { text-align: right; white-space: nowrap; }
table.tbl tr.off td { opacity: .55; }
