/* =====================================================================
   가톨릭신문 사진 DB — 화면 스타일
   글꼴: Pretendard (SIL OFL, assets/fonts) · 색: 회청색 종이 + 성모 청색 + 전례 금색
   ===================================================================== */
@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("fonts/PretendardVariable.woff2") format("woff2-variations");
}

:root {
  --bg: #eef1f4;          /* 회청색 바탕 */
  --panel: #ffffff;
  --sunk: #f6f8fa;        /* 패널 안의 오목한 영역 */
  --ink: #14202e;         /* 짙은 남색 글자 */
  --ink-2: #2c3a4a;
  --muted: #5f6c7a;
  --line: #dce1e7;
  --line-2: #c9d1da;
  --accent: #1e4f8f;      /* 성모 청색 */
  --accent-2: #173f73;
  --accent-soft: #e6eef8;
  --gold: #b8892b;        /* 전례 금색: 현재·선택 상태에만 */
  --gold-soft: #f6eedb;
  --ok: #2c6b45;  --ok-soft: #e5f2ea;
  --warn: #8a5a00; --warn-soft: #fbf1dc;
  --err: #a32626;  --err-soft: #fbe9e9;
  --admin: #13243b;       /* 관리자 모드 사이드바 */
  --radius-s: 6px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 32, 46, .06), 0 4px 14px rgba(20, 32, 46, .05);
  --font: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; word-break: keep-all;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.3; margin: 0 0 18px; }
h1 small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; margin: 30px 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- 상단 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 56px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; letter-spacing: -0.03em; color: var(--ink); }
.brand::before { content: ""; width: 10px; height: 22px; border-radius: 2px; background: linear-gradient(var(--accent) 0 70%, var(--gold) 70%); }
.brand:hover { text-decoration: none; }
.brand.has-logo { gap: 8px; }
.brand.has-logo::before { content: none; }
.brand.has-logo img { display: block; height: 28px; width: auto; max-width: 180px; object-fit: contain; }
.topbar nav { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.topbar nav a, .topbar nav .linkbtn { padding: 6px 10px; border-radius: var(--radius-s); color: var(--ink-2); }
.topbar nav a:hover, .topbar nav .linkbtn:hover { background: var(--sunk); text-decoration: none; }
.who { color: var(--muted); padding-right: 8px; margin-right: 4px; border-right: 1px solid var(--line); }
.topbar nav a.admin-btn { background: var(--admin); color: #fff; font-weight: 600; margin-left: 6px; }
.topbar nav a.admin-btn:hover { background: var(--accent-2); }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }

/* ---------- 본문 ---------- */
.wrap { max-width: 1000px; margin: 28px auto; padding: 0 20px; }
.wrap.wide { max-width: 1320px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card.narrow { max-width: 480px; margin: 0 auto; }

/* ---------- 폼 ---------- */
label { display: block; margin: 0 0 14px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
label input, label select { display: block; width: 100%; margin-top: 5px; }
input, select, button, textarea { font: inherit; letter-spacing: inherit; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=date], input:not([type]), select, textarea {
  padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: #fff; color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: #98a3af; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 400; }
label.check input { width: auto; margin: 0; accent-color: var(--accent); }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-s);
  background: #fff; color: var(--ink); cursor: pointer; font-weight: 500; line-height: 1.4;
  transition: background .12s, border-color .12s;
}
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; }
button:disabled { opacity: .45; cursor: default; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
button.danger { color: var(--err); }
button.danger:hover { background: var(--err-soft); border-color: var(--err); }
button.wide { width: 100%; padding: 12px; margin-top: 6px; font-size: 15.5px; }
button.mini { padding: 1px 8px; font-size: 12px; margin-left: 4px; }
button.x { border: 0; background: none; padding: 0 5px; color: var(--muted); font-size: 16px; line-height: 1; }
button.x:hover { color: var(--err); background: none; }

/* ---------- 알림 ---------- */
.flash { padding: 11px 14px; border-radius: var(--radius-s); font-size: 14px; margin: 0 0 16px; border-left: 3px solid; }
.flash.error { background: var(--err-soft); color: var(--err); }
.flash.ok    { background: var(--ok-soft); color: var(--ok); }
.flash.warn  { background: var(--warn-soft); color: var(--warn); }
.sub  { color: var(--muted); font-size: 14px; margin: 18px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; line-height: 1.55; }
.hint.top { margin: -2px 0 10px; }

/* ---------- 로그인·가입 ---------- */
body.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); }
/* 왼쪽 소개 영역: 배경 사진이 있으면 사진, 없으면 필름 밀착 인화지 무늬 */
.auth-side {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 56px 76px 56px 60px; color: #dfe7f1;
  background:
    linear-gradient(to top, rgba(12, 22, 37, .96) 0%, rgba(12, 22, 37, .55) 42%, rgba(12, 22, 37, .12) 100%),
    radial-gradient(ellipse 60% 45% at 12% 8%, rgba(184, 137, 43, .16), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='680' height='480'%3E%3Cpath d='M279 293c40-3 82-2 125 1 2 27 1 56-2 84-42 2-85 1-124-2-2-27-2-55 1-83z' fill='none' stroke='%23b8892b' stroke-opacity='.55' stroke-width='2.4' stroke-linecap='round'/%3E%3Crect x='8.5' y='104.5' width='119' height='79' rx='3' fill='%23fff' fill-opacity='.04'/%3E%3C/svg%3E") -40px -20px / 680px 480px,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='136' height='96'%3E%3Crect x='8.5' y='8.5' width='119' height='79' rx='3' fill='%23fff' fill-opacity='.025' stroke='%23fff' stroke-opacity='.075'/%3E%3C/svg%3E") -40px -20px / 136px 96px,
    linear-gradient(160deg, #13243b 0%, #1a3c6b 100%);
}
.auth-side::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='22'%3E%3Crect x='9' y='7' width='12' height='9' rx='2' fill='%23fff' fill-opacity='.10'/%3E%3C/svg%3E") 0 0 / 30px 22px, rgba(5, 10, 18, .45);
  border-left: 1px solid rgba(255, 255, 255, .06);
}
.auth-side.has-bg {
  background:
    linear-gradient(to top, rgba(12, 22, 37, .94) 0%, rgba(12, 22, 37, .55) 38%, rgba(12, 22, 37, .08) 75%),
    var(--auth-bg) center / cover no-repeat,
    var(--admin);
}
.auth-brand { position: relative; margin: 0 0 14px; font-size: 40px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.2; color: #fff; }
.auth-brand::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 18px; background: var(--gold); }
.auth-tag { position: relative; margin: 0; font-size: 16px; line-height: 1.75; color: #c3d0df; }
body.auth main { margin: 0; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; background: var(--panel); }
.auth-card { border: 0; box-shadow: none; padding: 0; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card h1 + .auth-lead, .auth-lead { color: var(--muted); margin: 0 0 26px; font-size: 14.5px; }
@media (max-width: 820px) {
  body.auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  body.auth main { padding: 32px 20px; }
}

/* ---------- 정보 표 ---------- */
dl.kv { display: grid; grid-template-columns: 84px 1fr; gap: 7px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* ---------- 목록 표 ---------- */
.toolbar { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; align-items: center; }
.toolbar input { flex: 1; min-width: 180px; }
.toolbar input[type=checkbox] { flex: none; min-width: 0; width: auto; }
p.hint + form.toolbar { margin-top: 14px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
table.list th { background: var(--sunk); color: var(--muted); font-weight: 600; font-size: 13px; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: #fafbfc; }
table.list tr.off td { color: var(--muted); }
table.list tr.fail td { background: #fdf5f5; }
table.list td.wrap { white-space: normal; min-width: 240px; }
table.list td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
table.list td.actions button { padding: 4px 10px; font-size: 13px; }
table.list form.pw input { width: 110px; padding: 4px 8px; font-size: 13px; }
table.list form.role select { padding: 4px 8px; font-size: 13px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--sunk); }
.tag.off  { background: var(--err-soft); color: var(--err); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- 첫 화면 ---------- */
.hero { padding: 13vh 0 0; text-align: center; }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.045em; margin-bottom: 10px; }
.hero .lead { color: var(--muted); font-size: 16px; margin: 0 0 30px; }
.hero .lead b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.searchbox { display: flex; gap: 8px; max-width: 680px; margin: 0 auto; }
.searchbox input { flex: 1; padding: 14px 18px; font-size: 17px; border-radius: var(--radius); }
.searchbox button { padding: 0 26px; font-size: 16px; border-radius: var(--radius); }
.searchform.big .searchbox input { box-shadow: var(--shadow); border-color: var(--line); }

/* ---------- 검색 폼 ---------- */
.searchform { max-width: 780px; margin: 0 0 20px; }
.searchform.big { margin: 0 auto; }
.searchform .searchbox { max-width: none; }
.ac-wrap { position: relative; flex: 1; }
.ac-wrap input { width: 100%; }
.searchform:not(.big) .searchbox input { padding: 10px 14px; font-size: 16px; }
ul.ac { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 6px 0 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(20,32,46,.12); text-align: left; }
ul.ac li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: var(--radius-s); cursor: pointer; }
ul.ac li small { color: var(--muted); }
ul.ac li.on, ul.ac li:hover { background: var(--accent-soft); }
details.adv { margin-top: 12px; text-align: left; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 14px; display: inline-block; padding: 2px 0; }
details.adv summary:hover { color: var(--ink); }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 18px; margin-top: 12px;
  padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.adv-grid label { margin-bottom: 8px; }
.range { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.range input { min-width: 0; flex: 1; margin: 0; }
.adv-grid label.check { align-self: end; }

/* ---------- 검색 결과 ---------- */
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.result-head strong { font-size: 16px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 11px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-2); font-size: 13px; }
.chip.muted { background: var(--sunk); color: var(--muted); }
.chip a { color: var(--muted); }
.empty { color: var(--muted); padding: 56px 0; text-align: center; }
ul.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 16px; }
/* 보기 방식: 한 줄에 1~6장 (검색 결과 위 '한 줄에 N장'). 화면이 좁으면 자동으로 줄임 */
ul.grid.cols-1 { grid-template-columns: minmax(0, 1fr); max-width: 1100px; margin: 0 auto; gap: 22px; }
ul.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
ul.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
ul.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
ul.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
ul.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* 한 장씩 볼 때는 자르지 않고 사진 전체를 보여 줌 */
ul.grid.cols-1 .thumb { aspect-ratio: auto; background: #1b2430; }
ul.grid.cols-1 .thumb img { height: auto; max-height: 80vh; object-fit: contain; margin: 0 auto; }
ul.grid.cols-1 .meta { font-size: 14px; padding: 10px 14px 12px; }
ul.grid.cols-1 .meta .fold, ul.grid.cols-2 .meta .fold { flex-basis: auto; }
@media (max-width: 1100px) { ul.grid.cols-5, ul.grid.cols-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 820px)  { ul.grid.cols-4, ul.grid.cols-5, ul.grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px)  { ul.grid.cols-3, ul.grid.cols-4, ul.grid.cols-5, ul.grid.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.cols-pick { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); }
.cols-pick span { padding: 0 4px; }
.cols-pick button { min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cols-pick button:hover { border-color: var(--line-2); }
.cols-pick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.cols-pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
ul.grid li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .12s, box-shadow .12s; }
ul.grid li:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.thumb { display: block; position: relative; aspect-ratio: 4 / 3; background: #dfe4ea; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; top: 7px; right: 7px; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; background: rgba(19,36,59,.78); color: #fff; }
.meta { padding: 8px 10px 10px; font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 2px 8px; }
.meta .date { font-weight: 700; font-variant-numeric: tabular-nums; }
.meta .ph { color: var(--accent); }
.meta .fold { flex-basis: 100%; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 28px 0; }
nav.pager a, nav.pager b { min-width: 38px; text-align: center; padding: 6px 11px; border-radius: var(--radius-s); border: 1px solid var(--line); background: #fff; }
nav.pager a:hover { border-color: var(--line-2); text-decoration: none; }
nav.pager b { background: var(--accent); border-color: var(--accent); color: #fff; }
.view-simple img { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto 16px; }

/* =====================================================================
   3단 보기 화면
   ===================================================================== */
body.viewer { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
main.viewer-main { flex: 1; min-height: 0; }
.v3 { display: grid; grid-template-columns: 350px 1fr 136px; height: 100%; }
.v-info { overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 18px 48px; font-size: 14px; }
.v-info .back-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 14px; padding: 10px 14px;
  border-radius: var(--radius-s); background: var(--accent); color: #fff; font-weight: 600; font-size: 14.5px; }
.v-info .back-btn:hover { background: var(--accent-2); text-decoration: none; }
.v-info .back-btn span { font-size: 17px; line-height: 1; }
.v-tools .back-mini { background: #34465b; border-color: #4a6280; color: #fff; font-weight: 600; }
.v-tools .back-mini:hover { background: #3f5671; text-decoration: none; }
.v-info h2.fname { font-size: 15.5px; margin: 0 0 12px; word-break: break-all; }
.v-info section { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.v-info h3 { font-size: 13px; color: var(--ink-2); margin: 0 0 9px; font-weight: 700; }
.v-info dl.kv { grid-template-columns: 74px 1fr; font-size: 13.5px; }
.v-info dl.orig dd { white-space: pre-wrap; }
.folder-box { margin-top: 12px; padding: 9px 11px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 13px; word-break: break-all; }
.folder-box .lbl { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.folder-date { margin-top: 6px; color: var(--muted); }
ul.tags { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.tags li { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 14px; background: var(--sunk); border: 1px solid var(--line); font-size: 13px; }
ul.tags li a { color: var(--ink); }
ul.tags li.t-photographer { background: var(--gold-soft); border-color: #ead8b0; }
ul.tags li.t-person { background: var(--accent-soft); border-color: #cddcf0; }
ul.tags li.t-place { background: #e7f3ec; border-color: #c9e3d3; }
ul.tags li.t-event { background: #f1eaf6; border-color: #dfd0ea; }
.tag-add { display: flex; gap: 6px; }
.tag-add select { width: 80px; padding: 6px; }
.tag-add .ac-wrap input { padding: 6px 10px; }
.tag-add button { padding: 6px 11px; }
.info-form label { margin-bottom: 9px; font-size: 13px; }
.info-form input, .info-form textarea { display: block; width: 100%; padding: 7px 10px; font-size: 14px; margin: 0 0 7px; }
.info-form ::placeholder { color: var(--muted); opacity: .85; }
.v-info h3 small { font-weight: 400; margin-left: 4px; }
.info-form textarea { resize: vertical; }
.info-form .row { display: flex; align-items: center; gap: 10px; }
.info-form .saved { color: var(--ok); font-size: 13px; }
ul.edits { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12.5px; }
ul.edits li { padding: 7px 0; border-bottom: 1px dotted var(--line); }
ul.edits small { color: var(--muted); }

.v-stage { display: flex; flex-direction: column; min-width: 0; background: #1b2430; }
.v-tools { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: #121a24; flex-wrap: wrap; }
.v-tools button, .v-tools .btn { padding: 5px 12px; font-size: 13px; background: #243142; border-color: #34465b; color: #e7edf4; }
.v-tools button:hover { background: #2e3f54; border-color: #4a6280; }
.v-tools .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.v-tools button.danger { color: #ffb4b4; }
.v-tools label.check { color: #c7d1dc; font-size: 13px; margin: 0; }
.v-tools .sp { flex: 1; }
.v-tools button.on { background: var(--gold); border-color: var(--gold); color: #1b1407; }
.v-canvas { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 14px; overflow: auto; }
.v-imgbox { position: relative; display: inline-block; max-width: 100%; max-height: 100%; line-height: 0; user-select: none; }
.v-imgbox img { max-width: 100%; max-height: calc(100vh - 150px); display: block; box-shadow: 0 6px 30px rgba(0,0,0,.35); }
.v-imgbox.draw-on { cursor: crosshair; }
.regions .rg { position: absolute; border: 2px solid rgba(255,255,255,.92); box-shadow: 0 0 0 1px rgba(0,0,0,.45); line-height: 1.3; }
.regions .rg span { position: absolute; left: -2px; top: 100%; margin-top: 3px; white-space: nowrap; padding: 2px 7px; font-size: 12px;
  background: rgba(19,36,59,.88); color: #fff; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.regions .rg:hover { border-color: var(--gold); }
.regions .rg:hover span, .v-imgbox:not(.draw-on):hover .regions .rg span { opacity: 1; }
.regions .rg span button.x { color: #c7d1dc; }
.drawing { position: absolute; border: 2px dashed var(--gold); background: rgba(184,137,43,.16); pointer-events: none; }
.draw-hint { padding: 7px 12px; background: var(--gold); color: #1b1407; font-size: 13.5px; text-align: center; }
.region-form { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #121a24; color: #e7edf4; flex-wrap: wrap; }
.region-form .ac-wrap { flex: 0 1 260px; }
.region-form .ac-wrap input, .region-form select { padding: 6px 10px; }

.v-list { overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 10px 8px; }
.v-list-head { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.v-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.v-list li a { display: block; aspect-ratio: 4 / 3; background: #dfe4ea; border: 3px solid transparent; border-radius: var(--radius-s); overflow: hidden; }
.v-list li.cur a { border-color: var(--gold); }
.v-list img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 1000px) {
  body.viewer { height: auto; overflow: auto; }
  .v3 { grid-template-columns: 1fr; height: auto; }
  .v-stage { order: -1; }
  .v-imgbox img { max-height: 70vh; }
  .v-list ul { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}

/* ---------- 사용법 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(19,36,59,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--panel); border-radius: 14px; width: min(660px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head .x { font-size: 22px; }
.modal-body { overflow-y: auto; padding: 4px 22px 14px; font-size: 14px; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.modal-foot label.check { margin: 0; font-size: 13px; color: var(--muted); }
.help-sec h3 { font-size: 15px; font-weight: 700; margin: 18px 0 6px; color: var(--accent-2); }
.help-sec ul, .help-sec ol { margin: 0; padding-left: 20px; }
.help-sec li { margin: 4px 0; line-height: 1.65; }
.help-sec code { background: var(--sunk); border: 1px solid var(--line); padding: 0 5px; border-radius: 4px; font-size: 13px; font-family: inherit; }
.kbd { display: inline-block; min-width: 22px; padding: 0 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: #fff; font-size: 12px; text-align: center; line-height: 1.6; }
.kbd-btn { display: inline-block; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 4px; background: #fff; font-size: 12.5px; line-height: 1.7; }
.help-page h2 { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }

/* =====================================================================
   관리자 모드
   ===================================================================== */
body.admin-mode { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--admin); color: #c8d3e0; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.admin-side .side-brand { display: block; color: #fff; font-weight: 800; font-size: 15.5px; letter-spacing: -0.03em; padding: 4px 10px 2px; }
.admin-side .side-mode { display: inline-block; margin: 0 10px 22px; font-size: 12px; color: var(--gold); font-weight: 600; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side .grp { font-size: 12px; color: #8195ad; padding: 16px 10px 6px; }
.admin-side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; color: #d6dfea; font-size: 14.5px; }
.admin-side nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.admin-side nav a.on { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.admin-side nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.admin-side .side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 2px; }
.admin-side .side-foot a, .admin-side .side-foot .linkbtn { padding: 8px 10px; border-radius: 7px; color: #b6c4d4; font-size: 14px; text-align: left; }
.admin-side .side-foot a:hover, .admin-side .side-foot .linkbtn:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.admin-side .side-user { padding: 8px 10px 4px; font-size: 13px; color: #8195ad; }
.admin-side .side-user b { color: #e7edf4; font-weight: 600; }
.admin-main { padding: 30px 36px 60px; max-width: 1360px; }
.admin-main .page-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.admin-main .page-title h1 { margin: 0; }

/* 관리자 첫 화면 */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 26px; }
.stats > div { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats dd small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.admin-cols .card { padding: 18px 20px; }
.admin-cols h2 { margin: 0 0 10px; font-size: 15px; }
.admin-cols ol, .admin-cols ul { margin: 0; padding-left: 20px; font-size: 14px; }
.admin-cols li { margin: 4px 0; }
.admin-cols .cnt { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 관리 화면 공통 */
nav.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 18px; flex-wrap: wrap; }
nav.tabs a { padding: 9px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
nav.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
nav.tabs a:hover { text-decoration: none; color: var(--ink); }
.log-filter input[type=date] { flex: 0 0 auto; min-width: 0; }
.log-filter input:not([type]) { flex: 0 1 180px; min-width: 120px; }
.log-filter label.check { margin: 0; }
.log-layout.has-side { display: grid; grid-template-columns: 1fr 290px; gap: 20px; align-items: start; }
.log-side .card { padding: 16px 18px; margin-bottom: 14px; }
.log-side h3 { margin: 0 0 8px; font-size: 14px; }
.log-side ol { margin: 0; padding-left: 20px; font-size: 13.5px; }
.log-side li { margin: 3px 0; }
.log-side .cnt { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.keep-form label { max-width: 360px; }
.inline-field { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.inline-field input { width: 110px; margin: 0; }
table.depts td.order button { padding: 2px 8px; font-size: 11px; }
table.depts form.rename { display: flex; gap: 6px; }
table.depts form.rename input { width: 180px; padding: 4px 9px; font-size: 14px; }
table.depts form.rename button { padding: 4px 10px; font-size: 13px; }
ul.orphans { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
ul.orphans li { padding: 3px 11px; background: var(--sunk); border: 1px solid var(--line); border-radius: 14px; font-size: 13px; }
/* 중복 사진 */
.stats.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stats.stats-3 dd { font-size: 20px; }
.dup-group { padding: 14px 16px; margin-bottom: 14px; }
.dup-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dup-head .sp { flex: 1; }
ul.dup-members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
ul.dup-members li { border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--panel); }
ul.dup-members li.keeper { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
ul.dup-members li.hid .thumb img { opacity: .45; }
.dup-info { padding: 8px 10px 10px; font-size: 13px; display: grid; gap: 4px; }
.dup-info label.check { margin: 0; font-weight: 600; }
.dup-path { word-break: break-all; color: var(--ink-2); }
.dup-info .tag { justify-self: start; }
.dup-more { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 120px; color: var(--muted); background: var(--sunk) !important; }
.dup-pagebar { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  padding: 10px 14px; margin: 0 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.dup-state { font-size: 13px; color: var(--muted); }
.dup-group.busy { opacity: .6; }
.dup-group.done .dup-members, .dup-group.ignored .dup-members { opacity: .45; }
.dup-group.busy { cursor: progress; }
.dup-group.done .dup-state { color: var(--ok); font-weight: 600; }
.dup-group.ignored .dup-state { color: var(--muted); font-weight: 600; }
.dup-group.failed .dup-state { color: var(--err); }
.dup-group.done .js-undo, .dup-group.ignored .js-undo { opacity: 1; }
.trash-grid .meta form { flex-basis: 100%; }
.trash-grid .meta button { margin-top: 4px; padding: 3px 10px; font-size: 12px; }

@media (max-width: 1180px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .stats, .stats.stats-3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-main { padding: 22px 16px 48px; }
  .log-layout.has-side { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; }
  .topbar nav { flex-wrap: wrap; }
  .who { display: none; }
  .card { padding: 18px; }
  .hero h1 { font-size: 34px; }
  ul.grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 비슷한 말 */
.syn-page { max-width: 880px; margin: 0 auto; }
.syn-page .lead-s { color: var(--ink-2); margin: 4px 0 18px; line-height: 1.6; }
.syn-add { background: var(--sunk); border-radius: var(--radius-s); padding: 14px 16px; margin-bottom: 18px; }
.syn-add label { display: block; margin-bottom: 8px; }
.syn-add .row { display: flex; gap: 8px; }
.syn-add .row input { flex: 1; min-width: 0; padding: 8px 11px; }
.syn-filter { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.syn-filter input { width: 240px; max-width: 60%; padding: 6px 10px; }
.syn-list { list-style: none; margin: 0; padding: 0; }
.syn-list > li { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 4px; border-top: 1px solid var(--line); }
.syn-list > li.hl { background: var(--accent-soft); border-radius: var(--radius-s); }
.syn-list .terms { display: flex; flex-wrap: wrap; gap: 6px; }
.syn-list .chip a { color: inherit; }
.syn-list .chip .x { background: none; border: 0; padding: 0 0 0 2px; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.syn-list .tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.syn-list .tools input { width: 130px; padding: 3px 8px; font-size: 13px; }
.syn-list .tools button.mini { margin-left: 2px; }
button.mini.danger { color: var(--err); }
a.chip.muted:hover { text-decoration: none; background: var(--accent-soft); color: var(--accent-2); }
.syn-link { font-size: 12px; margin-left: 6px; color: var(--muted); }
@media (max-width: 640px) { .syn-add .row { flex-direction: column; } }

/* 게시판 */
.nav-board { position: relative; }
.badge-n { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.notice-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: 900px; margin: 22px auto -6px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-s); box-shadow: var(--shadow); }
.notice-bar .nb-tag { background: var(--accent); color: #fff; border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.notice-bar .nb-title { font-weight: 600; color: var(--ink); }
.notice-bar .nb-date { color: var(--muted); font-size: 13px; }
.notice-bar .sp { flex: 1; }
.notice-bar .nb-close { padding: 4px 12px; font-size: 13px; }
.board-page { max-width: 960px; margin: 0 auto; }
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.board-head h1 { margin: 0 0 4px; }
.board-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.board-tabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.board-tabs a.on { color: var(--accent-2); border-bottom-color: var(--accent); font-weight: 700; }
.board-tabs a:hover { text-decoration: none; color: var(--accent-2); }
.board-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.board-filter input[name=q] { width: 200px; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-top: 1px solid var(--line); }
.post-list li.pinned { background: var(--sunk); }
.post-list .t { color: var(--ink); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-list .sp { flex: 1; }
.post-list .cc { color: var(--accent); font-size: 13px; font-weight: 700; }
.post-list .new { color: var(--err); font-size: 12px; font-weight: 700; }
.post-list .p-who, .post-list .p-when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.cat { flex: none; display: inline-block; min-width: 62px; text-align: center; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: var(--sunk); color: var(--ink-2); }
.cat-notice { background: var(--accent); color: #fff; }
.cat-request { background: #e7f1fb; color: #1d4f86; }
.cat-bug { background: var(--err-soft); color: var(--err); }
.st { flex: none; font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid currentColor; white-space: nowrap; }
.st-open { color: var(--warn); } .st-review { color: #1d4f86; } .st-done { color: var(--ok); } .st-hold { color: var(--muted); }
.pin { font-size: 11px; color: var(--accent-2); border: 1px solid var(--accent); border-radius: 3px; padding: 0 4px; margin-right: 6px; vertical-align: 2px; }
.crumb { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.post header h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.4; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-size: 13px; margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.post-body { line-height: 1.75; font-size: 15px; min-height: 80px; overflow-wrap: anywhere; }
.post-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 24px; }
.post-tools .status-form { margin-left: auto; }
.comments { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 14px; }
.comments h2 { font-size: 16px; }
.comments ul { list-style: none; margin: 0 0 14px; padding: 0; }
.comments li { padding: 10px 12px; border-radius: var(--radius-s); margin-bottom: 6px; background: var(--sunk); }
.comments li.staff { background: var(--accent-soft); }
.comments .c-meta { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.comments .staff-tag { font-size: 11px; color: var(--accent-2); border: 1px solid var(--accent); border-radius: 3px; padding: 0 4px; }
.comments .c-body { line-height: 1.6; overflow-wrap: anywhere; }
.linkbtn.small { font-size: 12px; margin-left: 6px; color: var(--muted); }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { flex: 1; }
.post-form .cat-pick { border: 0; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.post-form .cat-pick legend { font-weight: 600; margin-bottom: 6px; }
.post-form .fld { display: block; margin: 12px 0; font-weight: 600; }
.post-form .fld input, .post-form .fld textarea { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
.post-form .form-actions { display: flex; gap: 8px; margin-top: 16px; }
.pager { display: flex; gap: 14px; justify-content: center; margin-top: 16px; }
@media (max-width: 640px) {
  .post-list li { flex-wrap: wrap; }
  .post-list .t { white-space: normal; flex-basis: 100%; order: 2; }
  .comment-form { flex-direction: column; align-items: stretch; }
}
.comments .c-meta form.inline { display: inline; margin: 0; }
.notice-bar:not(.unread) { border-left-color: var(--line); box-shadow: none; }
.notice-bar:not(.unread) .nb-tag { background: var(--sunk); color: var(--ink-2); }
.notice-bar:not(.unread) .nb-title { font-weight: 500; }
.notice-bar .nb-also { font-size: 13px; color: var(--muted); }
.mgr-opts { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.mgr-opts select { margin: 0 4px; }
.notice-only[hidden] { display: none; }
