/* leunkim.com 자유게시판 — 블로그(leunkim.com/style.css)와 같은 색 · 글꼴 · 머리글을 쓴다.
   게시판만의 것: 앱마다 블로그의 세 가지 색(라임 · 하늘 · 호박) 가운데 하나를 맡겨, 글 목록 왼쪽의 색 띠와 꼬리표로 보여 준다. */
:root {
  --bg: #f7f6f3; --paper: #ffffff; --ink: #1b1c1f; --ink-2: #44474d; --text: #2e3035; --muted: #74777e;
  --line: #e3e1dc; --accent: #0a7480; --accent-bg: #e6f4f5; --field: #ffffff;
  --hd: #0c0d0f; --hd-ink: #f3f5f8; --hd-muted: #9aa0a8;
  --lime: #dcf9a1; --sky: #70e2ee; --amber: #fed373;
  --danger: #b3261e; --danger-bg: #fbeceb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214; --paper: #202228; --ink: #e8e9ec; --ink-2: #c3c6cc; --muted: #959aa2; --text: #c9cbd0;
    --line: #34383f; --accent: #70e2ee; --accent-bg: #16292c; --field: #17181b;
    --danger: #ff8a80; --danger-bg: #3a1f1d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111214; --paper: #202228; --ink: #e8e9ec; --ink-2: #c3c6cc; --muted: #959aa2; --text: #c9cbd0;
  --line: #34383f; --accent: #70e2ee; --accent-bg: #16292c; --field: #17181b;
  --danger: #ff8a80; --danger-bg: #3a1f1d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.7 "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 머리글 (블로그와 같은 검은 띠) ---------- */
.hd { background: var(--hd); color: var(--hd-ink); }
.hd-in { max-width: 1120px; margin: 0 auto; padding: 18px 20px 10px; display: flex; align-items: center; gap: 20px; }
.brand { color: var(--hd-ink); display: flex; flex-direction: column; line-height: 1.25; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand { min-width: 0; }
.brand b { font-family: Archivo, sans-serif; font-stretch: 112%; font-weight: 800; font-size: 22px; letter-spacing: -.01em; white-space: nowrap; }
.brand span { font-size: 13px; color: var(--hd-muted); margin-top: 2px; }
.brand b::before { content: ""; display: inline-block; width: 18px; height: 12px; margin-right: 9px; vertical-align: 2px;
  background: linear-gradient(var(--lime) 0 3px, transparent 3px 4.5px, var(--sky) 4.5px 7.5px, transparent 7.5px 9px, var(--amber) 9px 12px); }
.hd-user { display: flex; align-items: center; gap: 10px; flex: none; font-size: 14px; color: var(--hd-muted); white-space: nowrap; }
.hd-user b { color: var(--hd-ink); font-weight: 700; }
.hd-btn { flex: none; white-space: nowrap; height: 34px; padding: 0 14px; border: 1px solid #33363c; border-radius: 17px; background: #1a1c20; color: var(--hd-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.hd-btn:hover { background: #2a2d33; border-color: var(--sky); }
.gnb-in { max-width: 1120px; margin: 0 auto; padding: 0 12px; display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.gnb-in::-webkit-scrollbar { display: none; }
.gnb a { color: #c9ccd2; white-space: nowrap; padding: 10px 12px 12px; font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
.gnb a:hover { text-decoration: none; color: #fff; background: #1c1f25; }
.gnb a[aria-current] { color: #fff; border-bottom-color: var(--sky); }
.gnb-sep { flex: none; width: 1px; height: 14px; margin: 0 8px 2px; background: #3d4048; }

/* ---------- 본문 틀 ---------- */
.wrap.board { max-width: 962px; margin: 28px auto 0; padding: 0 40px 40px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-height: 420px; }
.loading, .empty { color: var(--muted); padding: 56px 0; text-align: center; }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.pg-hd { display: flex; align-items: flex-end; gap: 20px; padding: 34px 0 20px; }
.pg-hd h1 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.25; letter-spacing: -.02em; }
.pg-hd p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; max-width: 34em; }
.pg-hd .grow { flex: 1; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn-primary { background: var(--hd); border-color: var(--hd); color: var(--hd-ink); }
.btn-primary:hover { border-color: var(--sky); }
:root[data-theme="dark"] .btn-primary { background: var(--hd-ink); border-color: var(--hd-ink); color: var(--hd); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { background: var(--hd-ink); border-color: var(--hd-ink); color: var(--hd); } }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-bg); }
.btn-s { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.linkish { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--ink); }

/* ---------- 앱 고르기 (목록 위의 갈래 · 글쓰기의 선택) ---------- */
.apps { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 18px; }
.app-tab { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px 0 9px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.app-tab:hover { text-decoration: none; border-color: var(--muted); color: var(--ink); }
.app-tab img { width: 22px; height: 22px; border-radius: 5px; flex: none; }
.app-tab.no-icon { padding-left: 14px; }
.app-tab small { color: var(--muted); font-size: 12px; font-weight: 400; }
.app-tab[aria-current], .app-tab[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--app-color, var(--line)); }
.c-savings { --app-color: var(--lime); }
.c-tax { --app-color: var(--sky); }
.c-population { --app-color: var(--amber); }
.c-none { --app-color: var(--line); }

.tools { display: flex; align-items: center; gap: 10px; padding: 0 0 14px; }
.tools form { display: flex; flex: 1; max-width: 320px; }
.tools input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; background: var(--field); padding: 0 12px; font-size: 14px; }
.tools form button { height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0 8px 8px 0; background: var(--bg); font-size: 13px; font-weight: 700; cursor: pointer; }
.tools .count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------- 글 목록 ---------- */
.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.posts li { border-bottom: 1px solid var(--line); }
.posts a { display: block; padding: 14px 4px 14px 16px; color: inherit; border-left: 4px solid var(--app-color, transparent); }
.posts a:hover { text-decoration: none; background: var(--bg); }
.posts .t { display: flex; align-items: baseline; gap: 8px; font-size: 16.5px; font-weight: 700; line-height: 1.45; color: var(--ink); }
.posts .t .ttl { min-width: 0; }
.posts .cm { flex: none; color: var(--accent); font-size: 13px; font-weight: 700; }
.posts .m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.posts .notice a { background: var(--accent-bg); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: var(--app-color, var(--line)); color: #1b1c1f; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag.c-none { background: none; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.tag.pin { background: var(--hd); color: var(--hd-ink); }
.who { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-weight: 500; }
.badge { display: inline-flex; align-items: center; height: 17px; padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; font-size: 11px; font-weight: 500; color: var(--muted); }
.badge.owner { border-color: var(--hd); background: var(--hd); color: var(--hd-ink); }
.badge.member { border-color: var(--accent); color: var(--accent); }

.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; padding: 22px 0 0; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.pager a:hover { background: var(--bg); text-decoration: none; }
.pager [aria-current] { background: var(--hd); color: var(--hd-ink); font-weight: 700; }

/* ---------- 글 보기 ---------- */
.back { display: inline-block; padding: 26px 0 6px; font-size: 14px; color: var(--muted); }
.post-hd { padding: 10px 0 16px; border-bottom: 1px solid var(--ink); }
.post-hd h1 { margin: 8px 0 10px; font-size: 26px; font-weight: 800; line-height: 1.35; letter-spacing: -.02em; }
.post-hd .m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13.5px; color: var(--muted); }
.post-body { padding: 26px 0 34px; color: var(--text); font-size: 16.5px; line-height: 1.85; white-space: pre-wrap; max-width: 42em; }
.post-acts { display: flex; gap: 8px; padding-bottom: 26px; }
.cms { border-top: 1px solid var(--line); padding-top: 22px; }
.cms h2 { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.cm-list { list-style: none; margin: 0; padding: 0; }
.cm-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.cm-list .m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.cm-list .b { margin-top: 4px; color: var(--text); white-space: pre-wrap; }
.cm-list .del { margin-left: auto; }
.cm-none { color: var(--muted); font-size: 14px; padding: 8px 0 4px; }

/* ---------- 쓰기 · 댓글 달기 ---------- */
.form { padding: 4px 0 0; }
.form .row { margin-bottom: 16px; }
.form label, .form .lbl { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--ink); }
.form label small, .form .lbl small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.in { display: block; width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 0 12px; font-size: 16px; }
textarea.in { height: auto; min-height: 260px; padding: 12px; line-height: 1.7; resize: vertical; }
.in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.as { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 14px; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.err { margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 500; }
.acts { display: flex; gap: 8px; align-items: center; }
.acts .spacer { flex: 1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cm-form { padding-top: 20px; }
.cm-form textarea.in { min-height: 96px; }

/* ---------- 창 (로그인 · 비밀번호 확인 · 지우기 확인) ---------- */
dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgb(12 13 15 / .55); }
.dlg { padding: 22px 22px 20px; }
.dlg h2 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.dlg p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }
.dlg .row { margin-bottom: 12px; }
.dlg label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.dlg .acts { justify-content: flex-end; margin-top: 16px; }
.dlg .fine { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 8px; background: var(--hd); color: var(--hd-ink); font-size: 14px; font-weight: 500; }

.ft { margin-top: 36px; }
.ft-in { max-width: 962px; margin: 0 auto; padding: 0 20px 44px; font-size: 13px; color: var(--muted); }
.ft-in p { margin: 0 0 4px; }
.ft-in b { color: var(--ink-2); }
.noscript { text-align: center; padding: 40px 20px; }

@media (max-width: 640px) {
  .hd-in { padding: 14px 16px 8px; gap: 12px; }
  .brand b { font-size: 18px; white-space: normal; }
  .hd-user span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
  .wrap.board { margin-top: 0; padding: 0 16px 28px; border-radius: 0; border-left: 0; border-right: 0; }
  .pg-hd { flex-direction: column; align-items: stretch; gap: 14px; padding: 24px 0 16px; }
  .pg-hd h1 { font-size: 25px; }
  .post-hd h1 { font-size: 22px; }
  .two { grid-template-columns: 1fr; }
  .tools form { max-width: none; }
  .tools .count { display: none; }
  .posts a { padding-left: 12px; }
  .ft-in { padding: 0 16px 36px; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .app-tab, .posts a { transition: background-color .12s, border-color .12s; } }
