:root {
  --bg: #faf7f3;
  --card: #ffffff;
  --ink: #2b2521;
  --muted: #8a7f74;
  --brand: #a9703f;
  --brand-dark: #7d5330;
  --accent: #e7c9a6;
  --ok: #3a8f5a;
  --warn: #c0503a;
  --border: #ece3d8;
  --radius: 16px;
  --shadow: 0 2px 14px rgba(43, 37, 33, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Pretendard", -apple-system, "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

.wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 20px 18px 90px;
}

.wrap.wide {
  max-width: 920px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.top .brand {
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: -0.01em;
}

header.top .who {
  font-size: 13px;
  color: var(--muted);
}

h1 { font-size: 22px; margin: 4px 0 6px; }
h2 { font-size: 17px; margin: 24px 0 10px; color: var(--brand-dark); }
p.sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }

input[type="text"], input[type="password"], input[type="date"], textarea, select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fffdfb;
  color: var(--ink);
  font-family: inherit;
}

textarea { resize: vertical; min-height: 90px; }

input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--accent);
  border-radius: 10px;
  background: #fffaf3;
  font-size: 14px;
}

button, .btn {
  display: inline-block;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  text-align: center;
  text-decoration: none;
}

button:hover, .btn:hover { background: var(--brand-dark); }
button:disabled { background: #cbbfae; cursor: not-allowed; }

.btn.secondary {
  background: transparent;
  color: var(--brand-dark);
  border: 1.5px solid var(--accent);
}
.btn.secondary:hover { background: #fdf4e8; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.msg {
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 10px;
}
.msg.error { background: #fbe9e6; color: var(--warn); }
.msg.ok { background: #e9f5ec; color: var(--ok); }

.linkline { text-align: center; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.linkline a { color: var(--brand-dark); font-weight: 600; text-decoration: none; }

nav.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  max-width: 460px;
  margin: 0 auto;
}
nav.bottom a {
  flex: 1;
  text-align: center;
  padding: 11px 0 9px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
}
nav.bottom a.active { color: var(--brand-dark); font-weight: 700; }
nav.bottom .ic { display: block; font-size: 18px; margin-bottom: 2px; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: #e9f5ec; color: var(--ok); }
.badge.bad { background: #fbe9e6; color: var(--warn); }

.progress {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--brand);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th, table td { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: left; }
table th { color: var(--muted); font-weight: 600; font-size: 12.5px; }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-num { width: 28px; text-align: center; font-weight: 700; color: var(--brand-dark); }
.rank-row.me { background: #fdf4e8; margin: 0 -18px; padding: 11px 18px; border-radius: 10px; }
.rank-name { flex: 1; font-weight: 600; }
.rank-count { color: var(--muted); font-size: 13px; }

.sub-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.sub-item:last-child { border-bottom: none; }
.sub-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #eee; flex-shrink: 0; }
.sub-item .meta { flex: 1; }
.sub-item .date { font-size: 12px; color: var(--muted); }
.sub-item .content { font-size: 14px; margin-top: 3px; white-space: pre-wrap; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input { flex: 1; min-width: 120px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal-backdrop img { max-width: 100%; max-height: 80vh; border-radius: 10px; }

.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }

.notice {
  background: #fdf4e8;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.notice .label { font-size: 12px; color: var(--brand-dark); font-weight: 700; margin-bottom: 4px; }
.notice .content { font-size: 14.5px; white-space: pre-wrap; }
