:root {
  --bg: #FFF6EC;
  --card: #FFFFFF;
  --ink: #3B2F26;
  --sub: #8A7666;
  --line: #F0E2D2;
  --main: #E8894A;
  --main-d: #C46A2E;
  --soft: #FDEBDD;
  --hot: #E5534B;
  --hot-soft: #FDE4E1;
  --ok: #2FA36F;
  --new: #FFF3C4;
  --new-line: #F2C94C;
  --r: 18px;
  --head: 'Jua', 'Gowun Dodum', system-ui, sans-serif;
  --body: 'Gowun Dodum', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; margin: 0; }

#app {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom));
}
main { display: flex; flex-direction: column; gap: 14px; }

/* 사람 고르기 */
.pick { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 24px 0; }
.pick h1 { font-size: 40px; }
.pick p { color: var(--sub); margin: 6px 0 28px; }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pick-btn {
  font-family: var(--head);
  font-size: 30px;
  padding: 26px 0;
  border-radius: 24px;
  background: var(--c);
  color: #fff;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .18);
  transition: transform .08s;
}
.pick-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.pick-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pick-btn.on { outline: 4px solid var(--ink); outline-offset: 3px; }

.login p small { font-size: 15px; }
.login-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.push-card { background: #E9F3FF; box-shadow: 0 2px 0 #C9DDF5; }
.push-card h2 { font-size: 22px; margin-bottom: 4px; }
.push-card p { margin: 0 0 10px; }
.panel > .link { align-self: center; margin-top: 4px; }

/* 머리 */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 0 12px;
  position: sticky; top: 0; z-index: 5; background: var(--bg);
}
.top .date { color: var(--sub); font-size: 15px; }
.top h1 { font-size: 30px; line-height: 1.1; }
.me-chip {
  font-family: var(--head); font-size: 20px; color: #fff; background: var(--c);
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 4px 0 rgba(0, 0, 0, .15);
}

/* 아래 메뉴 */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; gap: 10px; justify-content: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 246, 236, .96); border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.nav-btn {
  flex: 1; max-width: 290px; font-family: var(--head); font-size: 22px;
  padding: 12px 0; border-radius: 16px; color: var(--sub); position: relative;
}
.nav-btn.on { background: var(--main); color: #fff; box-shadow: 0 4px 0 var(--main-d); }
.badge {
  display: inline-block; min-width: 22px; height: 22px; line-height: 22px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: var(--hot); color: #fff; font: 700 13px/22px system-ui, sans-serif;
  vertical-align: 3px;
}

/* 카드 */
.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: 0 2px 0 var(--line); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sec-head h2 { font-size: 22px; }
.empty { color: var(--sub); margin: 6px 0; text-align: center; padding: 10px 0; }
.hint { color: var(--sub); font-size: 15px; margin: 4px 0 10px; }
.meta { color: var(--sub); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.who {
  display: inline-block; font-family: var(--head); font-size: 14px; color: #fff; background: var(--c);
  padding: 1px 9px; border-radius: 999px;
}
.dim { color: var(--sub); font-weight: 400; }
.ok { color: var(--ok); font-size: 15px; }
.miss { color: var(--hot); font-size: 15px; }

/* 버튼 */
.btn {
  font-family: var(--head); font-size: 19px; background: var(--main); color: #fff;
  padding: 10px 18px; border-radius: 14px; box-shadow: 0 4px 0 var(--main-d);
  transition: transform .08s; white-space: nowrap; word-break: keep-all;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--main-d); }
.btn.small { font-size: 17px; padding: 7px 14px; border-radius: 12px; box-shadow: 0 3px 0 var(--main-d); }
.btn.big { font-size: 22px; padding: 14px 18px; border-radius: 16px; }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--soft); color: var(--main-d); box-shadow: 0 4px 0 #F2D2B8; }
.link { color: var(--main-d); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px; }
.link.more { display: block; margin: 8px auto 0; }

/* 공지 */
.notice-card { background: #FFF9D9; box-shadow: 0 2px 0 #F2E2A0; }
.notice { padding: 10px 0; border-top: 1px dashed #EBD98C; }
.notice:first-of-type { border-top: 0; padding-top: 0; }
.notice p { margin: 0 0 6px; font-size: 19px; white-space: pre-wrap; }
.notice .link { margin-left: auto; }

/* 요청 */
.wish {
  border: 2px solid var(--line); border-radius: 16px; padding: 12px; margin-top: 10px; background: #fff;
}
.wish:first-of-type { margin-top: 0; }
.wish.new { background: var(--new); border-color: var(--new-line); }
.wish-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kind { font-family: var(--head); font-size: 15px; padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--main-d); }
.kind.k-delivery { background: #E3F0FF; color: #2F6FC4; }
.kind.k-outing { background: #E4F6EC; color: #1F8556; }
.new-tag { font-family: var(--head); font-size: 15px; color: #fff; background: var(--hot); padding: 2px 10px; border-radius: 999px; }
.when { font-family: var(--head); font-size: 15px; color: var(--ink); }
.wish-text { font-family: var(--head); font-size: 23px; margin: 6px 0 4px; }
.wish-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.wish-actions .link { margin-left: auto; }
.like {
  font-family: var(--head); font-size: 17px; padding: 6px 14px; border-radius: 999px;
  background: #FFF0F4; color: #C9406E; border: 2px solid #F7C6D6;
}
.like.on { background: #EC6F9C; color: #fff; border-color: #EC6F9C; }
.likers { color: var(--sub); font-size: 14px; }

/* 식단 칸 */
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; min-width: 0;
  border-radius: 14px; background: var(--soft); padding: 10px; min-height: 96px;
}
.slot.none { background: #F7F1EA; }
.slot strong { font-size: 17px; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; max-width: 100%; }
.slot-name { font-family: var(--head); font-size: 16px; color: var(--sub); }
.type { font-family: var(--head); font-size: 14px; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--main); }
.type.t-배달 { background: #4A8FE8; }
.type.t-외식 { background: #2FA36F; }

/* 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 17px; padding: 8px 14px; border-radius: 999px; background: #fff;
  border: 2px solid var(--line);
}
.chip small { color: var(--sub); font-size: 13px; }
.chip.on { background: var(--soft); border-color: var(--main); color: var(--main-d); }
.chip.hot { border-color: var(--hot); background: var(--hot-soft); }

/* 부엌 작은 탭 */
.subtabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  scrollbar-width: none; position: sticky; top: 76px; z-index: 4; background: var(--bg);
}
.subtabs::-webkit-scrollbar { display: none; }
.subtab {
  flex: none; font-family: var(--head); font-size: 18px; padding: 8px 14px; border-radius: 999px;
  background: #fff; color: var(--sub); border: 2px solid var(--line);
}
.subtab.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 냉장고 */
.places { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #F4E6D7; padding: 5px; border-radius: 16px; }
.place { font-family: var(--head); font-size: 18px; padding: 10px 4px; border-radius: 12px; color: var(--sub); }
.place small { display: block; font-family: var(--body); font-size: 13px; }
.place.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--line); }
.items { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 2px 0 var(--line);
}
.item.hot { background: var(--hot-soft); }
.item-name { font-family: var(--head); font-size: 21px; }
.hot-tag { font-family: var(--head); font-size: 14px; color: #fff; background: var(--hot); padding: 1px 8px; border-radius: 999px; }
.search { display: flex; align-items: center; gap: 8px; }
.search input { flex: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search .link { display: none; }
.search.has .link { display: inline; }
#fridgeBody { display: flex; flex-direction: column; gap: 14px; }
.where-tag { font-family: var(--head); font-size: 16px; color: #fff; background: #4A8FE8; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.spot-tag { font-size: 14px; color: #2F6FC4; background: #E3F0FF; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.spot-tag.unknown { color: var(--sub); background: #F1ECE6; }
.group h3 { font-size: 18px; color: var(--sub); margin: 6px 2px 8px; }
.group h3 small { font-family: var(--body); font-size: 14px; }
.hot-group h3 { color: var(--hot); }
.age { margin-left: auto; color: var(--sub); font-size: 15px; white-space: nowrap; }
.age.warn { color: var(--hot); font-weight: 700; }

/* 요리 */
.rec, .plan {
  display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line);
}
.rec:first-of-type, .plan:first-of-type { border-top: 0; }
.sec-head + .hint + .rec { border-top: 0; }
.rec-main, .plan-main { flex: 1; min-width: 0; }
.rec strong, .plan strong { font-family: var(--head); font-weight: 400; font-size: 21px; }
.uses { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.uses span { font-size: 14px; background: #F5EFE8; padding: 1px 8px; border-radius: 999px; }
.uses span.old { background: var(--hot-soft); color: var(--hot); }
.plan-btns { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* 식단 */
.days { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; display: flex; flex-direction: column; align-items: center; min-width: 66px;
  padding: 8px 10px; border-radius: 14px; background: #fff; border: 2px solid var(--line);
}
.day span { font-family: var(--head); font-size: 16px; }
.day small { color: var(--main); font-size: 10px; letter-spacing: 1px; }
.day.on { border-color: var(--main); background: var(--soft); }
.day-title { font-size: 22px; margin: 4px 0 -4px; }
.meal-list { display: flex; flex-direction: column; gap: 10px; }
.meal {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; flex-wrap: wrap;
  background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 2px 0 var(--line);
}
.meal .slot-name { font-size: 19px; color: var(--ink); width: 44px; }
.meal strong { font-size: 19px; flex: 1; }
.meal.none { background: #FBF6F0; }

/* 요청 화면 */
.sub-title { font-size: 19px; color: var(--sub); margin-top: 8px; }
.past { background: #fff; border-radius: 12px; padding: 10px 12px; color: var(--sub); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* 장보기 */
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; }
input, textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: #fff; font-size: 18px; outline: none;
}
input:focus, textarea:focus { border-color: var(--main); }
textarea { resize: vertical; }
.quick summary { cursor: pointer; color: var(--main-d); font-family: var(--head); font-size: 18px; padding: 4px 0 8px; }
.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 2px 0 var(--line); }
.shop-main { flex: 1; min-width: 0; }
.shop strong { font-family: var(--head); font-weight: 400; font-size: 21px; }
.check { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 3px solid var(--main); background: #fff; }
.check:active { background: var(--soft); }

/* 아래 창 */
.sheet { position: fixed; inset: 0; z-index: 20; display: none; }
.sheet.on { display: block; }
.backdrop { position: absolute; inset: 0; background: rgba(59, 47, 38, .4); }
.panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 620px;
  max-height: 88vh; overflow-y: auto; background: var(--bg);
  border-radius: 24px 24px 0 0; padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
.panel.enter { animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.panel h2 { font-size: 26px; padding-right: 60px; }
.panel h3 { font-size: 18px; color: var(--sub); margin-top: 4px; }
.panel .hint { margin: -4px 0 0; }
.x { position: absolute; top: 18px; right: 16px; color: var(--sub); font-size: 15px; padding: 6px 10px; border-radius: 10px; background: #F4E6D7; }
.tgs { display: flex; gap: 6px; }
.tgs.wrap { flex-wrap: wrap; }
.tg {
  flex: 1; min-width: 0; font-family: var(--head); font-size: 18px; padding: 10px 12px; border-radius: 14px;
  background: #fff; border: 2px solid var(--line); white-space: normal; word-break: keep-all; line-height: 1.25;
}
.tgs.wrap .tg { flex: none; }
.tg.on { background: var(--main); border-color: var(--main); color: #fff; }
.tg[style*="--c"].on { background: var(--c); border-color: var(--c); }
.wide-tg { width: 100%; padding: 14px; }
.tg.on.hot { background: var(--hot); border-color: var(--hot); }
.date-in { width: auto; flex: none; padding: 8px 10px; font-size: 16px; }
.sheet-btns { display: flex; flex-wrap: wrap; gap: 10px 8px; margin-top: 6px; }
.sheet-btns .btn { flex: 1 1 140px; white-space: normal; }
.sheet-btns.col { flex-direction: column; }
.buy-note { margin: 0; padding: 10px 12px; background: var(--hot-soft); border-radius: 12px; }
.buy-note.ok { background: #E4F6EC; color: var(--ok); }

/* 빨래 */
.laundry { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-top: 10px; }
main > .laundry:first-of-type, .card .laundry:first-of-type { margin-top: 0; }
.laundry.new { background: var(--new); border-color: var(--new-line); }
.laundry.alarm { border-color: var(--hot); background: var(--hot-soft); }
.l-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.l-kind { font-family: var(--head); font-weight: 400; font-size: 22px; }
.st { font-family: var(--head); font-size: 15px; padding: 2px 10px; border-radius: 999px; color: #fff; background: #9A8A7C; }
.st-requested { background: var(--hot); }
.st-planned { background: #B08A5A; }
.st-confirmed { background: #E0A030; }
.st-washing { background: #4A8FE8; }
.st-drying { background: #9573DB; }
.st-done { background: var(--ok); }
.l-line { margin: 6px 0 0; font-size: 17px; }
.l-line.late { color: var(--hot); font-weight: 700; }
.l-note { margin: 4px 0 0; color: var(--sub); }
.l-timer { margin: 8px 0 0; font-family: var(--head); font-size: 20px; color: #2F6FC4; }
.l-timer.ring { color: var(--hot); }
.l-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.l-actions .link { margin-left: auto; }
.laundry .meta { margin-top: 6px; }
.hint.center { text-align: center; margin-top: 14px; }

/* 마음 */
.faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.face {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 14px;
  background: #FBF6F0; border: 2px solid transparent; position: relative;
}
.face-emoji { font-size: 34px; line-height: 1.1; min-height: 38px; color: var(--sub); }
.face-name { font-family: var(--head); font-size: 16px; color: var(--c); }
.face-want { font-size: 11px; color: #fff; background: #EC6F9C; border-radius: 999px; padding: 0 6px; white-space: nowrap; }
.mood { background: #fff; border-radius: 18px; padding: 14px; box-shadow: 0 2px 0 var(--line); border-left: 6px solid var(--c); }
.mood.pass, .mood.empty-mood { background: #FBF6F0; }
.mood-head { display: flex; align-items: center; gap: 8px; }
.mood-head .link { margin-left: auto; }
.mood-body { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.mood-emoji { font-size: 52px; line-height: 1; }
.mood-feel { font-family: var(--head); font-weight: 400; font-size: 24px; }
.mood-line { margin: 2px 0 0; font-size: 18px; white-space: pre-wrap; }
.want { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: #FFF0F4; color: #B3365F; }
.replies { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.reply { background: #F7F1EA; border-radius: 12px; padding: 6px 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mood-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mood-actions .grow { flex: 1; }
.like:disabled { opacity: .7; }
.empty-mood .btn { margin-top: 10px; }
.empty-mood .dim, .pass .dim { margin: 6px 0 0; }
.feel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.feel {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px; border-radius: 16px;
  background: #fff; border: 2px solid var(--line); font-family: var(--head); font-size: 15px;
}
.feel-emoji { font-size: 36px; line-height: 1.1; }
.feel.on { border-color: var(--main); background: var(--soft); }

/* 알림 글 */
/* 화면 위쪽에 띄워서 키보드가 올라와도 가리지 않게 */
.toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); z-index: 30;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 18px; font-size: 16px;
  transition: .2s; white-space: normal; max-width: calc(100vw - 32px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  body { font-size: 18px; }
  .top h1 { font-size: 34px; }
}
