/* 색상은 여기 변수만 바꾸면 전체 분위기가 바뀐다. */
:root {
  --theme-main: #f48fb1;
  --theme-accent: #ec407a;
  --theme-bg: #fff0f5;
  --theme-card: #ffffffee;
  --theme-text: #4a2c3a;
  --theme-muted: #a58595;
  --theme-ok: #43a047;
  --theme-warn: #c62828;
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--theme-text);
  font-family: system-ui, -apple-system, "Noto Sans KR", sans-serif;
  background-color: var(--theme-bg);
  /* 기본 패턴: 연한 점무늬. 사용자가 bg 이미지를 넣으면 아래 .has-bg 가 덮어쓴다. */
  background-image: radial-gradient(var(--theme-main) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  background-attachment: fixed;
}
body.has-bg {
  background-image: var(--theme-bg-image);
  background-size: cover;
  background-position: center;
}
header.top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--theme-main); color: #fff;
}
header.top h1 { flex: 1; margin: 0; font-size: 20px; display: flex; align-items: center; gap: 8px; }
header.top img { height: 32px; }
header.top button { background: #ffffff33; color: #fff; border: 0; border-radius: 12px; padding: 8px 12px; font-size: 14px; }
main { padding: 14px 14px calc(92px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.card { background: var(--theme-card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: 0 2px 8px #ec407a22; }
.card h2 { margin: 0 0 10px; font-size: 17px; }
.muted { color: var(--theme-muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.big-btn {
  width: 100%; min-height: 76px; font-size: 26px; font-weight: 700; color: #fff;
  background: var(--theme-accent); border: 0; border-radius: 24px; box-shadow: 0 4px 0 #ad1457;
}
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #ad1457; }
.big-btn.stop { background: #5c6bc0; box-shadow: 0 4px 0 #3949ab; }
.big-btn:disabled { background: #d9c3cd; box-shadow: none; color: #fff; }
.btn { min-height: 44px; padding: 0 16px; font-size: 16px; font-weight: 600; border: 0; border-radius: 14px; color: #fff; background: var(--theme-accent); }
.btn.ghost { background: transparent; color: var(--theme-accent); border: 2px solid var(--theme-main); }
.btn.ok { background: var(--theme-ok); }
.btn.warn { background: var(--theme-warn); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .45; }
.timer { text-align: center; font-size: 52px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 6px 0 14px; letter-spacing: 1px; }
.center { text-align: center; }
.big-num { font-size: 40px; font-weight: 800; color: var(--theme-accent); }
.bar { height: 16px; border-radius: 99px; background: #f8dbe6; overflow: hidden; margin: 10px 0 6px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--theme-main), var(--theme-accent)); border-radius: 99px; transition: width .4s; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #eee; color: #555; }
.chip.requested { background: #fff3cd; color: #8a6d00; }
.chip.approved { background: #d7f0dc; color: #1b6a2a; }
.chip.rejected, .chip.cancelled, .chip.abandoned { background: #eee; color: #777; }
.chip.done { background: #d6e4ff; color: #274c9e; }
.chip.active { background: #ffe0ec; color: var(--theme-accent); }
.dest.dim { opacity: .5; }
.dest .name { font-weight: 700; font-size: 17px; }
.dest .km { font-weight: 800; color: var(--theme-accent); }
.dest .btn { margin-top: 10px; width: 100%; }
a { color: var(--theme-accent); }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff;
  border-top: 2px solid var(--theme-main); padding-bottom: env(safe-area-inset-bottom);
}
.nav button { flex: 1; min-height: 62px; border: 0; background: none; font-size: 14px; color: var(--theme-muted); font-weight: 600; }
.nav button .ic { display: block; font-size: 22px; }
.nav button.on { color: var(--theme-accent); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 12px; color: var(--theme-muted); padding-bottom: 4px; }
.cal .day { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 13px; position: relative; background: #fff5f8; }
.cal .day.today { outline: 2px solid var(--theme-accent); }
.cal .day.empty { background: none; }
.cal .day svg, .cal .day img { position: absolute; inset: 14% ; width: 72%; height: 72%; object-fit: contain; }
.cal .day span { position: relative; z-index: 1; align-self: start; justify-self: start; margin: 3px 0 0 5px; font-size: 11px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.month-nav b { font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats b { display: block; font-size: 18px; }
.rec { border-top: 1px solid #f3dbe5; padding: 10px 0; }
.rec:first-child { border-top: 0; }
form.f { display: grid; gap: 8px; }
form.f[hidden] { display: none; }
form.f input[type=password], form.f input[type=text], form.f input[type=number], form.f input[type=date], form.f input[type=url] {
  font-size: 16px; padding: 10px 12px; border: 2px solid var(--theme-main); border-radius: 12px; width: 100%;
}
form.f label.chk { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #333d; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; z-index: 30; max-width: 86vw; text-align: center;
}
.deco { display: flex; justify-content: center; gap: 8px; margin: -4px 0 10px; }
.deco svg { width: 22px; height: 22px; }
/* 도장 애니메이션 */
.overlay {
  position: fixed; inset: 0; z-index: 20; background: #4a2c3acc; display: grid; place-items: center; text-align: center; color: #fff; padding: 24px;
}
.overlay .stampbox { width: min(60vw, 240px); height: min(60vw, 240px); margin: 0 auto 14px; }
.overlay .stampbox img, .overlay .stampbox svg { width: 100%; height: 100%; object-fit: contain; animation: slam .7s cubic-bezier(.2, .9, .3, 1) both; }
.overlay h2 { margin: 6px 0; font-size: 26px; }
.overlay p { margin: 4px 0; font-size: 18px; }
@keyframes slam {
  0% { transform: translateY(-120vh) rotate(-12deg) scale(1.6); opacity: 0; }
  55% { transform: translateY(0) rotate(-6deg) scale(1); opacity: 1; }
  70% { transform: translateY(-18px) rotate(-6deg) scale(1.04); }
  85% { transform: translateY(0) rotate(-6deg) scale(.98); }
  100% { transform: translateY(0) rotate(-6deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .overlay .stampbox img, .overlay .stampbox svg { animation: none; } }

.card.event { background: linear-gradient(135deg, #ffe082, #ffb74d); color: #5d3b00; text-align: center; font-size: 17px; }
.card.event b { font-size: 19px; }
.receipt { background: #fffdf5; border: 2px dashed var(--theme-main); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.receipt.settled { background: #f3f7ff; border-color: #9db7f0; }
.receipt-name { font-size: 20px; font-weight: 800; margin: 6px 0 2px; }
@media (max-width: 400px) { .nav button { font-size: 12px; } }
.cal .day.stamped { cursor: pointer; }
.buff { cursor: pointer; }
.buff-tip { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--theme-main); line-height: 1.6; }
.buff-tip[hidden] { display: none; }
.banner { margin-bottom: 14px; }
.banner-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide { flex: 0 0 100%; scroll-snap-align: center; margin-bottom: 0; min-height: 92px; display: flex; flex-direction: column; justify-content: center; }
.banner-dots { display: flex; justify-content: center; gap: 7px; width: fit-content; margin: 8px auto 0; padding: 5px 10px; border-radius: 99px; background: #fffffff0; box-shadow: 0 1px 4px #0002; }
.banner-dots i { width: 8px; height: 8px; border-radius: 50%; background: #c8c8c8; }
.banner-dots i.on { background: #5c6bc0; }
.banner-total { text-align: center; font-weight: 800; margin-top: 6px; }
.card.promo { background: linear-gradient(135deg, #d1c4e9, #b39ddb); color: #311b92; text-align: center; font-size: 16px; cursor: pointer; }
.card.promo b { font-size: 18px; }
.banner .buff-tip { background: var(--theme-card); border-radius: var(--radius); padding: 14px; margin-top: 10px; }
