:root {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #f1e9da;
  --ink: #2a2118;
  --ink-2: #6b5d4d;
  --line: #e2d6c1;
  --accent: #d9771c;
  --accent-ink: #fff;
  --gold: #c99a2e;
  --danger: #c0392b;
  --ok: #2e8b57;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 40, 10, 0.06), 0 6px 20px rgba(60, 40, 10, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17130f;
    --surface: #211b15;
    --surface-2: #2b241c;
    --ink: #f1e8da;
    --ink-2: #b3a48f;
    --line: #3a3127;
    --accent: #f08c2e;
    --gold: #e0b44a;
    --danger: #ef6b5b;
    --ok: #5cc28a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard', 'Noto Sans KR', system-ui, -apple-system, 'Malgun Gothic', sans-serif;
  line-height: 1.55;
  font-size: 15px;
}
a { color: var(--accent); }

/* 헤더 */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.site-header .inner {
  max-width: 1120px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.logo { font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--surface-2); color: var(--accent); }
.visitors { margin-left: auto; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.visitors b { color: var(--ink); font-variant-numeric: tabular-nums; }

main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
.sub { color: var(--ink-2); margin: 0 0 20px; }

/* 레이아웃 */
.grid-2 { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
.card + .card { margin-top: 16px; }

/* 폼 */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 6px; margin: 0 0 12px; }
legend { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 4px; }
.hint { font-size: 12px; color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn.secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.block { width: 100%; }

/* 결과 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.stat .v { font-size: 20px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; word-break: keep-all; }
.stat .v small { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.stat.hero { background: var(--accent); color: #fff; }
.stat.hero .k, .stat.hero .v small { color: rgba(255,255,255,.85); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { color: var(--ink-2); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
th:first-child, td:first-child { text-align: left; }
td input, td select { padding: 5px 7px; font-size: 13px; min-width: 70px; }

/* 신청서 아이템 목록: 열 너비 고정 (기타 입력칸이 열리면서 옆 칸을 밀지 않게) */
.item-table { table-layout: fixed; min-width: 680px; }
.item-table th:nth-child(2), .item-table td:nth-child(2) { width: 88px; }
.item-table th:nth-child(3), .item-table td:nth-child(3) { width: 112px; }
.item-table th:nth-child(4), .item-table td:nth-child(4),
.item-table th:nth-child(5), .item-table td:nth-child(5) { width: 100px; }
.item-table th:nth-child(6), .item-table td:nth-child(6) { width: 64px; }
.item-table td { vertical-align: middle; }
.item-table td input, .item-table td select { width: 100%; min-width: 0; }
.i-etc-wrap { display: flex; gap: 4px; }
.i-etc-wrap .i-etc { flex: 1; }
.i-etc-back {
  flex: 0 0 30px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink-2); cursor: pointer; font: inherit;
}
.i-etc-back:hover { color: var(--accent); }

.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 56px; gap: 8px; align-items: center; font-size: 13px; }
.bar { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gold); border-radius: 4px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.badge.warn { background: #f7e1b5; color: #7a4b00; }
@media (prefers-color-scheme: dark) { .badge.warn { background: #4a3510; color: #f2c46b; } }
.notice { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.notice b { color: var(--ink); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--accent); border-color: var(--accent); }
.hidden { display: none !important; }

/* 메인 */
.hero-main { padding: 40px 0 28px; }
.hero-main h1 { font-size: 34px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { display: block; text-decoration: none; color: inherit; transition: transform .15s; }
.feature:hover { transform: translateY(-2px); border-color: var(--accent); }
.feature .icon { font-size: 28px; }
.feature h2 { margin: 8px 0 4px; }
.feature p { margin: 0; color: var(--ink-2); font-size: 14px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 100; }
.site-footer { text-align: center; color: var(--ink-2); font-size: 12px; padding: 24px 16px; border-top: 1px solid var(--line); }
.site-footer a { color: var(--ink-2); }
.site-footer .maker { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.site-footer .maker a { color: var(--accent); text-decoration: none; }
.site-footer .maker a:hover { text-decoration: underline; }
.status { font-weight: 700; }
.status-접수 { color: var(--accent); }
.status-진행중 { color: var(--gold); }
.status-완료 { color: var(--ok); }
.status-취소 { color: var(--ink-2); }
