/* 공지 관리자 화면 */
*, *::before, *::after { box-sizing: border-box; }
:root { --bg: #f4f2ee; --card: #fff; --ink: #1f1d1a; --muted: #77716a; --line: #e4dfd7; --danger: #c4442f; color-scheme: light; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.6 "Pretendard", system-ui, sans-serif; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2 { margin: 0; letter-spacing: -.03em; line-height: 1.3; }
p { margin: 0; }
.muted { color: var(--muted); }

[data-show] { display: none !important; }
.adm[data-view="loading"] [data-show~="loading"],
.adm[data-view="setup"] [data-show~="setup"],
.adm[data-view="login"] [data-show~="login"],
.adm[data-view="list"] [data-show~="list"],
.adm[data-view="edit"] [data-show~="edit"] { display: block !important; }
.adm[data-view="list"] .adm__me, .adm[data-view="edit"] .adm__me { display: flex !important; }

.adm__bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 4vw, 40px); background: var(--head); color: #fff; }
.adm__brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.adm__brand img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.adm__brand span { font-weight: 700; font-size: 15px; line-height: 1.25; display: grid; }
.adm__brand small { font-weight: 500; font-size: 12px; opacity: .7; }
.adm__me { align-items: center; gap: 12px; font-size: 13px; }
.adm__me span { opacity: .75; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm__me button { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; padding: 6px 12px; border-radius: 999px; cursor: pointer; }

.pane { max-width: 1180px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 40px) 80px; }
.pane--center { min-height: calc(100vh - 60px); }
.pane--center > * { margin: clamp(32px, 12vh, 120px) auto 0; text-align: left; }
.pane--center > p { text-align: center; }
.pane__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.pane__head h1 { font-size: clamp(24px, 3vw, 32px); display: flex; align-items: center; gap: 10px; }
.count { font-size: 14px; font-weight: 700; background: var(--acc-soft); color: var(--acc); padding: 2px 10px; border-radius: 999px; }
.hint { margin-top: 18px; font-size: 13.5px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(22px, 3vw, 32px); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; transition: filter .2s, background .2s; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--acc { background: var(--acc); color: #fff; }
.btn--acc:hover { filter: brightness(1.08); }
.btn--ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.btn--danger { background: #fff; border-color: #efc7be; color: var(--danger); }
.btn--danger:hover { background: #fdf0ed; }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 14px; margin-bottom: 6px; }
.link:hover { color: var(--acc); }

/* 로그인 */
.login { width: min(420px, 100%); display: grid; gap: 14px; }
.login__eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--acc); }
.login h1 { font-size: 26px; }
.login .muted { margin-bottom: 6px; }
.login__err { min-height: 1.2em; font-size: 14px; color: var(--danger); }
.login .btn { width: 100%; }
.login__home { text-align: center; font-size: 14px; color: var(--muted); text-decoration: none; }

label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.lbl { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
input:not([type=checkbox]):not([type=file]), select, textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 400; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
textarea { resize: vertical; min-height: 280px; line-height: 1.75; }

/* 목록 */
.rows { display: grid; gap: 10px; }
.rows button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-align: left; cursor: pointer; transition: border-color .2s, transform .2s; }
.rows button:hover { border-color: var(--acc); transform: translateY(-1px); }
.rows b { font-size: 16px; font-weight: 600; }
.rows time { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rows__tags { display: flex; gap: 6px; }
.rows__empty { padding: 48px 20px; text-align: center; color: var(--muted); background: #fff; border: 1.5px dashed var(--line); border-radius: 16px; }
.pill { font-style: normal; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #efece6; color: #5d5852; white-space: nowrap; }
.pill--pin { background: var(--acc); color: #fff; }
.pill--draft { background: #fff1c7; color: #8a6a00; }

/* 편집 */
.ed { display: grid; gap: 24px; }
@media (min-width: 1000px) { .ed { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); align-items: start; } .ed__pv { position: sticky; top: 84px; } }
.ed__form { display: grid; gap: 20px; }
.ed__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tools button { padding: 7px 12px; border: 1px solid var(--line); background: #faf8f5; border-radius: 10px; font-size: 13.5px; cursor: pointer; }
.tools button:hover { border-color: var(--acc); color: var(--acc); }

.drop { position: relative; display: grid; gap: 4px; place-items: center; text-align: center; padding: 22px; border: 1.5px dashed var(--line); border-radius: 14px; background: #faf8f5; cursor: pointer; font-weight: 400; }
.drop:hover { border-color: var(--acc); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop span { font-weight: 700; color: var(--acc); }
.drop small { font-size: 13px; color: var(--muted); }
.files { display: grid; gap: 8px; margin-top: 10px; }
.files li { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.files img, .files__ic { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #efece6; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--muted); }
.files__name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files__name em { font-style: normal; font-size: 11.5px; color: var(--acc); font-weight: 700; }
.files button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #f3efe9; font-size: 18px; cursor: pointer; }
.files button:hover { background: #fdf0ed; color: var(--danger); }

.ed__opts { display: grid; gap: 10px; }
.chk { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 400; }
.chk input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--acc); flex: none; }
.chk span { display: grid; }
.chk b { font-size: 15px; }
.chk small { font-size: 13px; color: var(--muted); }
.ed__actions { display: flex; justify-content: space-between; gap: 12px; }
.ed__actions .btn--acc { margin-left: auto; min-width: 160px; }

/* 미리보기 */
.pv h2 { font-size: 24px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.post__body { font-size: 16px; line-height: 1.85; color: #3b3732; }
.post__body p, .post__body ul, .post__body ol { margin: 0 0 1em; }
.post__body ul, .post__body ol { padding-left: 1.3em; }
.post__body ul { list-style: disc; }
.post__body ol { list-style: decimal; }
.post__body h3 { font-size: 18px; margin: 1.4em 0 .5em; color: var(--ink); }
.post__body a { color: var(--acc); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #1f1d1a; color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14.5px; transition: .3s; z-index: 10; max-width: calc(100% - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { background: var(--danger); }

@media (max-width: 600px) {
  .adm__me span { display: none; }
  .pane__head .btn { width: 100%; }
  .rows button { grid-template-columns: 1fr auto; gap: 6px 10px; padding: 16px; }
  .rows__tags { grid-column: 1 / -1; }
  .ed__row { grid-template-columns: 1fr; }
  .ed__actions .btn--acc { min-width: 0; flex: 1; }
}
