/* 혼공 콘텐츠 공장 — 카드뉴스와 같은 글씨(Paperlogy 제목, SUIT 본문), 종이 바탕, 신문 편집실 느낌 */
@font-face { font-family: PL; src: url(/fonts/Paperlogy-7Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: PL; src: url(/fonts/Paperlogy-9Black.woff2) format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: SUIT; src: url(/fonts/SUIT-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: SUIT; src: url(/fonts/SUIT-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: SUIT; src: url(/fonts/SUIT-ExtraBold.woff2) format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --paper: #F3EFE6;
  --sheet: #FBF9F4;
  --ink: #161616;
  --ink-2: #4a4a48;
  --muted: #85817a;
  --rule: #d6cfbf;
  --navy: #24355E;
  --mark: #FFE07A;
  --red: #B5523A;
  --green: #2E6B4A;
  --amber: #8A5A00;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: SUIT, 'Apple SD Gothic Neo', sans-serif; font-weight: 500; font-size: 15px; line-height: 1.6; -webkit-text-size-adjust: 100%; letter-spacing: -0.2px; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; cursor: pointer; letter-spacing: inherit; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: 0; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
textarea { min-height: 84px; resize: vertical; }
b, strong { font-weight: 800; }

/* 머리: 신문 제호처럼 */
.top { background: var(--paper); border-bottom: 3px double var(--ink); position: sticky; top: 0; z-index: 10; }
.top .row { max-width: 1180px; margin: 0 auto; display: flex; align-items: flex-end; gap: 12px; padding: 14px 16px 6px; }
.top .logo { font-family: PL; font-weight: 900; font-size: 26px; letter-spacing: -1.2px; color: var(--ink); text-decoration: none; line-height: 1; display: flex; align-items: center; gap: 8px; }
.top .logo img { width: 30px; height: 30px; }
.top .logo small { font-family: SUIT; font-weight: 700; font-size: 12px; letter-spacing: 0; color: var(--muted); margin-left: 4px; align-self: flex-end; }
.top .who { margin-left: auto; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.top .who button { background: none; border: 0; border-bottom: 1px solid var(--ink-2); padding: 0; margin-left: 8px; font-size: 13px; color: var(--ink-2); }
.tabs { max-width: 1180px; margin: 0 auto; display: flex; gap: 18px; overflow-x: auto; padding: 0 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; color: var(--muted); text-decoration: none; padding: 8px 0 7px; font-weight: 800; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--ink); }

main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 90px; }
h1 { font-family: PL; font-weight: 900; font-size: 34px; letter-spacing: -1.5px; line-height: 1.15; margin: 4px 0 8px; }
h2 { font-family: PL; font-weight: 900; font-size: 21px; letter-spacing: -0.8px; margin: 34px 0 12px; padding-top: 10px; border-top: 2px solid var(--ink); display: flex; align-items: baseline; gap: 10px; }
h2 .n { font-size: 13px; font-family: SUIT; font-weight: 800; color: var(--muted); }
h3 { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.mark { background: linear-gradient(transparent 55%, var(--mark) 55%); padding: 0 2px; }
.lead { color: var(--ink-2); margin: 0 0 18px; max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.box { background: var(--sheet); border: 1px solid var(--rule); padding: 14px 16px; }
.box.click, .click { cursor: pointer; }
.box.click:hover { border-color: var(--ink); }

/* 숫자 줄: 타일 대신 세로줄로 나눈 큰 숫자 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.stats a { padding: 12px 14px; text-decoration: none; color: inherit; border-right: 1px solid var(--rule); }
.stats a:nth-child(3n) { border-right: 0; }
.stats a:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(6, 1fr); } .stats a:nth-child(-n+3) { border-bottom: 0; } .stats a:nth-child(3n) { border-right: 1px solid var(--rule); } .stats a:last-child { border-right: 0; } }
.stats b { display: block; font-family: PL; font-weight: 900; font-size: 38px; letter-spacing: -1.5px; line-height: 1.05; }
.stats span { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.stats a.hot b { color: var(--red); }

.chip { display: inline-block; border: 1px solid currentColor; padding: 0 6px; font-size: 11.5px; font-weight: 800; color: var(--ink-2); white-space: nowrap; line-height: 1.6; }
.chip.s-확인전 { color: var(--navy); }
.chip.s-수정요청 { color: var(--red); }
.chip.s-업로드대기 { color: var(--amber); background: #fff3c4; }
.chip.s-업로드완료 { color: var(--green); }
.chip.s-시안나옴 { color: var(--amber); background: #fff3c4; }
.chip.s-확정 { color: var(--green); }
.chip.ai { color: #fff; background: var(--ink); border-color: var(--ink); }

.filters { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 16px; }
.filters button { border: 0; background: none; color: var(--muted); padding: 2px 0; font-size: 14px; font-weight: 800; border-bottom: 2px solid transparent; }
.filters button.on { color: var(--ink); border-color: var(--ink); }

/* 세트 */
.deck { padding: 0; background: none; border: 0; }
.deck .thumb { aspect-ratio: 4 / 5; background: #e6e0d3 center/cover no-repeat; border: 1px solid var(--rule); }
.deck:hover .thumb { border-color: var(--ink); }
.deck .meta { padding: 8px 2px 0; }
.deck .meta .t { font-weight: 800; line-height: 1.35; margin: 5px 0 1px; }

.btn { border: 1px solid var(--ink); border-radius: 0; padding: 9px 15px; font-weight: 800; background: var(--sheet); color: var(--ink); }
.btn:hover { background: #fff; }
.btn.primary, .btn.ok { background: var(--ink); color: #fff; }
.btn.fix { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: var(--rule); color: var(--ink-2); background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: default; }
a.btn { text-decoration: none; display: inline-block; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.slides { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.slides img { flex: none; width: min(78vw, 420px); aspect-ratio: 4/5; object-fit: cover; scroll-snap-align: start; background: #e6e0d3; border: 1px solid var(--rule); }
.slides.sm img { width: min(44vw, 230px); }
pre.cap { white-space: pre-wrap; font-family: inherit; background: var(--sheet); border: 1px solid var(--rule); padding: 12px 14px; margin: 0; font-size: 14px; max-height: 360px; overflow: auto; }

/* 대화: 메신저처럼 평범하게 */
.chat { display: flex; flex-direction: column; gap: 12px; }
.msg { border-left: 3px solid var(--rule); padding: 2px 0 2px 12px; }
.msg.me { border-color: var(--ink); }
.msg .who { font-size: 12px; font-weight: 800; color: var(--muted); }
.msg.me .who { color: var(--ink); }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.typing { color: var(--muted); font-size: 13px; }
.composer { display: flex; gap: 8px; margin-top: 14px; align-items: stretch; }
.composer textarea { min-height: 52px; }

table.log { width: 100%; border-collapse: collapse; background: var(--sheet); font-size: 13.5px; }
table.log th, table.log td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.log th { font-weight: 800; border-bottom: 2px solid var(--ink); position: sticky; top: 0; background: var(--sheet); white-space: nowrap; }
.tablewrap { overflow-x: auto; border-top: 2px solid var(--ink); }

.md h1 { font-size: 24px; } .md h2 { font-size: 18px; border-top-width: 1px; } .md h3 { font-size: 15px; }
.md table { border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; }
.md td, .md th { border: 1px solid var(--rule); padding: 4px 8px; }
.md blockquote { margin: 0; padding: 2px 12px; border-left: 3px solid var(--mark); color: var(--ink-2); }

.gallery img { width: 100%; aspect-ratio: 4/5; object-fit: cover; background: #e6e0d3; display: block; border: 1px solid var(--rule); }
.form { display: grid; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
.note { border: 1px solid var(--ink); background: #fff8dc; padding: 10px 14px; font-size: 14px; }
.empty { color: var(--muted); padding: 18px 0; border-top: 1px dashed var(--rule); border-bottom: 1px dashed var(--rule); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; z-index: 50; font-weight: 700; }
.chart { position: relative; height: 280px; }
details summary { cursor: pointer; font-weight: 800; }
.list-row { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.list-row:first-child { border-top: 1px solid var(--rule); }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .box { width: min(380px, 100%); padding: 28px 26px; border: 0; border-top: 6px solid var(--ink); }
.login h1 { display: flex; align-items: center; gap: 10px; font-size: 30px; }
.login h1 img { width: 40px; height: 40px; }
.login label { font-weight: 800; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
@media (max-width: 560px) {
  .top .logo { font-size: 21px; }
  .top .logo small { display: none; }
  .top .logo img { width: 26px; height: 26px; }
  h1 { font-size: 28px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
