:root {
  --bg: #FBF6F7;
  --surface: #FFFFFF;
  --accent: #B9475F;
  --accent-wash: #F6E4E8;
  --line: #F1E6E9;
  --text: #3E3437;
  --text-muted: #9C9497;
  --pill-dark: #2E2A2B;
  --serif: 'Nanum Myeongjo', 'Noto Serif KR', serif;
  --sans: Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

.boot {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- 로그인 ---------- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.login-inner { width: 100%; max-width: 380px; }
.login-lead {
  color: var(--text-muted);
  font-size: 12.5px;
  margin: 6px 0 22px;
}
.login-card { padding: 18px; }
.login-note {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.7;
  margin: 14px 0 0;
}
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
  margin: 14px 0;
}
.or::before, .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.form-msg {
  min-height: 16px;
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 11.5px;
  line-height: 1.5;
}

/* ---------- 셸 ---------- */
.shell {
  max-width: 608px;
  margin: 0 auto;
  padding: 0 16px 108px;
}
.top { padding: 20px 0 6px; }
.top-date {
  margin: 0 0 2px;
  color: var(--text-muted);
  font-size: 11.5px;
}
.h1 {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}
.h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 22px 0 8px;
}
.h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 3px;
  color: var(--text);
}
.note {
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.65;
  margin: 0 0 10px;
}
.muted { color: var(--text-muted); }

.notice {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--accent-wash);
  border-radius: 8px;
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.55;
}
.notice-btn {
  flex: none;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}

/* ---------- 카드 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin: 0 0 10px;
}
.card.tight { padding: 12px 14px; }
.card.click { cursor: pointer; }
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 8px;
}
.sec-head .h3 { margin: 0; }

/* ---------- 버튼·입력 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { opacity: .93; }
.btn.block { width: 100%; min-height: 36px; }
.btn.ghost { background: var(--surface); color: var(--accent); }
.btn.soft { background: var(--accent-wash); border-color: var(--accent-wash); color: var(--accent); }
.btn-plain {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px 2px;
}
.btn-close {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 8px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  cursor: pointer;
}
.btn-danger {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 8px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  cursor: pointer;
}
.field { margin-bottom: 12px; }
.field-label {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 4px;
}
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  padding: 8px 10px;
  line-height: 1.55;
}
.textarea { min-height: 74px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.inline-fields { display: flex; gap: 8px; }
.inline-fields > * { flex: 1; min-width: 0; }

.range { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }

/* ---------- 탭 · 필터 ---------- */
.tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin: 12px 0 14px;
}
.tab {
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 13.5px;
  padding: 6px 0 9px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  cursor: pointer;
}
.pill.on {
  background: var(--pill-dark);
  border-color: var(--pill-dark);
  color: #fff;
}
.segment {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}
.segment button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 11px;
  padding: 4px 9px;
  cursor: pointer;
}
.segment button.on { border-color: var(--accent); color: var(--accent); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--accent-wash);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10.5px;
  line-height: 1.6;
  margin: 2px 4px 2px 0;
}
.chip.gray {
  background: #F7F5F5;
  color: var(--text-muted);
}
.chip.line {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-muted);
}

/* ---------- 홈 ---------- */
.quick { display: grid; gap: 8px; margin-top: 12px; }
.quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--accent-wash);
  border: 1px solid #F3DDE2;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
}
.quick-row .btn { min-height: 30px; }

.todo-list { padding: 4px 0; }
.todo {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.todo:last-child { border-bottom: 0; }
.check {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  border: 1px solid #E3D3D7;
  border-radius: 5px;
  background: var(--surface);
  color: transparent;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.check.on {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--accent);
}
.todo-main {
  flex: 1;
  border: 0;
  background: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
}
.todo.done .todo-title {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(185, 71, 95, .55);
  text-decoration-thickness: 1px;
}
.todo-title { display: block; }
.todo-detail { display: block; color: var(--text-muted); font-size: 11px; line-height: 1.55; margin-top: 2px; }
.todo-cat { flex: none; }

/* ---------- 룩 ---------- */
.look-card { display: flex; gap: 12px; cursor: pointer; }
.look-thumb {
  flex: none;
  width: 64px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: #F7F1F2;
  border: 1px solid var(--line);
}
.look-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.look-body { flex: 1; min-width: 0; }
.look-date { font-size: 12.5px; font-weight: 600; }
.look-situation { color: var(--text-muted); font-size: 11.5px; margin: 2px 0 4px; line-height: 1.5; }
.look-line { font-size: 11.5px; color: var(--text); margin: 1px 0; line-height: 1.55; }
.look-review {
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.6;
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stars { color: var(--accent); font-size: 12px; letter-spacing: 1px; flex: none; }

/* ---------- 일기 ---------- */
.diary-card { cursor: pointer; }
.diary-date { font-size: 12.5px; font-weight: 600; }
.diary-status { color: var(--text-muted); font-size: 11.5px; flex: none; }
.diary-line { font-size: 11.5px; margin: 3px 0 0; color: var(--text); }
.diary-memo {
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.65;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}
.used-box {
  background: #FCF3F5;
  border-radius: 8px;
  padding: 7px 9px;
  margin-top: 9px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--accent);
}
.used-box b { font-weight: 600; }

/* ---------- 달력 ---------- */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
}
.cal-head strong { font-size: 13px; }
.cal-nav {
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 18px;
  padding: 0 8px;
  cursor: pointer;
}
.cal-weekdays, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  padding-bottom: 4px;
}
.cal-cell {
  position: relative;
  min-height: 56px;
  border-radius: 7px;
  padding: 4px 3px;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  line-height: 1.35;
}
.cal-cell.empty { cursor: default; }
.cal-cell.num { color: var(--text); }
.cal-cell.has-record { background: var(--accent-wash); }
.cal-cell.today { border-color: var(--accent); }
.cal-cell .cal-emoji { display: block; font-size: 12px; }
.cal-cell .cal-dots { font-size: 9px; letter-spacing: 1px; color: var(--accent); }
.cal-cell .cal-period {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin: 2px 4px 0;
}
.cal-cell .cal-label { display: block; font-size: 9.5px; color: var(--accent); }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 12px;
  color: var(--text-muted);
  font-size: 10.5px;
}
.legend i { color: var(--accent); font-style: normal; }

/* ---------- 제품 ---------- */
.product-card { cursor: pointer; }
.product-name { font-size: 13px; font-weight: 600; }
.product-brand { color: var(--text-muted); font-size: 11px; flex: none; }
.product-since { color: var(--text-muted); font-size: 11px; margin: 2px 0 0; }
.product-memo { font-size: 11.5px; line-height: 1.6; margin: 4px 0 0; }
.product-ing { color: var(--text-muted); font-size: 11px; line-height: 1.6; margin: 4px 0 0; }

/* ---------- 시술 ---------- */
.care-group { padding: 0; overflow: hidden; }
.care-head {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 13px 14px;
  cursor: pointer;
  color: var(--text);
}
.care-title { font-size: 13px; font-weight: 700; }
.care-sub { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.care-rows { border-top: 1px solid var(--line); }
.care-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--text);
  font-size: 11.5px;
}
.care-row:last-child { border-bottom: 0; }
.care-row .care-memo {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.55;
  margin-top: 3px;
  white-space: pre-wrap;
}
.care-money { color: var(--text-muted); }
.care-round { font-weight: 600; margin-right: 6px; }

/* ---------- 몸 ---------- */
.plan-row {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.plan-row:last-child { border-bottom: 0; }
.plan-date { flex: none; width: 54px; color: var(--text-muted); font-size: 11px; padding-top: 2px; }
.plan-body { flex: 1; min-width: 0; }
.plan-title { font-size: 12.5px; font-weight: 700; }
.plan-line { font-size: 11.5px; line-height: 1.6; margin: 1px 0 0; overflow-wrap: anywhere; }
.plan-side { flex: none; }
.done-label { color: var(--accent); font-size: 11px; white-space: nowrap; }
.workout-card .w-title { font-size: 12.5px; font-weight: 700; }
.workout-card .w-meta { color: var(--text-muted); font-size: 11px; }
.workout-card .w-detail { font-size: 11.5px; line-height: 1.6; margin: 3px 0 0; }
.meal-date { font-size: 12.5px; font-weight: 700; margin: 14px 0 6px; }
.meal-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.meal-row:last-child { border-bottom: 0; }
.meal-slot {
  flex: none;
  width: 34px;
  color: var(--accent);
  font-size: 11px;
  padding-top: 1px;
}
.meal-body { flex: 1; min-width: 0; }
.meal-menu { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.meal-nutri { color: var(--text-muted); font-size: 10.5px; line-height: 1.55; margin-top: 2px; }
.meal-note { color: var(--text-muted); font-size: 10.5px; line-height: 1.5; }
.meal-thumb {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 7px;
  border: 1px dashed #E6D7DB;
  background: #FCF7F8;
  color: var(--text-muted);
  font-size: 9.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.meal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.profile-form { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 8px; align-items: end; }
.profile-form .btn { min-height: 34px; }
.profile-line { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.6; }
.check-card .check-title { font-size: 13px; font-weight: 700; }
.check-card .check-sub { color: var(--text-muted); font-size: 11px; }
.check-lines { margin: 8px 0 0; padding: 0; list-style: none; }
.check-lines li {
  font-size: 11.5px;
  line-height: 1.6;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
}
.check-lines li:last-child { border-bottom: 0; }
.check-memo { color: var(--text-muted); font-size: 11px; margin-top: 6px; }

/* ---------- 옷장 ---------- */
.wardrobe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wardrobe-item { padding: 10px 11px; margin: 0; }
.wardrobe-name { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.wardrobe-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}
.wardrobe-count { color: var(--text-muted); font-size: 10.5px; }
.cat-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 10px;
  padding: 1px 7px;
  cursor: pointer;
}

/* ---------- 스타일링 ---------- */
.record-card { cursor: pointer; }
.record-title { font-size: 13px; font-weight: 600; }
.record-meta { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.record-memo { white-space: pre-wrap; font-size: 11.5px; line-height: 1.65; margin: 5px 0 0; }
.standard-card .std-title { font-family: var(--serif); font-size: 16px; color: var(--accent); }
.standard-card .std-sub { color: var(--text-muted); font-size: 11px; margin-bottom: 6px; }
.standard-card .std-summary { font-size: 12px; line-height: 1.6; margin: 0 0 10px; }
.std-section { margin-bottom: 10px; }
.std-section h4 { font-size: 11px; color: var(--text-muted); font-weight: 600; margin: 0 0 3px; }
.std-section ul { margin: 0; padding: 0; list-style: none; }
.std-section li { font-size: 11.5px; line-height: 1.65; }

/* ---------- 하단 내비 ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
.bottom-inner {
  max-width: 608px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 6px 8px;
}
.nav-item {
  flex: 1;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 8px 0;
  border-radius: 999px;
  cursor: pointer;
}
.nav-item.on { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.nav-home { flex: 0 0 64px; }
.home-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: var(--surface);
}
.nav-home.on .home-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- 모달 ---------- */
#modal-root { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 42, 43, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sheet {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
}
.sheet h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.sheet-body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.sheet-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sheet-actions .btn { min-height: 34px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 6px; }
.choice {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  cursor: pointer;
}
.choice.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.star-choice { letter-spacing: 2px; font-size: 15px; }
.star-choice .on { color: var(--accent); }
.counter { display: inline-flex; align-items: center; gap: 8px; }
.counter button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
}
.counter span { min-width: 18px; text-align: center; font-size: 12.5px; }
.readonly-box {
  background: #FCF3F5;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--accent);
  line-height: 1.6;
}
.photo-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.photo-tile {
  position: relative;
  width: 62px;
  height: 76px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #F7F1F2;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(46,42,43,.6);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.photo-add {
  width: 62px;
  height: 76px;
  border: 1px dashed #E3D3D7;
  border-radius: 7px;
  background: #FCF7F8;
  color: var(--text-muted);
  font-size: 10.5px;
  cursor: pointer;
}
.dl { margin: 0; }
.dl div { display: flex; gap: 8px; padding: 3px 0; font-size: 11.5px; }
.dl dt { flex: none; width: 54px; color: var(--text-muted); }
.dl dd { margin: 0; flex: 1; line-height: 1.6; }
.review-para { font-size: 12px; line-height: 1.7; margin: 0 0 7px; }
.sub-h3 { font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.empty-state {
  color: var(--text-muted);
  font-size: 11.5px;
  text-align: center;
  padding: 18px 0;
}
.data-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 4px;
}
.data-tools button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
}

/* ---------- 좁은 화면 ---------- */
@media (max-width: 480px) {
  .sheet-backdrop { padding: 0; }
  .sheet {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
  .wardrobe-grid { grid-template-columns: 1fr 1fr; }
  .profile-form { grid-template-columns: 1fr 1fr; }
  .profile-form .field:last-of-type { grid-column: 1 / -1; }
}

@media (min-width: 700px) {
  .shell { padding-top: 8px; }
}
