:root {
  --red: #d7141a;
  --red-deep: #a80d13;
  --red-soft: #fde8e8;
  --ink: #15171b;
  --ink-2: #3a3e46;
  --muted: #6c717a;
  --line: #e5e1dc;
  --bg: #f4f2ef;
  --card: #ffffff;
  --up: #e5252b;
  --down: #2563eb;
  --tk-bg: #0d0e11;
  --tk-up: #ff5a5f;
  --tk-down: #5b9bff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.05), 0 4px 16px rgba(20, 20, 30, 0.05);
  /* 본문: 기기에 설치된 한글 글꼴 (외부에서 내려받지 않음) */
  --font: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Noto Sans CJK KR', 'Malgun Gothic', system-ui, sans-serif;
  /* 제목: 이 서버에서 제공하는 Black Han Sans */
  --display: 'Black Han Sans', var(--font);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------------- 티커 (왼쪽 → 오른쪽으로 흐름) ---------------- */
.ticker {
  background: var(--tk-bg);
  color: #e9eaee;
  height: 38px;
  overflow: hidden;
  position: relative;
  font-size: 13.5px;
  border-bottom: 1px solid #000;
}
.ticker::before, .ticker::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 48px; z-index: 2; pointer-events: none;
}
.ticker::before { left: 0; background: linear-gradient(90deg, var(--tk-bg), transparent); }
.ticker::after { right: 0; background: linear-gradient(-90deg, var(--tk-bg), transparent); }
.ticker-track {
  display: flex;
  width: max-content;
  height: 100%;
  align-items: center;
  animation: ticker-ltr var(--tk-dur, 80s) linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-ltr {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}
.tk-group { display: flex; align-items: center; }
.tk-item { display: inline-flex; align-items: baseline; gap: 7px; padding: 0 22px; white-space: nowrap; position: relative; }
.tk-item + .tk-item::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 1px; height: 12px; margin-top: -6px; background: #2c2f36;
}
.tk-name { color: #a8adb7; font-weight: 500; }
.tk-price { font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.tk-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
.tk-chg.up { color: var(--tk-up); }
.tk-chg.down { color: var(--tk-down); }
.tk-chg.flat { color: #8b909a; }
.tk-item.stale .tk-price { color: #8b909a; }
.tk-empty { padding: 0 20px; color: #8b909a; line-height: 38px; }
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker-track { animation: none; }
}

/* ---------------- 헤더 ---------------- */
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--red);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; flex-shrink: 0; font-family: var(--display); font-size: 28px; letter-spacing: 0.5px; line-height: 1; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--red); color: #fff;
  display: grid; place-items: center; font-size: 20px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.logo .r { color: var(--red); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 8px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { background: var(--bg); }
.nav a.active { color: var(--red); }
.auth { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; min-width: 0; }
.auth > .btn { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); border-radius: 9px;
  padding: 8px 14px; font-weight: 600; font-size: 14px; line-height: 1.2; white-space: nowrap;
}
.btn:hover { border-color: #cfc9c2; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12.5px; }
.link-btn:hover { color: var(--red); text-decoration: underline; }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.menu button, .menu a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 7px; font-size: 14px; }
.menu button:hover, .menu a:hover { background: var(--bg); }
.menu .danger { color: var(--red); }

/* ---------------- 제재 안내 띠 ---------------- */
.sanction-bar { background: #fff4e5; color: #7a4b07; border-bottom: 1px solid #f6dcae; font-size: 14px; }
.sanction-bar .wrap { padding-top: 10px; padding-bottom: 10px; }
.sanction-bar b { color: #b45309; }

/* ---------------- 홈: 흐르는 뉴스 띠 (왼쪽 → 오른쪽) ---------------- */
.news-band { position: relative; overflow: hidden; color: #fff; padding: 22px 0 24px; }
.news-band.red { background: linear-gradient(135deg, #8f0a10 0%, var(--red) 55%, #e8343a 100%); }
.news-band.dark { background: linear-gradient(135deg, #0f1013 0%, #1d1f25 100%); border-top: 3px solid var(--red); }
.news-band.red::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(800px 260px at 85% -40%, rgba(255,255,255,.18), transparent 70%);
}
.band-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; position: relative; z-index: 1; }
.band-head h2 { margin: 6px 0 0; font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: .5px; line-height: 1.1; }
.band-head h2 .r { color: #ff4248; }
.band-head p { margin: 6px 0 0; color: rgba(255,255,255,.78); font-size: 13.5px; }
.band-link { flex-shrink: 0; color: #fff; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 99px; background: rgba(255,255,255,.14); }
.band-link:hover { background: rgba(255,255,255,.24); }
.chip-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; background: rgba(0,0,0,.25); padding: 4px 10px; border-radius: 99px; }
.chip-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
.news-band.dark .chip-live { background: var(--red); }
@keyframes pulse { 50% { opacity: .25; } }

.marquee {
  position: relative; z-index: 1; overflow: hidden; padding: 6px 0 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee-ltr var(--mq-dur, 90s) linear infinite; will-change: transform; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track, .marquee.paused .marquee-track { animation-play-state: paused; }
@keyframes marquee-ltr { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.mq-group { display: flex; gap: 16px; padding-right: 16px; }

/* 흐르는 카드: 대표 사진 + 사진 아래 제목 */
.nm-card {
  flex: 0 0 280px; width: 280px; background: var(--card); color: var(--ink);
  border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25); transition: transform .18s ease, box-shadow .18s ease;
}
.nm-card:hover, .nm-card:focus-visible { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 0, 0, .34); }
.nm-card.pinned { outline: 3px solid #ffd54a; outline-offset: -3px; }
.nm-photo { position: relative; aspect-ratio: 16 / 9; background: #1d1f25; }
.nm-photo .thumb { position: absolute; inset: 0; border-radius: 0; }
.nm-photo::after { /* 사진 위 글자가 잘 보이게 아래쪽만 어둡게 */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
}
.nm-src {
  position: absolute; left: 10px; bottom: 8px; right: 10px; z-index: 1;
  color: #fff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nm-pin { position: absolute; left: 10px; top: 10px; z-index: 1; background: #ffd54a; color: #1d1f25; font-size: 11.5px; font-weight: 800; border-radius: 6px; padding: 2px 8px; }
.nm-title {
  /* 여백은 margin 으로 (padding 이면 잘린 셋째 줄이 아래 여백에 비쳐 보임) */
  margin: 11px 14px 13px; height: calc(1.42em * 2);
  font-weight: 800; font-size: 15px; line-height: 1.42; letter-spacing: -0.2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nm-card:hover .nm-title { color: var(--red); }
.marquee-empty { position: relative; z-index: 1; border: 1px dashed rgba(255,255,255,.4); border-radius: 12px; padding: 30px 16px; text-align: center; color: rgba(255,255,255,.85); font-size: 14px; }
.band-note { position: relative; z-index: 1; margin: 0; font-size: 12px; color: rgba(255,255,255,.6); }
@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; }
  .marquee-track { animation: none; }
}

/* 기사 대표 사진 (없거나 깨지면 언론사 이름이 적힌 카드) */
.thumb { position: relative; overflow: hidden; background: #ece8e3; border-radius: 10px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.noimg { background: linear-gradient(135deg, #2a2d34 0%, #15171b 70%); }
.thumb.noimg::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--red); }
.thumb.noimg::after {
  content: attr(data-src); position: absolute; inset: 0; display: grid; place-items: center; padding: 0 14px; text-align: center;
  color: #fff; font-family: var(--display); font-size: 22px; letter-spacing: .5px; opacity: .92;
}
.thumb.sm { flex: 0 0 116px; width: 116px; aspect-ratio: 16 / 10; border-radius: 8px; }
.thumb.sm.noimg::after { font-size: 14px; padding: 0 8px; }
.thumb.sm.noimg::before { width: 3px; }

/* 홈: 실시간 뉴스 · 많이 본 뉴스 */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { border-bottom: 1px solid #f0ece8; }
.news-list li:last-child { border-bottom: 0; }
.nl { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; }
.nl:hover .t { color: var(--red); }
.nl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.news-list .m { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.news-list .m b { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-list .m .sec-tag { margin: 0; }
.news-list .t { font-weight: 700; font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-list.rank .nl { padding: 10px 0; gap: 10px; }
.news-list.rank .t { font-size: 14px; }
.nl-rank { flex: 0 0 22px; font-family: var(--display); font-size: 20px; line-height: 1.2; color: var(--red); text-align: center; }
.news-list.rank li:nth-child(n+4) .nl-rank { color: var(--ink-2); }

/* ---------------- 뉴스 모아보기 ---------------- */
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.hub-head h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.1; }
.hub-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.live-dot::before { content: ''; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; animation: pulse 1.6s infinite; }
.hub-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 7px 14px; font-weight: 700; font-size: 14px; }
.pill-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill-tabs button.on.top { background: var(--red); border-color: var(--red); }
.pill-tabs .n { font-weight: 500; opacity: .7; margin-left: 4px; font-size: 12.5px; }
.hub-tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.hub-tools select { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #fff; max-width: 170px; }
.hub-search { display: flex; gap: 6px; }
.hub-search input { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; width: 200px; background: #fff; }
.hub-search input:focus, .hub-tools select:focus { outline: none; border-color: var(--red); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.news-grid > .empty { grid-column: 1 / -1; }
.news-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: box-shadow .15s ease, transform .15s ease; }
.news-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20,20,30,.06), 0 10px 26px rgba(20,20,30,.1); }
.news-card.pinned { border-color: #f1b5b7; box-shadow: 0 0 0 3px var(--red-soft), var(--shadow); }
.nc-photo { position: relative; display: block; aspect-ratio: 16 / 9; }
.nc-photo .thumb { position: absolute; inset: 0; border-radius: 0; }
.nc-photo .sec-tag { position: absolute; left: 10px; top: 10px; margin: 0; z-index: 1; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.nc-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 12px; }
.nc-title { font-weight: 800; font-size: 16px; line-height: 1.45; letter-spacing: -0.2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nc-title:hover { color: var(--red); }
.news-card .a-foot { margin-top: auto; padding-top: 4px; border-top: 1px solid #f3f0ec; }
.sec-tag { flex-shrink: 0; font-size: 11.5px; font-weight: 800; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.sec-tag.top { background: var(--red); color: #fff; }
.sec-tag.center { background: var(--ink); color: #fff; }
.new-pill { position: sticky; top: 76px; z-index: 20; display: block; margin: 0 auto 12px; background: var(--red); color: #fff; border: 0; border-radius: 99px; padding: 8px 18px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 18px rgba(215, 20, 26, .35); }
.hub-note { font-size: 12.5px; color: var(--muted); margin-top: 16px; }

/* ---------------- 3단 레이아웃 ---------------- */
.layout-3 { display: grid; grid-template-columns: 260px minmax(0, 1fr) 340px; gap: 22px; padding-top: 26px; padding-bottom: 40px; align-items: start; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; padding-top: 26px; padding-bottom: 40px; align-items: start; }
.sticky-col { position: sticky; top: 84px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.panel-body { padding: 12px 16px; }

/* 기사 정보 공통 */
.a-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--muted); }
.a-source { font-weight: 700; color: var(--ink-2); background: var(--bg); border-radius: 6px; padding: 2px 8px; }
.a-pin { font-weight: 700; color: var(--red); }
.a-comment { margin: 0; padding: 8px 11px; background: #faf8f6; border-left: 3px solid var(--red); border-radius: 0 8px 8px 0; font-size: 14px; color: var(--ink-2); white-space: pre-line; }
.a-comment b { color: var(--red); font-size: 12px; margin-right: 6px; }
.news-card .a-comment { font-size: 13px; }
.a-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.a-orig { font-size: 13px; font-weight: 600; color: var(--red); }
.a-orig:hover { text-decoration: underline; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; font-size: 14px; }
.more { display: block; width: 100%; margin-top: 4px; }

/* 커뮤니티 미니 리스트 */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { border-bottom: 1px solid #f0ece8; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { display: block; padding: 9px 0; font-size: 14px; }
.mini-list a:hover .t { color: var(--red); }
.mini-list .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .m { font-size: 12px; color: var(--muted); }
.cmt-n { color: var(--red); font-weight: 700; font-size: 12.5px; margin-left: 4px; }

/* ---------------- 채팅 ---------------- */
.chat { display: flex; flex-direction: column; height: min(640px, calc(100vh - 120px)); }
.chat-online { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.chat-online::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.msg { padding: 6px 8px; border-radius: 8px; font-size: 14px; position: relative; }
.msg:hover { background: #faf8f6; }
.msg-top { display: flex; align-items: baseline; gap: 6px; }
.msg-nick { font-weight: 700; font-size: 13px; }
.msg.me .msg-nick { color: var(--red); }
.msg-admin { font-size: 10.5px; font-weight: 800; background: var(--ink); color: #fff; border-radius: 4px; padding: 0 5px; }
.msg-time { font-size: 11.5px; color: #a3a7ae; }
.msg-body { white-space: pre-wrap; }
.msg-actions { position: absolute; right: 6px; top: 4px; display: none; gap: 6px; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { display: flex; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: #fff; }
.chat-form input:focus { outline: none; border-color: var(--red); }
.chat-guest { padding: 12px; border-top: 1px solid var(--line); text-align: center; font-size: 13.5px; color: var(--muted); }
.chat-guest button { margin-left: 6px; }
.chat-note { font-size: 11.5px; color: #a3a7ae; padding: 0 12px 10px; }

/* ---------------- 게시판 ---------------- */
.board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.board-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; }
.board { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board th, .board td { padding: 12px 14px; border-bottom: 1px solid #f0ece8; font-size: 14px; text-align: left; }
.board th { background: #faf8f6; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.board td.num, .board th.num { width: 70px; text-align: center; color: var(--muted); }
.board td.who { width: 130px; color: var(--ink-2); }
.board td.when { width: 110px; color: var(--muted); font-size: 13px; }
.board tr:hover td { background: #fcfbfa; }
.board a:hover { color: var(--red); }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager button.cur { background: var(--ink); color: #fff; border-color: var(--ink); }

.post { padding: 24px; }
.post h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.35; }
.post-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.post-body { white-space: pre-wrap; padding: 20px 0; font-size: 15.5px; line-height: 1.75; min-height: 80px; }
.post-actions { display: flex; gap: 8px; justify-content: flex-end; }
.comments { margin-top: 18px; }
.comments h3 { font-size: 15px; margin: 0 0 10px; }
.cmt { padding: 12px 0; border-top: 1px solid #f0ece8; }
.cmt-top { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.cmt-top b { font-size: 13.5px; }
.cmt-top .when { color: var(--muted); font-size: 12px; }
.cmt-top .acts { margin-left: auto; display: flex; gap: 10px; }
.cmt-body { white-space: pre-wrap; font-size: 14.5px; margin-top: 4px; }
.hidden-flag { color: var(--red); font-size: 12px; font-weight: 700; }

/* ---------------- 폼 / 모달 ---------------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.field textarea { resize: vertical; min-height: 90px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; margin: 8px 0; }
.check input { margin-top: 3px; accent-color: var(--red); }
.check a { color: var(--red); text-decoration: underline; }
.form-err { color: var(--red); font-size: 13.5px; min-height: 20px; margin: 4px 0 8px; }
.form-row { display: flex; gap: 8px; justify-content: flex-end; }

.modal-back { position: fixed; inset: 0; background: rgba(10, 10, 14, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 16px 20px 20px; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 7px; font-weight: 700; color: var(--muted); }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }

/* ---------------- 푸터 ---------------- */
.site-footer { background: #17181c; color: #a3a7ae; font-size: 13px; padding: 28px 0 36px; margin-top: 20px; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.site-footer .links a { color: #e4e5e8; font-weight: 600; }
.site-footer .links a:hover { color: #fff; text-decoration: underline; }
.site-footer p { margin: 4px 0; line-height: 1.6; }

/* ---------------- 문서(약관 등) ---------------- */
.doc { max-width: 860px; margin: 26px auto 40px; }
.doc .panel { padding: 28px 32px; margin-bottom: 18px; }
.doc h2 { margin: 0 0 6px; font-size: 22px; scroll-margin-top: 90px; }
.doc h3 { margin: 22px 0 6px; font-size: 16px; }
.doc p, .doc li { font-size: 14.5px; color: var(--ink-2); }
.doc ol, .doc ul { padding-left: 20px; }
.doc .eff { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 8px 0; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: #faf8f6; }
.doc-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

/* ---------------- 관리자 ---------------- */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 22px 0 16px; }
.admin-tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 8px 16px; font-weight: 700; font-size: 14px; }
.admin-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.admin-tabs .badge { background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; margin-left: 6px; }
.row-list { display: flex; flex-direction: column; gap: 10px; }
.row { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.row-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.row-title { font-weight: 700; font-size: 15px; margin: 4px 0; display: block; }
.row-title:hover { color: var(--red); }
.row-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.row-acts input { flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; font-size: 13px; }
.tag { display: inline-block; border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--ink-2); }
.tag.top { background: var(--red); color: #fff; }
.tag.center { background: var(--ink); color: #fff; }
.tag.warn { background: #fff4e5; color: #b45309; }
.admin-art { display: flex; gap: 14px; align-items: flex-start; }
.admin-thumb { flex: 0 0 150px; }
.admin-thumb .thumb { width: 150px; aspect-ratio: 16 / 9; border-radius: 8px; }
.admin-thumb .thumb.noimg::after { font-size: 15px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #cfc9c2; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: #16a34a; }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.notice { background: #fff8ec; border: 1px solid #f6dcae; color: #7a4b07; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px; }

/* ---------------- 반응형 ---------------- */
@media (max-width: 1180px) {
  .layout-3 { grid-template-columns: minmax(0, 1fr) 320px; }
  .layout-3 .col-left { grid-column: 1 / -1; order: 3; }
  .layout-3 .col-left .sticky-col { position: static; }
}
@media (max-width: 900px) {
  .layout-3, .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .sticky-col { position: static; }
  .chat { height: 460px; }
  .hub-tools { margin-left: 0; width: 100%; }
  .hub-search { flex: 1; }
  .hub-search input { flex: 1; width: auto; min-width: 0; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .header-inner { gap: 10px; height: 56px; }
  .logo { font-size: 22px; }
  .logo-mark { width: 28px; height: 28px; font-size: 16px; }
  .nav a { padding: 6px 8px; font-size: 14px; }
  .auth .btn { padding: 6px 10px; font-size: 13px; }
  .auth .hide-sm { display: none; }
  .band-head h2, .hub-head h1 { font-size: 24px; }
  .band-head p { display: none; }
  .band-link { padding: 6px 12px; font-size: 13px; }
  .nm-card { flex-basis: 232px; width: 232px; }
  .nm-title { font-size: 14px; margin: 9px 12px 11px; }
  .news-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .thumb.sm { flex-basis: 96px; width: 96px; }
  .hub-tools select { flex: 1; max-width: none; }
  .board td.who, .board th.who, .board td.num, .board th.num { display: none; }
  .doc .panel { padding: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .admin-thumb { flex-basis: 96px; }
  .admin-thumb .thumb { width: 96px; }
  .admin-thumb .thumb.noimg::after { font-size: 12px; }
}
@media (max-width: 560px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 6px; row-gap: 2px; }
  .nav { order: 3; width: 100%; gap: 2px; margin: 0 -8px; }
  .nav a { padding: 6px 10px; }
  .auth > .btn { max-width: 150px; }
  .new-pill { top: 104px; }
  .hub-head h1 { font-size: 26px; }
  .pill-tabs button { padding: 6px 11px; font-size: 13px; }
}
