/* 약 먹었나 — 밝고 말랑한 톤. 파란 캡슐 캐릭터 하나가 주인공. */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --ink: #1d2433;
  --ink-2: #4a5468;
  --muted: #8a93a6;
  --line: #e3e8f0;
  --blue: #5b8cff;
  --blue-deep: #3f6fe8;
  --blue-soft: #e6eeff;
  --green: #1fb57a;
  --green-soft: #dcf6ea;
  --pink: #ff7a8a;
  --red: #e5484d;
  --r: 22px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  line-height: 1.5; word-break: keep-all; -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.app { max-width: 460px; margin: 0 auto; padding: 10px 20px 40px; min-height: 100vh; display: flex; flex-direction: column; }
.loading { color: var(--muted); text-align: center; margin-top: 40vh; }

/* 머리 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.top h1 { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -0.03em; }
.settings-btn, .back-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px 0 13px;
  border: 0; border-radius: 999px; background: var(--surface); font-weight: 700; font-size: 15px;
  box-shadow: 0 1px 2px rgba(29,36,51,.06), inset 0 0 0 1px var(--line);
}
.settings-btn:active, .back-btn:active { transform: scale(.97); }
.back-btn { padding: 0 16px 0 10px; }

/* 알림 켜기 안내 */
.notice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left;
  border: 0; border-radius: 18px; padding: 14px 18px; margin: 6px 0 0;
  background: var(--blue-soft); color: var(--blue-deep);
}
.notice b { font-size: 16px; }
.notice span { font-size: 14px; color: var(--ink-2); }

/* 캐릭터 */
.pill-art { display: block; overflow: visible; }
@media (prefers-reduced-motion: no-preference) {
  .pill-art--wait .pill-body { animation: bob 2.6s ease-in-out infinite; transform-origin: 100px 100px; }
  .pill-art--happy .pill-body { animation: hop .6s cubic-bezier(.3,1.6,.5,1) both; transform-origin: 100px 140px; }
  @keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
  @keyframes hop { 0% { transform: scale(.85) translateY(10px) } 100% { transform: none } }
}
.art-center { display: flex; justify-content: center; margin: 12px 0 0; }

/* 묶음 하나: 큰 화면 */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px 0 8px; min-height: 56vh; }
.headline { margin: 14px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.3; }
.headline b { color: var(--green); }
.hero .sub { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.big-btn {
  margin-top: 26px; width: 100%; max-width: 320px; height: 68px; border: 0; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  box-shadow: 0 10px 24px rgba(91,140,255,.35), inset 0 -3px 0 rgba(0,0,0,.12);
  transition: transform .1s ease;
}
.big-btn:active { transform: scale(.97); }
.meal { margin: 14px 0 0; display: inline-block; padding: 8px 14px; border-radius: 999px; background: #fff4d6; color: #8a5a00; font-weight: 700; font-size: 15px; }
.meal--ok { background: var(--green-soft); color: #0e7a50; }
.undo { margin-top: 12px; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; padding: 8px 12px; }

/* 묶음 여러 개 */
.multi-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 4px; }
.multi-hero .headline { font-size: 22px; margin-top: 6px; }
.cards { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 8px; }
.card { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--r); padding: 16px 16px 16px 20px; box-shadow: 0 1px 2px rgba(29,36,51,.05), inset 0 0 0 1px var(--line); }
.card.is-next { box-shadow: 0 6px 18px rgba(91,140,255,.18), inset 0 0 0 2px var(--blue); }
.card.is-done { background: #fbfefd; }
.card .body { flex: 1; min-width: 0; }
.card .name { margin: 0; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.card .time { font-weight: 600; color: var(--muted); font-size: 15px; margin-left: 4px; }
.card .sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.card .meal { margin-top: 8px; font-size: 13px; padding: 5px 11px; }
.card .undo { padding: 4px 0; margin: 4px 0 0; font-size: 13px; }
.small-btn { flex: none; height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 800; font-size: 16px; box-shadow: 0 4px 12px rgba(91,140,255,.3); }
.small-btn:active { transform: scale(.96); }
.done-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--green-soft); color: #0e7a50; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.wait-chip { flex: none; height: 40px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--bg); color: var(--muted); font-weight: 700; }

/* 30일 기록 */
.history { margin-top: auto; padding-top: 26px; }
.history-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.history h2 { font-size: 16px; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.streak { font-size: 13px; font-weight: 800; color: #0e7a50; background: var(--green-soft); padding: 4px 10px; border-radius: 999px; }
.days { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; background: var(--surface); padding: 12px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.d { aspect-ratio: 1; border-radius: 9px; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.d b { font-size: 11px; font-weight: 600; color: #b3bac8; font-variant-numeric: tabular-nums; }
.d--full { background: var(--green); }
.d--full b { color: #fff; }
.d--part { background: #9fe0c4; }
.d--part b { color: #0e7a50; }
.d--today { box-shadow: inset 0 0 0 2px var(--ink); }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 12px; margin: 8px 4px 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.legend .full { background: var(--green); } .legend .part { background: #9fe0c4; }

/* 안내·설정 공통 */
.page h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.035em; margin: 16px 0 8px; }
.page p { color: var(--ink-2); margin: 0 0 12px; }
.steps { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: 18px; padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--line); }
.steps .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.steps .t { font-size: 16px; }
.steps svg { flex: none; margin-left: auto; }
.primary { width: 100%; height: 60px; border-radius: 999px; border: 0; background: var(--blue); color: #fff; font-weight: 800; font-size: 19px; margin-top: 12px; box-shadow: 0 8px 20px rgba(91,140,255,.3); }
.primary:disabled { opacity: .5; }
.secondary { width: 100%; height: 52px; border-radius: 999px; border: 0; background: var(--blue-soft); color: var(--blue-deep); font-weight: 800; font-size: 16px; margin-top: 10px; }
.link { border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 12px; font-size: 14px; display: block; margin: 8px auto 0; }
.danger { color: var(--red); }
.note { font-size: 13px; color: var(--muted); }

.field { display: block; margin: 0 0 14px; min-width: 0; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input {
  display: block; width: 100%; min-width: 0; height: 50px; border-radius: 14px; border: 0;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); padding: 0 14px; font-size: 17px;
  -webkit-appearance: none; appearance: none;
}
.field input[type=time] { text-align: left; }
.field input::-webkit-date-and-time-value { text-align: left; }
.field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.time-big { font-size: 34px !important; height: 72px !important; font-weight: 800; text-align: center !important; background: var(--surface) !important; }
.time-big::-webkit-date-and-time-value { text-align: center !important; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.slot-edit { background: var(--surface); border-radius: var(--r); padding: 16px 16px 4px; margin: 0 0 12px; box-shadow: inset 0 0 0 1px var(--line); }
.slot-edit .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.slot-edit .head b { font-size: 15px; font-weight: 800; }
.slot-edit .head button { border: 0; background: none; color: var(--red); font-size: 14px; font-weight: 700; padding: 6px; }

.section { margin: 26px 0 0; }
.section h3 { font-size: 17px; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.02em; }
.status { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--green); }
.coupang { margin-top: 36px; font-size: 13px; color: var(--muted); text-align: center; }
.coupang a { color: var(--ink-2); }
.foot { margin-top: 28px; text-align: center; font-size: 12px; color: var(--muted); }
.foot a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; }
