/* ============================================================
   집비서(zipbiseo) 공통 스타일
   - 본문 기본 16px, 네이비·골드 팔레트 (simil 샘플과 동일 계열)
   ============================================================ */
:root {
	--fg: #222a38;
	--muted: #5a6474;
	--line: #e3e8f0;
	--bg: #f5f6f8;
	--card: #fff;
	--navy: #1b2a4a;
	--gold: #c9a227;
	--blue: #2b4a8b;
}
* { box-sizing: border-box; }
body {
	margin: 0;
	font-family: "Malgun Gothic", "맑은 고딕", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	color: var(--fg);
	background: var(--bg);
	line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* ── 상단 바 ── */
header.top {
	background: var(--navy);
	color: #fff;
	padding: 0 20px;
	display: flex;
	align-items: center;
	gap: 26px;
	height: 56px;
}
header.top .brand { color: #fff; font-size: 18px; font-weight: 700; white-space: nowrap; }
header.top .brand small { color: var(--gold); font-size: 12px; font-weight: 600; margin-left: 6px; }
header.top nav { display: flex; gap: 18px; flex-wrap: wrap; }
header.top nav a { color: #cadcfc; font-size: 15px; }
header.top nav a.active, header.top nav a:hover { color: #fff; text-decoration: none; }
header.top .top-user { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 14px; }
header.top .top-user .muted { color: #9fb2d8; }
header.top .top-user .logout { color: #cadcfc; font-size: 14px; }

/* ── 레이아웃 ── */
.wrap { max-width: 1240px; margin: 24px auto; padding: 0 20px; min-height: calc(100vh - 170px); }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 0 0 12px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

/* ── 카드/패널 ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 16px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.card .k { font-size: 13px; color: var(--muted); }
.card .v { font-size: 26px; font-weight: 700; margin-top: 4px; }
.card .v small { font-size: 14px; color: var(--muted); font-weight: 400; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin: 18px 0; }

/* ── 버튼/폼 공통 ── */
.btn {
	background: var(--navy);
	color: #fff;
	border: none;
	padding: 12px 18px;
	border-radius: 8px;
	font-size: 16px;
	cursor: pointer;
}
.btn:hover { background: #24365e; }

/* ── 로그인 ── */
.auth-wrap { display: flex; justify-content: center; padding: 60px 0 30px; }
.auth-box {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 36px 32px;
	width: 100%;
	max-width: 420px;
	box-shadow: 0 4px 18px rgba(27, 42, 74, .08);
}
.auth-title { font-size: 24px; margin: 0 0 6px; text-align: center; }
.auth-sub { color: var(--muted); font-size: 14px; text-align: center; margin: 0 0 22px; }
.auth-err {
	background: #fff0f0;
	border: 1px solid #ffc9c9;
	color: #c92a2a;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
}
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input[type=email], .auth-form input[type=password] {
	font-size: 16px;
	padding: 13px 12px;
	border: 1px solid var(--line);
	border-radius: 8px;
}
.auth-submit { margin-top: 6px; font-weight: 700; }
.auth-foot { text-align: center; font-size: 13px; margin: 18px 0 0; }

/* ── 푸터 ── */
footer.foot { text-align: center; padding: 18px 0 26px; font-size: 13px; }

/* ── 환경설정 폼 ── */
.tbl { width: 100%; border-collapse: collapse; background: var(--card); font-size: 15px; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { background: #eef0f3; font-size: 13px; color: #4b5563; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-form select { font-size: 15px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 180px; }
.col-form { display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.col-form label { font-size: 14px; font-weight: 600; margin-top: 10px; }
.col-form input[type=text], .col-form textarea { font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; }
.col-form textarea { resize: vertical; }
.col-form .btn { margin-top: 14px; align-self: flex-start; }
.btn-sm { background: #eef0f3; color: #444; border: 1px solid var(--line); padding: 5px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.btn-sm:hover { background: #e2e6ec; }
.key-ok { color: #0f9d58; font-size: 13px; font-weight: 600; margin-left: 6px; }

/* ── 콘텐츠 상태 뱃지 ── */
.st { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-review { background: #fff3bf; color: #a67c00; }
.st-ok { background: #e6f7ed; color: #0f9d58; }
.st-video { background: #e3fafc; color: #0c8599; }
.st-rej { background: #ffe3e3; color: #c92a2a; }
.st-etc { background: #eee; color: #555; }
.pager { display: flex; gap: 6px; margin: 18px 0; flex-wrap: wrap; }
.pager a, .pager .cur { padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; }
.pager .cur { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── 콘텐츠 보기·수정 (좌: AI 원문 / 우: 최종본) ── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 980px) { .split { grid-template-columns: minmax(0, 1fr); } }
.split-pane { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; min-width: 0; }
.pane-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.pane-body { white-space: pre-wrap; line-height: 1.7; font-size: 15px; overflow: auto; }
.ai-body { color: #4b5563; height: 560px; }
.edit-title { font-size: 16px; font-weight: 600; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; font-family: inherit; }
.edit-body { flex: 1; min-height: 500px; font-size: 15px; line-height: 1.7; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; resize: vertical; }

/* ── 콘텐츠 보기·수정 헤더/버튼/참조 (변환기사 편집기 스타일) ── */
.cv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.cv-title { font-size: 21px; font-weight: 700; margin-right: 8px; }
.cv-meta { font-size: 13px; margin-left: 8px; }
.pane-badge { background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 6px; }
.pane-badge-edit { background: #0f7a3d; }
.fld-label { font-size: 14px; font-weight: 600; margin: 12px 0 6px; display: block; }
.cv-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.btn-dark { background: #343f52; }
.btn-primary { background: #0f7a3d; }
.btn-danger { background: #c92a2a; }
.ai-body { height: 480px; }
.src-box { border-top: 1px solid var(--line); margin-top: 4px; }
.src-list { list-style: none; margin: 6px 0 0; padding: 0; }
.src-list li { display: flex; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.src-list li:last-child { border-bottom: none; }
.src-list li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-list li > span:not(.st):not(.muted) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 카드뉴스 템플릿 선택 칩 ── */
.tpl-pick { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; }
.tpl-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid var(--line);
	border-radius: 20px;
	padding: 7px 14px;
	font-size: 14px;
	background: #fff;
	cursor: pointer;
	user-select: none;
}
.tpl-chip:has(input:checked) { border-color: var(--navy); background: #eef2fa; font-weight: 600; }
.tpl-chip input { margin: 0; }
.tpl-chip .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.15); }

/* ── 영상 배경 사진 리스트 ── */
.media-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.media-item {
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 10px;
	background: #fff;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: center;
	width: 132px;
}
.media-item img { max-height: 140px; max-width: 110px; border-radius: 6px; border: 1px solid var(--line); background: #f2f3f5; }
