:root {
  --bg: #f7f3ec;
  --card: #ffffff;
  --ink: #2a2118;
  --muted: #7a6c5d;
  --line: #e6ddd0;
  --brand: #8a5a2b;
  --brand-ink: #ffffff;
  --gold: #d9a54c;
  --ok: #2f7a4d;
  --warn: #a8641b;
  --bad: #b0392f;
  --radius: 12px;
  --sans: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --serif: "Nanum Myeongjo", "AppleMyungjo", "Noto Serif KR", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.logo {
  font: 700 19px/1 var(--serif);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
}
.logo b { color: var(--brand); }
.topbar nav { display: flex; gap: 8px; align-items: center; }

.wrap { max-width: 980px; margin: 0 auto; padding: 32px 20px 64px; }
.narrow { max-width: 560px; }

h1, h2, h3, .lead { word-break: keep-all; overflow-wrap: anywhere; }
h1 { font: 700 30px/1.3 var(--serif); margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
.card > h2:first-child { margin-top: 0; }

.grid { display: grid; gap: 18px; }
@media (min-width: 820px) { .grid.two { grid-template-columns: 1fr 1fr; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 600 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #cbbba6; }
.btn:focus-visible, .input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #774a20; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; min-height: 50px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: default; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field > span em { color: var(--bad); font-style: normal; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.input, select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 16px var(--sans);
}
input[type=file].input { padding: 9px 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 180px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 6px 0 16px; }
.check input { margin-top: 4px; width: 18px; height: 18px; }

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
  background: #fbf3e4;
  border: 1px solid #efdcb8;
}
.notice.error { background: #fbeceb; border-color: #f0c9c5; color: var(--bad); }
.notice.ok { background: #eaf5ee; border-color: #c4e2cf; color: var(--ok); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  background: #f0ebe3;
  color: var(--muted);
}
.badge.pending { background: #fbf0dc; color: var(--warn); }
.badge.approved { background: #e3f2e8; color: var(--ok); }
.badge.suspended, .badge.rejected { background: #f8e4e2; color: var(--bad); }

.linkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed #cdb998;
  border-radius: 10px;
  background: #fffaf2;
  font: 15px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
.linkbox code { flex: 1; }
.qr { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
td .row { gap: 6px; flex-wrap: nowrap; }
.empty { color: var(--muted); padding: 14px 0; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  border-radius: 99px;
  background: #f3ede4;
  font-size: 14px;
}
.chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.chip button:hover { background: #e6ddd0; }

.stat { font: 700 28px/1.1 var(--sans); }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }

.hero {
  padding: 56px 0 24px;
  text-align: center;
}
.hero h1 { font-size: 40px; }
.hero .lead { font-size: 18px; max-width: 560px; margin: 0 auto 28px; }
.hero .row { justify-content: center; }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 36px; }
.features .card { margin: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #2a2118;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 20;
}

.section-title { margin: 30px 0 12px; font: 700 22px/1.3 var(--serif); }
.stack { margin-top: 14px; }
.list-item { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow-wrap: anywhere; }
.list-item .row { flex-wrap: nowrap; gap: 6px; }

.chat-admin { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.chat-admin:empty { display: none; }
.chat-line { display: flex; gap: 8px; align-items: baseline; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.chat-line:last-child { border-bottom: 0; }
.chat-line b { white-space: nowrap; }
