:root {
  --bg: #f4f5f2;
  --card: #ffffff;
  --ink: #1b1f1c;
  --sub: #5d655f;
  --line: #e2e5e0;
  --brand: #14532d;
  --brand-2: #1f7a45;
  --warn-bg: #fff6e0;
  --warn: #8a5a00;
  --miss-bg: #fdecec;
  --miss: #a12727;
  --tap: 48px;
  --r: 14px;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }

.top { position: sticky; top: 0; z-index: 5; background: var(--brand); color: #fff; padding: calc(8px + env(safe-area-inset-top)) 14px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.top h1 { font-size: 19px; margin: 0; letter-spacing: -0.3px; }
.chip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 6px 14px; min-height: 36px; font-weight: 600; }
.date-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.date-row .nav { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255,255,255,.14); font-size: 26px; line-height: 1; }
.date-row .date { flex: 1; height: 44px; border: 0; border-radius: 12px; background: rgba(255,255,255,.08); font-size: 18px; font-weight: 700; }
.date-row .today { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.5); background: transparent; font-weight: 600; }
.top.search-mode .date-row { display: none; }

main { padding: 12px 12px 24px; max-width: 720px; margin: 0 auto; }
.summary { color: var(--sub); font-size: 14px; margin: 4px 4px 10px; }
.event-head { font-size: 13px; color: var(--sub); margin: 16px 4px 6px; display: flex; gap: 8px; align-items: baseline; }
.event-head b { color: var(--ink); font-size: 14px; }
.empty { text-align: center; color: var(--sub); padding: 48px 12px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

.card { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); margin-bottom: 10px; overflow: hidden; }
.card-head { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; background: none; border: 0; padding: 12px 14px; min-height: 64px; }
.num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.card.miss .num { background: var(--miss); }
.card.guess .num { background: #b7791f; }
.head-main { flex: 1; min-width: 0; }
.name { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; overflow-wrap: anywhere; }
.meta { font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { flex: none; color: var(--sub); transition: transform .15s; }
.card.open .chev { transform: rotate(90deg); }
.card-body { display: none; padding: 0 14px 14px; border-top: 1px solid var(--line); }
.card.open .card-body { display: block; }

.notice { margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.miss { background: var(--miss-bg); color: var(--miss); }
.notice .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.btn { min-height: var(--tap); padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--ink); font-size: 15px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.call { background: #e8f5ec; border-color: #b9dfc6; color: var(--brand); flex: 1 1 100%; font-size: 17px; }
.btn.map { flex: 1 1 40%; white-space: nowrap; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn.grow { flex: 1; }

dl.info { margin: 10px 0 0; }
dl.info div { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
dl.info div:last-child { border-bottom: 0; }
dl.info dt { color: var(--sub); font-size: 14px; }
dl.info dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.secret { display: inline-flex; align-items: center; gap: 8px; }
.secret .mask { letter-spacing: 2px; color: var(--sub); }
.foot { font-size: 12px; color: var(--sub); margin-top: 10px; }

.search-box { position: sticky; top: 64px; z-index: 4; background: var(--bg); padding: 4px 0 10px; }
.search-box input { width: 100%; height: 52px; border-radius: 14px; border: 1px solid var(--line); padding: 0 16px; font-size: 17px; background: #fff; }
.search-box .hint { font-size: 13px; color: var(--sub); margin: 6px 4px 0; display: flex; justify-content: space-between; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; height: 60px; border: 0; background: none; font-weight: 700; color: var(--sub); font-size: 15px; }
.tabs button.on { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }

.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow: auto; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.sheet-body h2 { font-size: 18px; margin: 0 0 12px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; color: var(--sub); margin-bottom: 4px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; }
.field textarea { min-height: 72px; resize: vertical; }
.sheet-actions { display: flex; gap: 8px; position: sticky; bottom: -16px; background: #fff; padding: 10px 0 0; }
.pick-list { list-style: none; margin: 8px 0 0; padding: 0; }
.pick-list button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 12px 4px; min-height: var(--tap); }
.pick-list small { color: var(--sub); display: block; }

.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 999px; z-index: 30; font-size: 14px; max-width: 90vw; }
.loading { text-align: center; color: var(--sub); padding: 40px; }
.offline { background: #333; color: #fff; text-align: center; font-size: 13px; padding: 6px; }
