:root {
  --green: #86b995;
  --green-dark: #568568;
  --green-soft: #edf7ef;
  --mint: #dcefdc;
  --cream: #fbfdf8;
  --pink-soft: #fff0f3;
  --peach: #ffe8d8;
  --ink: #2e3730;
  --muted: #7c887f;
  --line: #e1e9e2;
  --white: #fff;
  --shadow: 0 12px 35px rgba(75, 90, 72, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(circle at 10% 0%, #e4f4e4 0 24%, transparent 44%), #edf2ed;
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
.hidden { display: none !important; }
.app {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: auto;
  background: var(--cream);
  padding: max(18px, env(safe-area-inset-top)) 20px 108px;
  box-shadow: 0 0 50px rgba(75,55,60,.08);
}
.topbar, .section-title, .month-nav, .dialog-head, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar { margin: 8px 0 18px; }
.topbar h1 { margin: 3px 0 0; font-size: 1.45rem; }
.eyebrow { color: var(--green-dark); font-size: .73rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.avatar {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 17px;
  background: var(--green);
  color: white;
  font-size: .8rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(89,133,103,.22);
}
.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 20px;
  border-radius: 28px;
  color: white;
  background: linear-gradient(135deg, #74aa84, #b7d9a2);
  box-shadow: var(--shadow);
}
.hero-card p { margin: 0 0 8px; opacity: .9; font-size: .8rem; font-weight: 800; }
.hero-card strong { display: block; font-size: 1.15rem; line-height: 1.35; }
.hero-add {
  flex: 0 0 auto;
  border: 0;
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(255,255,255,.24);
  color: white;
  font-weight: 900;
}
.toolbar { align-items: stretch; margin: 12px 0 16px; flex-direction: column; }
.profile-toggle, .filter-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
  padding: 5px;
  border-radius: 16px;
  background: #f2eceb;
}
.profile-toggle button, .filter-row button {
  border: 0;
  border-radius: 12px;
  padding: 9px 8px;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 900;
}
.profile-toggle button.active, .filter-row button.active {
  background: white;
  color: var(--green-dark);
  box-shadow: 0 3px 10px rgba(65,40,46,.08);
}
.view { display: none; animation: appear .18s ease-out; }
.view.active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.calendar-card, .note-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
}
.month-nav { margin-bottom: 14px; }
.month-nav b { font-size: 1.05rem; }
.icon-button, .text-button, .close-button {
  border: 0;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 900;
}
.icon-button { width: 38px; height: 38px; border-radius: 13px; font-size: 1.4rem; }
.text-button { padding: 8px 12px; border-radius: 12px; font-size: .82rem; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.weekdays { margin-bottom: 6px; color: var(--muted); font-size: .72rem; text-align: center; font-weight: 800; }
.day {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 7px 6px;
  text-align: left;
}
.day.outside { opacity: .38; }
.day.today { border-color: var(--green); background: var(--green-soft); }
.day.selected { outline: 3px solid rgba(134,185,149,.28); border-color: var(--green-dark); }
.day-number { display: block; font-weight: 900; font-size: .82rem; }
.dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--green); }
.section-title { margin: 24px 0 12px; }
.section-title h2 { margin: 0; font-size: 1.05rem; }
.event-list { display: grid; gap: 10px; }
.event-list.roomy { margin-top: 4px; }
.event-card {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 12px;
  align-items: stretch;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: white;
}
.event-bar { border-radius: 99px; background: var(--green); }
.event-card b { display: block; margin-bottom: 4px; font-size: .95rem; }
.event-card small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.event-person {
  align-self: start;
  border-radius: 99px;
  padding: 6px 9px;
  color: white;
  color: var(--green-dark);
  font-size: .72rem;
  font-weight: 900;
}
.welcome-dialog { text-align: center; }
.welcome-content { padding: 30px 24px 26px; }
.welcome-content h2 { margin: 10px 0 8px; font-size: 1.35rem; }
.welcome-content p { margin: 0 0 22px; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.user-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.user-choice { border: 0; border-radius: 18px; padding: 18px 12px; color: white; font-size: 1.1rem; font-weight: 900; }
.user-choice-kkoong { background: #e59ab0; }
.user-choice-poo { background: #86b995; }
.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.6);
}
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bottom-nav button {
  border: 0;
  border-radius: 16px;
  padding: 12px 6px;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}
.bottom-nav button.active { background: var(--green-soft); color: var(--green-dark); }
.floating-add {
  position: fixed;
  left: calc(50% + 174px);
  bottom: 86px;
  width: 58px;
  height: 58px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 20px;
  background: var(--green);
  color: white;
  font-size: 1.8rem;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(89,133,103,.28);
}
dialog {
  width: min(calc(100% - 28px), 450px);
  max-height: 88dvh;
  border: 0;
  border-radius: 30px;
  padding: 0;
  background: white;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
dialog::backdrop { background: rgba(33,36,32,.45); backdrop-filter: blur(3px); }
#eventForm { padding: 24px; overflow: auto; max-height: inherit; }
.dialog-head h2 { margin: 4px 0 0; font-size: 1.35rem; }
.close-button { width: 42px; height: 42px; border-radius: 15px; font-size: 1.4rem; }
label { display: block; margin: 13px 0; text-align: left; color: var(--muted); font-size: .82rem; font-weight: 800; }
input, select, textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  color: var(--ink);
  outline: none;
}
textarea { resize: vertical; min-height: 92px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.all-day-row { margin-top: 3px; }
.check-label { display: flex; align-items: center; gap: 9px; margin: 0; }
.check-label input { width: auto; margin: 0; }
.primary, .danger {
  width: 100%;
  border: 0;
  border-radius: 15px;
  padding: 15px 18px;
  font-weight: 900;
}
.primary { background: var(--green); color: white; box-shadow: 0 8px 18px rgba(89,133,103,.22); }
.danger { margin-top: 10px; background: #fff0f1; color: #c85168; }
#toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 99px;
  background: #2f3a32;
  color: white;
  font-size: .82rem;
  font-weight: 800;
  transition: .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 520px) {
  .app { padding-inline: 14px; }
  .day { min-height: 56px; padding: 6px 4px; }
  .field-grid { grid-template-columns: 1fr; }
  input, select, textarea { min-width: 0; }
  .floating-add { left: auto; right: 18px; transform: none; }
}
