:root {
  --ink: #1b1d21;
  --muted: #6b7078;
  --line: #dfe2e7;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --accent: #2456d6;
  --warn: #b45309;
  --warn-bg: #fff4e0;
  --bad: #b42318;
  --ok: #067647;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.inline { display: inline-flex; gap: 12px; align-items: center; margin: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 16px 24px 64px; }

.banner {
  padding: 10px 24px; background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid #f3d9a4; font-weight: 600;
}

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 16px;
}
.card { margin-top: 12px; padding: 12px; background: var(--bg); border-radius: 8px; }
.row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field.wide { width: 100%; }
.field input, .field select { font-size: 14px; color: var(--ink); }
.check { display: inline-flex; gap: 6px; align-items: center; }
.radios { display: flex; gap: 16px; margin: 8px 0; }
.hint { color: var(--muted); margin: 4px 0 8px; }

input[type="text"], input[type="url"], input[type="date"], input[type="search"], select {
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  min-width: 0;
}
input.wide, .field.wide input { width: 100%; }
button {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; cursor: pointer; font: inherit;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button:disabled { opacity: 0.5; cursor: default; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }

.pagelist {
  max-height: 220px; overflow: auto; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px;
}
.pagelist label { display: flex; gap: 8px; padding: 3px 0; }

.msg { min-height: 20px; margin: 0 0 12px; color: var(--muted); }
.msg.error { color: var(--bad); font-weight: 600; }

table.grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.grid th, table.grid td {
  padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle;
}
table.grid th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.grid col, table.grid th:nth-child(1) { width: 36px; }
table.grid th:nth-child(2) { width: 64px; }
table.grid th:nth-child(3) { width: 84px; }
table.grid th:nth-child(4) { width: 22%; }
table.grid th:nth-child(6) { width: 140px; }
table.grid th:nth-child(7) { width: 140px; }
table.grid th:nth-child(8) { width: 72px; }
table.grid td.name { overflow-wrap: anywhere; }
.thumb { width: 56px; height: 40px; object-fit: contain; background: var(--bg); border-radius: 4px; display: block; }
.thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.path input { width: 100%; margin-bottom: 4px; }
.path .filename { font-size: 12px; color: var(--muted); }
.notes { display: block; font-size: 12px; color: var(--warn); }
tr.group td { background: var(--bg); font-weight: 600; }
tr.group input { margin-left: 8px; width: 260px; font-weight: 400; }
tr.unchecked td { color: var(--muted); }

.status { font-weight: 600; }
.status.OK, .status.dup { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.exists { color: var(--muted); }
.status.failed { color: var(--bad); }

.footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

dialog { border: 1px solid var(--line); border-radius: 10px; padding: 20px; max-width: 520px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.3); }
.confirm-text { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
#confirm-overwrites { max-height: 200px; overflow: auto; font-size: 13px; color: var(--warn); }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

progress { width: 100%; height: 14px; }
.folders { margin: 12px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.folders a { color: var(--accent); }

/* 내비게이션·설정·기록 */
.nav { display: flex; gap: 16px; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 2px; }
.nav a.current { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tab.current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
table.plain { table-layout: auto; }
table.plain th:nth-child(n) { width: auto; }
table.plain td input[type="text"] { width: 100%; }
textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; min-width: 220px; }
.field.wide-ish { min-width: 320px; flex: 1; }
.rules { list-style: none; margin: 12px 0; padding: 0; }
.rules li { display: flex; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 6px; background: #fff; }
.rules li.off { opacity: 0.55; }
.rules li.dragging { opacity: 0.4; }
.rules .rule-main { flex: 1; min-width: 0; }
.rules .rule-sub { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.rules .handle { cursor: grab; color: var(--muted); }
.cond-row { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.cond-row input[type="text"] { flex: 1; min-width: 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chips button { padding: 2px 8px; font-size: 12px; border-radius: 12px; }
.impact { margin-top: 12px; padding: 10px; background: var(--bg); border-radius: 8px; font-size: 13px; }
.impact ul { margin: 6px 0 0; padding-left: 18px; }
.impact .before { color: var(--muted); }
.impact .after { color: var(--ok); }
.row .check { align-self: center; }
