/* ======================================================================
   자유 게시판 · 2026-09-23 디자인 개선
   법률 업무 앱 표준(1.법정기간 자동 계산기)의 「청람」 토큰·머리·히어로·카드·바닥을 그대로 따른다.
   ====================================================================== */
:root {
    --ground: #f2f5f8;
    --card: #ffffff;
    --line: #d9e2ea;
    --line-strong: #c3d0dc;
    --ink: #10203a;
    --ink-soft: #44546a;
    --ink-light: #7b8899;
    --accent: #0b4a76;
    --accent-2: #2d7fc0;
    --accent-soft: #e3eef7;
    --seal: #c8432f;
    --seal-soft: #fbe9e6;
    --amber: #9a6a0c;
    --amber-soft: #fdf3dc;
    --ok: #1f6f4a;
    --ok-soft: #e4f3ea;
    --r: 18px;
    --shadow: 0 1px 2px rgba(16, 32, 58, .04), 0 8px 24px rgba(16, 32, 58, .06);
    --font: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
    --serif: 'Noto Serif KR', 'Nanum Myeongjo', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--ground);
    background-image: radial-gradient(1200px 420px at 50% -120px, #dfeaf5 0%, rgba(223, 234, 245, 0) 70%);
    background-repeat: no-repeat;
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

/* ── 머리 ── */
.top {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.top-in {
    max-width: 1120px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-seal {
    width: 36px; height: 36px; border-radius: 9px; flex: none;
    display: grid; place-items: center;
    background: var(--ink); color: #fff;
    font-family: var(--serif); font-weight: 900; font-size: 20px; line-height: 1;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt b { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.brand-txt small { font-size: 12px; color: var(--ink-light); }
.head-tools { display: flex; gap: 8px; }
.tool-btn {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: #fff; border: 1px solid var(--line-strong); color: var(--ink-soft);
    transition: border-color .15s, color .15s, transform .15s;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.tool-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── 본문 틀 ── */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 40px; }

.hero {
    padding: 30px 0 18px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px;
    grid-template-areas: "txt char" "facts facts";
}
.hero-txt { grid-area: txt; min-width: 0; }
.hero .facts { grid-area: facts; align-self: start; }
/* 캐릭터는 위에서 조금 띄우고 바닥까지 — 바닥에 붙여 100% 넘게 키우면 머리가 잘린다(헌법 §7) */
.hero-char { grid-area: char; align-self: end; position: relative; width: 100px; }
.hero-char img { display: block; width: 100%; height: auto; animation: charIn .6s ease both .1s; }
.hero-bubble { display: none; }
@keyframes charIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (min-width: 760px) {
    .hero { grid-template-areas: "txt char" "facts char"; padding-bottom: 0; }
    .hero-char { width: 196px; margin: -8px 24px -30px 0; }   /* 허리 아래가 카드 뒤로 숨는다 */
    .hero-bubble {
        position: absolute; right: calc(100% + 4px); top: 30px; width: 196px; margin: 0;
        background: #fff; border: 1px solid var(--line-strong); border-radius: 16px; padding: 11px 13px;
        font-size: 13px; line-height: 1.55; color: var(--ink-soft); box-shadow: var(--shadow);
        animation: charIn .6s ease both .35s;
    }
    .hero-bubble b { color: var(--accent); }
    .hero-bubble::after {
        content: ''; position: absolute; right: -8px; top: 26px; width: 14px; height: 14px; background: #fff;
        border-right: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); transform: rotate(45deg);
    }
    .board { position: relative; z-index: 1; }
}
/* 말풍선은 본문 최대 폭일 때만(폴드·태블릿 폭에서 제목을 가린다 · 표준 §3-G) */
@media (min-width: 1120px) { .hero-bubble { display: block; } }
.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.hero h1 {
    margin: 0; font-family: var(--serif); font-weight: 900;
    font-size: clamp(30px, 6.4vw, 46px); line-height: 1.18; letter-spacing: -.02em;
}
.hero h1 span { color: var(--accent); }
.lead { margin: 12px 0 0; font-size: clamp(15px, 2.4vw, 17px); color: var(--ink-soft); max-width: 560px; }
.facts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li {
    font-size: 13px; color: var(--ink-soft); background: #fff;
    border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}
.facts b { color: var(--accent); font-weight: 800; }

/* ── 보드: 폰은 한 줄, 넓으면 쓰기 | 목록 ── */
.board { display: grid; gap: 16px; margin-top: 8px; }
@media (min-width: 980px) {
    .board { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); align-items: start; gap: 22px; }
    #stepWrite { position: sticky; top: 76px; }
}
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: var(--shadow); padding: 20px; min-width: 0;
    scroll-margin-top: 72px;
}
.step h2 {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 14px; font-size: 18px; font-weight: 800; letter-spacing: -.01em;
}
.no {
    width: 26px; height: 26px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-size: 14px; font-weight: 800;
    background: var(--accent); color: #fff;
}

/* ── 쓰기 폼 ── */
.field-label { display: block; margin: 16px 0 7px; font-size: 14px; font-weight: 700; color: var(--ink); }
#writeForm > .field-label:first-child { margin-top: 0; }
.field-label em { font-style: normal; font-weight: 500; color: var(--ink-light); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-radio { position: relative; cursor: pointer; }
.chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-radio span {
    display: inline-block; padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: #fff;
    font-size: 14px; font-weight: 700; color: var(--ink-soft); transition: all .15s;
}
.chip-radio input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-radio input:focus-visible + span { box-shadow: 0 0 0 3px rgba(45, 127, 192, .3); }
.chip-radio:hover input:not(:checked) + span { border-color: var(--accent); color: var(--accent); }

.select { position: relative; }
.select select {
    width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
    border: 1px solid var(--line-strong); border-radius: 12px; background: #fbfcfd;
    font-size: 16px; padding: 11px 40px 11px 12px; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.select svg {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none;
    width: 18px; height: 18px; fill: none; stroke: var(--ink-light); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.textarea, .input {
    width: 100%; display: block;
    border: 1px solid var(--line-strong); border-radius: 12px; background: #fbfcfd;
    font-size: 16px; line-height: 1.6; padding: 11px 12px; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 128px; }
.select select:focus, .textarea:focus, .input:focus {
    outline: 0; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(45, 127, 192, .15); background: #fff;
}
.textarea::placeholder, .input::placeholder { color: #9aa6b4; }
.count-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--ink-light); }
.hint.ready { color: var(--ok); font-weight: 700; }
.count b { color: var(--ink-soft); font-weight: 700; }

/* §4 개인정보 주의문 — 제거 금지 */
.form-privacy-note {
    display: flex; align-items: flex-start; gap: 9px;
    margin: 14px 0 0; padding: 11px 13px;
    font-size: 13px; line-height: 1.65; color: #5b4a1f;
    background: var(--amber-soft); border: 1px solid #efdcaa; border-radius: 12px;
}
.form-privacy-note svg { width: 16px; height: 16px; flex: none; margin-top: 3px; fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.form-privacy-note b { font-weight: 700; color: #4a3b14; }
.form-privacy-note a { color: var(--accent); font-weight: 700; }

.go {
    width: 100%; margin-top: 16px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 14px; padding: 14px 18px;
    background: var(--accent); color: #fff; font-size: 16px; font-weight: 800;
    box-shadow: 0 6px 16px rgba(11, 74, 118, .22);
    transition: background .15s, transform .15s, box-shadow .15s, opacity .15s;
}
.go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.go:hover:not(:disabled) { background: #083a5e; transform: translateY(-1px); }
.go:disabled { background: #9fb3c6; box-shadow: none; cursor: not-allowed; }
.go.busy { opacity: .7; pointer-events: none; }
.go.small { width: auto; margin: 0; padding: 10px 16px; font-size: 15px; }
.mail-line { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--ink-light); }
.mail-line a { color: var(--accent); font-weight: 700; text-decoration: none; }
.mail-line a:hover { text-decoration: underline; }

/* 올린 뒤 */
.done { animation: charIn .4s ease both; }
.done-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 800; color: var(--ok); }
.done-title svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done-sub { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.cta {
    display: flex; align-items: center; gap: 12px; margin-top: 16px; text-decoration: none;
    border: 1px solid var(--line-strong); border-radius: 14px; padding: 10px 12px; background: #fff;
    transition: border-color .15s, transform .15s;
}
.cta:hover { border-color: var(--accent); transform: translateY(-1px); }
.cta img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--accent-soft); flex: none; }
.cta span { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.cta small { font-size: 12px; color: var(--ink-light); }
.cta b { font-size: 15px; color: var(--accent); }
.cta > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ink-light); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.link-btn {
    margin-top: 12px; padding: 4px 0; border: 0; background: none; cursor: pointer;
    font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}

/* ── 목록 ── */
.tabs {
    display: flex; gap: 6px; margin: 0 -4px 14px; padding: 0 4px 2px;
    overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
    flex: none; cursor: pointer; border: 1px solid var(--line-strong); background: #fff;
    color: var(--ink-soft); font-size: 14px; font-weight: 700;
    padding: 7px 13px; border-radius: 999px; transition: all .15s;
}
.tabs button i { font-style: normal; font-weight: 600; opacity: .6; margin-left: 2px; }
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs button:not([aria-selected="true"]):hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 400px) { .tabs button { font-size: 13px; padding: 6px 10px; } }

.posts { display: grid; gap: 10px; }
.post {
    border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; background: #fff;
    transition: border-color .15s;
}
.post:hover { border-color: var(--line-strong); }
.post.fresh { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(45, 127, 192, .12); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.badge {
    display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.4;
    padding: 2px 9px; border-radius: 999px; border: 1px solid transparent;
}
.badge.review { background: var(--accent-soft); color: var(--accent); }
.badge.request { background: var(--seal-soft); color: #a3321f; }
.badge.etc { background: #eef1f4; color: var(--ink-soft); }
.badge.tool { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); }
.post-meta time { margin-left: auto; font-size: 12px; color: var(--ink-light); white-space: nowrap; }
.post-body { margin: 9px 0 0; font-size: 15px; line-height: 1.7; white-space: pre-wrap; }

.reply {
    display: flex; gap: 10px; margin-top: 12px; padding: 11px 12px;
    background: #f5f8fb; border-radius: 12px; border-left: 3px solid var(--accent);
}
.reply img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--accent-soft); flex: none; }
.reply > div { min-width: 0; flex: 1; }
.reply-head { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 13px; }
.reply-head b { color: var(--accent); font-weight: 800; }
.reply-head span { font-size: 12px; color: var(--ink-light); }
.reply-body { margin: 3px 0 0; font-size: 14px; line-height: 1.65; color: var(--ink-soft); white-space: pre-wrap; }

.admin-actions { display: none; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.admin-mode .admin-actions { display: flex; }
.admin-btn {
    cursor: pointer; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 8px;
    border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
}
.admin-btn[data-act="delete"]:hover { border-color: var(--seal); color: var(--seal); }
.admin-btn[data-act="reply"]:hover { border-color: var(--accent); color: var(--accent); }

.skeleton { display: grid; gap: 10px; }
.skeleton span {
    height: 86px; border-radius: 14px;
    background: linear-gradient(90deg, #eef2f6 0%, #f7f9fb 50%, #eef2f6 100%);
    background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty, .error { text-align: center; padding: 28px 10px; color: var(--ink-soft); font-size: 14px; }
.empty p, .error p { margin: 2px 0; }
.empty b { color: var(--ink); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; }
.page-numbers { display: flex; align-items: center; gap: 4px; }
.page-btn, .page-number {
    min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; cursor: pointer;
    display: grid; place-items: center; font-size: 14px; font-weight: 700;
    border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
}
.page-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.page-btn:disabled { opacity: .4; cursor: default; }
.page-number.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-btn:hover:not(:disabled), .page-number:not(.active):hover { border-color: var(--accent); color: var(--accent); }
.page-ellipsis { color: var(--ink-light); padding: 0 2px; }

/* ── 관리자 답글 창 ── */
.modal {
    position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
    background: rgba(16, 32, 58, .45);
}
.modal-box {
    width: 100%; max-width: 480px; background: #fff; border-radius: var(--r); padding: 20px;
    box-shadow: 0 20px 50px rgba(16, 32, 58, .25); display: grid; gap: 10px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink-light); }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; }
.ghost { cursor: pointer; border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 10px 16px; font-weight: 700; color: var(--ink-soft); }

/* ── 바닥 ── */
.foot { margin-top: 48px; background: var(--ink); color: #c9d6e6; }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 26px 20px 30px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot-links a { color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-note { margin: 14px 0 0; font-size: 13px; line-height: 1.7; max-width: 760px; }
.foot-note a { color: #fff; }
.foot-copy { margin: 10px 0 0; font-size: 12px; color: #8fa1b8; }
.foot-copy span { font-family: var(--serif); font-weight: 900; }

.toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 80;
    transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
    background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
    padding: 10px 16px; border-radius: 999px; box-shadow: 0 8px 24px rgba(16, 32, 58, .25);
    transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--seal); }

@media (max-width: 400px) {
    .wrap { padding: 0 16px 36px; }
    .top-in { padding: 10px 16px; }
    .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .skeleton span { animation-duration: 3s; }
}

/* 2026-10-11 머리 로고 · 보통 글꼴 信 네모 → 홈 로고의 붓글씨 信을 청람으로(조변·인기 «C») */
.brand-mark { width: 36px; height: 36px; border-radius: 9px; flex: none; display: block; overflow: hidden; }
