:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --text: #1a1a1a;
  --muted: #888888;
  --line: #eeeeee;
  --primary: #2D8B4E;
  --primary-soft: #f0faf4;
  --accent: #e65100;
  --ok: #3c7a4d;
  --warn: #a4641a;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);

  /* ── 반응형 폰트 스케일 (clamp: 최소, vw비율, 최대) ── */
  --fs-xs:   clamp(10px, 2.8vw, 11px);
  --fs-sm:   clamp(11px, 3.3vw, 13px);
  --fs-base: clamp(13px, 3.7vw, 15px);
  --fs-md:   clamp(14px, 4.2vw, 16px);
  --fs-lg:   clamp(16px, 4.8vw, 18px);
  --fs-xl:   clamp(18px, 5.5vw, 22px);
  --fs-2xl:  clamp(22px, 6.5vw, 26px);
  --fs-3xl:  clamp(26px, 7.5vw, 30px);
  --fs-4xl:  clamp(30px, 9vw, 38px);
  --fs-5xl:  clamp(40px, 12vw, 48px);
  --fs-6xl:  clamp(54px, 16vw, 64px);
  --fs-hero: clamp(64px, 20vw, 80px);

  /* AdMob 배너 레이아웃 변수 (JS initSafeArea()가 세팅) */
  --ad-h: 0px;      /* 배너 높이 (dp), bannerAdLoaded 이벤트로 갱신 */
  --ad-margin: 0px; /* 시스템 내비 높이 = AdMob margin 파라미터와 동일값 */
}

* {
  box-sizing: border-box;
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", Roboto, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", Roboto, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  /* Android WebView 시스템 글꼴 크기 설정 무시 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", Roboto, "Segoe UI", sans-serif;
  font-size: inherit;
  line-height: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex-shrink: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding: calc(20px + env(safe-area-inset-top, 0px)) 24px 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #f0f0f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.title-block h1 {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
}

.title-block p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--fs-base);
}

.icon-btn,
.add-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  font-size: var(--fs-xl);
}
.tree-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tree-icon-btn:hover {
  background: #c8e6c9;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 종 아이콘 + 읽지 않은 뱃지 */
.notif-bell-btn {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e04444;
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* 알림 패널 */
.notif-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 500;
}

.notif-panel {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100vw);
  max-height: 75vh;
  background: #fff;
  border-radius: 0 0 24px 24px;
  z-index: 501;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  animation: slideDown 0.22s ease;
}

@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px;
  font-size: var(--fs-md);
  font-weight: 700;
  border-bottom: 1px solid #f0f0f0;
}

.notif-panel-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  font-size: var(--fs-md);
  color: var(--muted);
  cursor: pointer;
}

.notif-panel-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0 16px;
}

.notif-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--muted);
  font-size: var(--fs-base);
}

.notif-panel-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f8f8f8;
}

.notif-panel-item:last-child {
  border-bottom: none;
}

.notif-panel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.notif-panel-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  flex-shrink: 0;
}

.notif-panel-body {
  flex: 1;
  min-width: 0;
}

.notif-panel-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-bottom: 3px;
}

.notif-panel-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.notif-panel-msg {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 5px;
}

.notif-panel-time {
  font-size: var(--fs-xs);
  color: #b0b8c1;
}

.notif-actionable {
  cursor: pointer;
  transition: background 0.12s;
}
.notif-actionable:active {
  background: var(--primary-soft, #eef3ff);
}
.notif-status {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.notif-status.done {
  background: #e6f4ea;
  color: #2e7d32;
}
.notif-status.todo {
  background: var(--primary-soft, #eef3ff);
  color: var(--primary, #3b6cff);
}

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 24px calc(84px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

/* AdMob 배너 레이아웃 전략 (v1.1.0):
   목표 레이아웃(위→아래): [콘텐츠] [배너] [하단바] [시스템내비]
   - 하단바는 제자리(bottom:0) 유지 — 배너가 그 위에 얹힘
   - JS margin = 하단바 실제 높이(DOM에서 읽기) → 배너 하단 = 하단바 상단에 정렬
   - --ad-margin = margin값 (CSS에서 콘텐츠 패딩 계산에 사용)
   - --ad-h = 실제 배너 높이 (bannerAdLoaded 이벤트로 갱신)
*/

/* 배너 있을 때 콘텐츠 하단 패딩: 하단바(--ad-margin) + 배너(--ad-h) + 여유 8px */
body.has-ad-banner .content {
  padding-bottom: calc(var(--ad-margin, 70px) + var(--ad-h, 0px) + 8px);
}

/* 달력 날짜 시트 — 배너 위로 완전히 분리 */
body.has-ad-banner .date-sheet-overlay {
  padding-bottom: calc(var(--ad-margin, 70px) + var(--ad-h, 0px) + 20px);
}
body.has-ad-banner .date-sheet {
  border-radius: 20px;
  max-height: calc(72vh - 130px);
}

.summary {
  padding: 16px;
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.summary-row,
.record-head,
.form-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

/* 카드 헤더 소형 액션 버튼 (제목 우측, 설정·추가 등) */
.card-head-btn {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: #888;
  background: #f2f2f2;
  border: none;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  line-height: 1.5;
  white-space: nowrap;
}
.card-head-btn:active {
  opacity: 0.65;
}

.form-row > .field {
  flex: 1 1 0;
  min-width: 0;
}

.progress {
  overflow: hidden;
  height: 8px;
  margin-top: 12px;
  background: #e8e8e8;
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.pets-filter-bar {
  position: sticky;
  top: -16px;   /* .content padding-top(16px) 상쇄 → 스크롤 즉시 고정 */
  z-index: 2;
  background: #ffffff;
  margin: -16px -24px 12px;
  padding: 12px 24px 8px;
}

.segmented,
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0 4px;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE/Edge */
  cursor: grab;
  user-select: none;
}
.segmented::-webkit-scrollbar,
.chips::-webkit-scrollbar {
  display: none;               /* Chrome/Safari */
}
.segmented.is-dragging,
.chips.is-dragging,
.mr-pet-chips.is-dragging {
  cursor: grabbing;
}
.mr-pet-chips {
  cursor: grab;
  user-select: none;
}

.chip {
  flex: 0 0 auto;
  /* v1.0.1 점검: Play Store 접근성 정책 — 최소 44dp 클릭 영역 */
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.chip.active {
  border-color: var(--primary);
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
}

.chip-sm {
  /* v1.0.1 점검: 작은 칩도 클릭 영역 확보 (테두리 안 사이즈는 작게, 클릭 영역만 키움) */
  min-height: 36px;
  padding: 8px 12px;
  font-size: var(--fs-sm);
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  margin-left: 2px;
  vertical-align: middle;
}

.chip.active .filter-count {
  background: var(--primary-soft);
  color: var(--primary);
}

.sex-filter-row {
  padding-top: 4px;
  padding-bottom: 4px;
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.card {
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.pet-meta,
.small,
.record-meta {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.pet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
/* 카드 헤더 안 펫 이름/종 텍스트 영역 — 넘침 방지 */
.pet-row > div {
  min-width: 0;
  overflow: hidden;
}
.pet-row > div strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pet-row > div .pet-meta {
  word-break: keep-all; /* 잘라내는 대신 단어 단위 줄바꿈 (글꼴 확대 대응) */
}

.pet-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-soft);
  object-fit: cover;
  font-size: var(--fs-xl);
  flex: 0 0 auto;
}

.detail-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-soft);
  object-fit: cover;
  font-size: var(--fs-3xl);
}

.lineage-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #f8f8f8;
}

.lineage-parent img,
.lineage-parent span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  object-fit: cover;
  font-size: var(--fs-sm);
  font-weight: 800;
  flex: 0 0 auto;
}

.lineage-parent strong {
  display: block;
  font-size: var(--fs-base);
}

.lineage-parent small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.tasks {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.task {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 14px 0;
  border-radius: 0;
  border-bottom: 1px solid #f5f5f5;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.task.done {
  color: var(--muted);
  text-decoration: line-through;
}

.box {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--primary);
  border-radius: 6px;
  color: #fff;
  background: transparent;
  font-size: var(--fs-base);
  font-weight: 800;
  flex: 0 0 auto;
}

.task.done .box {
  background: var(--primary);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(60px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.quick-grid button,
.primary,
.secondary,
.danger {
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: var(--fs-base);
}

.quick-grid button {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-sm);
  white-space: normal; /* 글꼴 확대 시 잘리는 대신 2줄로 */
  word-break: keep-all;
  padding-left: 4px;  /* "이상증상" 같은 4글자 한 덩어리가 들어갈 여유 */
  padding-right: 4px;
}

.primary {
  background: var(--primary);
  color: white;
}

.secondary {
  background: #f5f5f5;
  color: var(--text);
}

.danger {
  background: #f3d9d2;
  color: #8b2f1d;
}

.danger-btn {
  padding: 8px 14px;
  border-radius: 10px;
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #f5c6c6;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}

.danger-btn:hover {
  background: #fad4d0;
}

.empty,
.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.6;
}

.empty-state p {
  margin: 0;
}

/* ══════════════════════════════════════════════════
   스플래시 화면
══════════════════════════════════════════════════ */
.splash-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 100vh;
  padding: 0 32px 48px;
  background: white;
  max-width: 480px;
  margin: 0 auto;
}

.splash-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 40px;
}

.splash-logo {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.splash-logo-fallback {
  font-size: var(--fs-hero);
  line-height: 1;
  user-select: none;
}

/* v1.0.1 점검에서 제거: .splash-title — 사용처 0개 */

.splash-sub {
  font-size: var(--fs-base);
  color: #999;
  margin: 0;
  font-weight: 500;
}

.splash-bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.splash-start-btn {
  width: 100%;
  padding: 17px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: var(--fs-md);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}

.splash-start-btn:hover {
  background: #256e3e;
}

.splash-import-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--muted, #888);
  font-size: var(--fs-sm);
  text-decoration: underline;
  cursor: pointer;
}

/* v1.0.1 점검에서 제거: .splash-sample-btn — 샘플 데이터 진입 버튼 폐지로 사용처 0개 */

/* ── 첫 반려동물 등록 화면 (스플래시 이후) ──────── */
.first-setup {
  display: grid;
  align-content: start;
  padding-top: 32px;
  gap: 16px;
}

.first-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-base);
  font-weight: 900;
}

.first-brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.first-setup-sub {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.7;
}

.first-setup h2 {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-2xl);
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.first-setup p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.6;
}

.setup-cards {
  display: grid;
  gap: 10px;
}

.setup-cards button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 78px;
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.setup-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-soft);
  font-size: var(--fs-2xl);
  flex: 0 0 auto;
}

.setup-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.setup-cards strong {
  font-size: var(--fs-md);
}

.setup-cards small {
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ── 기록 탭 탭바 ─────────────────────────────── */
.log-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 0 8px;
}

.log-tab-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  color: var(--muted);
  font-size: var(--fs-base);
  font-weight: 700;
  transition: all 0.14s;
}

.log-tab-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* ── 리포트 ──────────────────────────────────── */
.report-month-nav {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  text-align: center;
  min-height: 52px;
  font-size: var(--fs-lg);
  font-weight: 800;
  background: var(--surface);
  padding: 0 24px;
}

.report-summary-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--surface);
  padding: 10px 24px 14px;
}

.report-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.report-summary-item.warn .report-summary-val {
  color: var(--danger);
}

.report-summary-val {
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1;
}

.report-summary-label {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.report-summary-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
  flex-shrink: 0;
}

.report-card {
  margin-bottom: 12px;
}

/* 건강 변화 추이 */
.trend-chart {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  height: 72px;
}
.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  gap: 4px;
}
.trend-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
}
.trend-bar-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.trend-label {
  font-size: 11px;
  color: var(--muted);
}

/* 월간 하이라이트 */
.highlight-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.highlight-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 4px;
}
.highlight-icon { font-size: 18px; }
.highlight-val { font-size: var(--fs-base); font-weight: 700; color: var(--text); }
.highlight-label { font-size: 11px; color: var(--muted); }
.highlight-streak {
  font-size: var(--fs-sm);
  color: var(--text);
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #fff7ed;
  border-radius: 8px;
}
.highlight-streak strong { color: #d97706; }
.highlight-first {
  font-size: var(--fs-sm);
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.highlight-first span { color: var(--text); font-weight: 500; }

/* 데이터 분석 한줄평 */
.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fbf7ea;
  border: 1px solid #f0e6c8;
}
.insight-icon {
  font-size: var(--fs-lg);
  flex-shrink: 0;
  line-height: 1.4;
}
.insight-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: #5d4e23;
  font-weight: 500;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 리포트 방향 전환 — 산책 비교 / 예방접종 상태 / 완료율 카드 */
.walk-compare-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.walk-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.walk-bar-label {
  width: 32px;
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: right;
  flex-shrink: 0;
}
.walk-bar-track {
  flex: 1;
  height: 18px;
  background: #f2f2f2;
  border-radius: 9px;
  overflow: hidden;
}
.walk-bar {
  height: 100%;
  border-radius: 9px;
  transition: width 0.3s ease;
}
.walk-bar.prev { background: #d8d8d8; }
.walk-bar.cur  { background: var(--primary); }
.walk-bar-count {
  width: 38px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.walk-compare-diff {
  font-size: var(--fs-base);
  font-weight: 600;
  margin: 0 0 4px;
}
.walk-compare-diff.up   { color: #2D8B4E; }
.walk-compare-diff.down { color: #C75146; }
.walk-compare-diff.same { color: var(--muted); }

.vac-status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vac-status-row {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  flex-wrap: wrap; /* 글꼴 확대·좁은 화면에서 뱃지가 다음 줄로 — 이름 뭉개짐 방지 */
}
.vac-status-pet {
  font-weight: 600;
  font-size: var(--fs-base);
  flex-shrink: 0;
  max-width: 6em; /* px 대신 em — 글꼴 확대 시 같이 늘어남 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vac-status-info {
  flex: 1;
  font-size: var(--fs-base);
  color: var(--text);
  min-width: 8em; /* 이 폭 밑으로 줄어들지 않음 → 부족하면 뱃지가 다음 줄로 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vac-status-info.muted { color: var(--muted); }
.vac-status-badge {
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  margin-left: auto; /* 줄바꿈 시에도 우측 정렬 유지 */
  white-space: nowrap;
}
.vac-status-badge.overdue { background: #fdebe9; color: #C75146; }
.vac-status-badge.soon    { background: #fff4e0; color: #B97A14; }
.vac-status-badge.ok      { background: #eaf5ee; color: #2D8B4E; }
.vac-status-badge.done    { background: #f2f2f2; color: #888; }
.vac-status-cancel {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  padding: 2px 4px;
  cursor: pointer;
}
.vac-status-cancel:hover { color: #C75146; }

/* 반려동물별 이번 달 */
.perpet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.perpet-row.perpet-head {
  padding: 0 0 2px;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.perpet-name {
  width: 64px;
  flex-shrink: 0;
  font-weight: 600;
  font-size: var(--fs-base);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.perpet-bar {
  flex: 1;
  height: 8px;
  background: #f2f2f2;
  border-radius: 4px;
  overflow: hidden;
}
.perpet-bar div {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}
.perpet-rate {
  width: 44px;
  text-align: right;
  font-size: var(--fs-sm);
  font-weight: 700;
  flex-shrink: 0;
}
.perpet-weight {
  width: 56px;
  text-align: right;
  font-size: var(--fs-sm);
  color: var(--muted);
  flex-shrink: 0;
}
.perpet-weight.up   { color: #e53935; }
.perpet-weight.down { color: #1e88e5; }
.perpet-sym {
  font-size: var(--fs-xs);
  color: #C75146;
  font-weight: 700;
}

/* 연간 번식 통계 */
.breed-year-grid {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 8px;
}
.breed-year-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.breed-year-val {
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.breed-year-lbl {
  font-size: var(--fs-xs);
  color: var(--muted);
  text-align: center;
}
.breed-year-prev {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: center;
}

/* 종별 산란 차수 평균 */
.clutch-species-list { display: flex; flex-direction: column; gap: 10px; }
.clutch-species-row + .clutch-species-row { padding-top: 10px; border-top: 1px solid var(--line); }
.clutch-species-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.clutch-species-name { font-size: var(--fs-base); font-weight: 700; color: var(--text); }
.clutch-species-val { font-size: var(--fs-sm); font-weight: 600; color: var(--text); white-space: nowrap; }
.clutch-species-n { font-weight: 500; color: var(--muted); }
.clutch-species-note { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted); }

/* 루틴 템플릿 */
.tpl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.tpl-row:last-of-type { border-bottom: 0; }
.tpl-row-name {
  font-size: var(--fs-base);
  font-weight: 600;
  min-width: 0;
  word-break: keep-all;
}
.tpl-row-count {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 500;
}
.tpl-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.tpl-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface-soft, #f7f8f9);
  border-radius: 12px;
  padding: 10px 12px;
}
.tpl-item {
  font-size: var(--fs-sm);
  color: var(--text);
  word-break: keep-all;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tpl-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-item-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* .field label / .field input 공통 스타일(대문자·굵게, 너비 100%·높이 44px)이 덮어쓰지 않도록 선택자를 한 단계 더 구체적으로 */
.tpl-items .tpl-item-check {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; cursor: pointer;
  color: var(--text); font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0; text-transform: none;
}
.tpl-items .tpl-item-check input[type="checkbox"] {
  width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; border-radius: 4px;
  flex-shrink: 0; accent-color: var(--primary);
}
.tpl-item.off .tpl-item-name { color: var(--muted); text-decoration: line-through; }
.tpl-nd-stepper { margin-top: 2px; }
.tpl-item-hint { margin: 0; font-size: var(--fs-xs); color: var(--accent); line-height: 1.45; }
.tpl-freq-chips { display: flex; gap: 4px; flex-shrink: 0; }
.tpl-item-times { display: flex; gap: 4px; flex-wrap: wrap; }
.chip-xs {
  min-height: 28px;
  padding: 4px 10px;
  font-size: var(--fs-xs, 11px);
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.chip-xs.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.tpl-day-picker { display: flex; gap: 4px; }
.tpl-day-btn {
  flex: 1;
  min-width: 0;
  padding: 5px 2px;
  font-size: var(--fs-xs, 11px);
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}
.tpl-day-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.tpl-time-input {
  border: 1.5px solid #e8e8e8;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: var(--fs-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  min-height: 36px;
  transition: border-color 0.15s;
}
.tpl-time-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.tpl-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.tpl-modal button.full {
  display: block;
  width: 100%;
}

/* 배변 확인 — 있음/없음 선택 */
.poop-check-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.poop-check-actions button.full {
  display: block;
  width: 100%;
}
.bulk-poop-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-right: 8px;
}

/* 리포트 이미지 내보내기 */
.report-export-btn { margin-top: 4px; }
.report-export-hint {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 8px 0 0;
}

.report-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 14px;
}

.report-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  border-radius: 12px;
  background: #f8f8f8;
}

/* 이상증상 카드 — 주의 톤이지만 압박형 빨강 회피, 부드러운 앰버 */
.report-stat.warn {
  background: #fff8ee;
}

.report-stat-val {
  font-size: var(--fs-xl);
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.report-stat.warn .report-stat-val {
  color: #c45a36;
}

.report-stat-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.report-stat-sub {
  font-size: var(--fs-xs);
  color: #bbb;
}

.report-progress-wrap {
  height: 8px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.report-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.report-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ── 체중 차트 ───────────────────────────────── */
.weight-chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.weight-chart-pet {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 600;
}

.weight-latest {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.weight-delta {
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

/* 체중 변화 — 증가/감소 모두 중립 (펫·맥락에 따라 의미 다름) */
.weight-delta.up,
.weight-delta.down,
.weight-delta.same {
  background: #f5f5f5;
  color: var(--muted);
}

.weight-chart-wrap {
  width: 100%;
  margin-bottom: 6px;
}

.weight-chart-dates {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.weight-count {
  font-size: var(--fs-xs);
  color: #bbb;
}

/* ── 기존 기록 목록 ──────────────────────────── */
.record {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.record:last-child {
  border-bottom: 0;
}

.detail-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* 버튼 5개(목록·리포트·상태·수정·삭제)가 좁은 화면에서 잘리지 않게 */
  gap: 6px;
  background: var(--surface);
  padding: 10px 16px;
}

.detail-actions button {
  font-size: clamp(11px, 3.2vw, 14px);
  padding: 8px clamp(6px, 2vw, 10px);
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.detail-actions > div {
  display: flex;
  gap: clamp(4px, 1.5vw, 8px);
  flex-shrink: 1;
  min-width: 0;
}

.detail-hero {
  display: grid;
  gap: 8px;
}

.detail-hero h2 {
  margin: 0;
  font-size: var(--fs-2xl);
}

.detail-hero-photo {
  width: 100%;
  aspect-ratio: 1 / 1; /* 프로필 사진 크롭 결과(정사각형)와 비율을 맞춰 추가로 잘리지 않게 함 */
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* 빠른 기록 모달 — 사진 첨부 */
.photo-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--surface-alt, #f5f5f5);
  border: 1.5px dashed var(--line, #e0e0e0);
  border-radius: 10px;
  font-size: var(--fs-base);
  color: var(--primary, #2D8B4E);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.photo-attach-btn:hover {
  background: #eaf5ef;
}

.photo-attach-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}
.photo-attach-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}
.photo-attach-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: var(--fs-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stat {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.stat strong {
  display: block;
  margin-top: 4px;
}

.care-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.care-overview div {
  min-height: 76px;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.care-overview span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.care-overview strong {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-xl);
}

.calendar-card {
  position: relative;
  overflow: hidden;
}

.month-head {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 58px;
  text-align: center;
  font-size: var(--fs-xl);
  font-weight: 800;
}

.month-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  font-size: var(--fs-4xl);
  line-height: 1;
}

.calendar-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
}

.filter-pill {
  min-height: 44px;
  padding: 10px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.filter-pill.active {
  border-color: var(--primary);
  background: #ffffff;
  color: var(--primary);
}

.type-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 0 12px;
  border-bottom: 1px solid var(--line);
}

.type-btn {
  display: grid;
  justify-items: center;
  gap: 6px;
  flex: 0 0 58px;
  min-width: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.type-btn span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
}

.type-btn small {
  max-width: 100%;
  overflow: hidden;
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-btn.active small {
  color: var(--primary);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  padding-top: 14px;
}

.weekday {
  display: grid;
  place-items: center;
  height: 30px;
  color: var(--text);
  font-weight: 800;
}

.weekday.sun {
  color: #e44e4e;
}

.weekday.sat {
  color: #4f7ee8;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  padding: 6px 2px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  transition: background 0.12s;
}

.day-num-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.day-num {
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1;
}

/* 이상증상 배지 — 날짜 숫자 우상단 빨간 점 */
.sym-badge {
  position: absolute;
  top: -3px;
  right: -5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e53935;
  border: 1.5px solid #fff;
  flex-shrink: 0;
}

/* 이상증상 있는 셀 — 연한 빨간 배경 힌트 */
.day.has-symptom {
  background: #fff5f5;
}

.day.has-symptom.selected {
  background: #fde8e8;
}

.day.today .day-num-wrap .day-num {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-weight: 900;
}

/* .day-task-count — 점 방식으로 교체됨 (하위호환용 유지) */
.day-task-count {
  display: none;
}

.day.outside {
  color: #c9cdd4;
}

.day.outside .day-task-count {
  color: #d0d0d0;
}

.day.selected {
  background: #e8f5ee;
}

.day.selected .day-num {
  color: var(--primary);
  font-weight: 900;
}

.day.today.selected .day-num {
  background: var(--primary);
  color: #fff;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 3px;
  min-height: 8px;
}

.dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

/* 달력 진행 점 (루틴 할 일 + 설정 유형 점 — 한 줄로 표시) */
.cal-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  min-height: 8px;
  margin-top: 2px;
}

.cal-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

.cal-dots i.done    { background: var(--primary); }        /* 전부 완료 → 초록 */
.cal-dots i.partial { background: #f5a623; }               /* 일부 완료 → 주황 */
.cal-dots i.todo    { background: #e04444; }               /* 미완료    → 빨강 */
.cal-dots i.proj    { background: #d0d3d8; }               /* 미래 예정 → 회색 */

.day.outside .cal-dots i { opacity: 0.35; }

/* 성장 캘린더 — 추억 이벤트 마커 (사진·병원·접종) */
.cal-mem {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1px;
  min-height: 8px;
  margin-top: 1px;
  font-size: 9px;
  line-height: 1;
}
.day.outside .cal-mem { opacity: 0.35; }
.legend-sym-badge {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e53935;
  flex-shrink: 0;
}

.breed-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.sheet-lastyear-title { color: #8a6d3b; }

/* 달력 하단 범례 */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  padding: 10px 8px 2px;
  border-top: 1px solid #f0f0f0;
  margin-top: 6px;
}

.cal-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.cal-legend i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.cal-legend i.done    { background: var(--primary); }
.cal-legend i.partial { background: #f5a623; }
.cal-legend i.todo    { background: #e04444; }
.cal-legend i.proj    { background: #d0d3d8; }

/* ── 날짜 바텀 시트 ───────────────────────────── */
.date-sheet-overlay {
  position: fixed;
  inset: 0;
  /* 사파리는 하단 툴바가 나와 있을 때 inset:0 기준 높이가 실제 화면보다 짧게 잡혀서
     이 팝업 배경이 화면 맨 아래까지 안 닿고, 그 밑으로 하단 탭바가 그대로 비치는 문제가 있었음
     — 실제 보이는 화면 높이를 따라가는 dvh로 높이를 명시해서 고정 */
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.35);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.date-sheet {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  min-height: 220px; /* 빈 날짜도 시트가 충분한 크기로 보이게 */
  max-height: 72vh;
  overflow-y: auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}

.popup-entering .date-sheet {
  animation: sheetPop 0.18s ease;
}

@keyframes sheetPop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.date-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.date-sheet-head strong {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--text);
}

.sheet-close {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #999;
  font-size: var(--fs-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.sheet-symptom-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff0f0;
  border: 1px solid #fcd0d0;
  border-radius: 10px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #c0392b;
  margin-bottom: 16px;
}

.sheet-section-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.sheet-empty {
  font-size: var(--fs-sm);
  color: var(--muted);
  padding: 28px 0 32px;
  text-align: center;
}

/* 할 일 행 */
.sheet-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #f2f2f2;
  cursor: pointer;
}

.sheet-task:last-of-type { border-bottom: none; }

.sheet-task.projected {
  opacity: 0.55;
  cursor: default;
}

.sheet-task.done .sheet-task-title {
  text-decoration: line-through;
  color: #bbb;
}

.sheet-task-check {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid #d8d8d8;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.sheet-task-check.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.sheet-task-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.sheet-task-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
}

.sheet-task-meta {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* 기록 행 */
.sheet-log {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f2f2f2;
}

.sheet-log:last-of-type { border-bottom: none; }

.sheet-log-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.sheet-log-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.sheet-log-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
}

.sheet-log-note {
  font-size: var(--fs-sm);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-log-time {
  font-size: var(--fs-sm);
  color: var(--muted);
  flex: 0 0 auto;
}

.fab {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 30px rgba(61, 127, 76, 0.28);
  font-size: var(--fs-3xl);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(480px, 100%);
  transform: translateX(-50%);
  padding: 8px 10px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #eeeeee;
  backdrop-filter: blur(16px);
}

/* 배너 있을 때 하단바: 제자리 유지 (bottom:0) — 배너가 하단바 위에 얹히는 구조 */

.nav-btn {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 50px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-btn span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  line-height: 1;
  opacity: 0.45;
}

.nav-btn svg {
  display: block;
}

.nav-btn small {
  font-size: var(--fs-xs);
  font-weight: 800;
}

.nav-btn.active {
  background: transparent;
  color: var(--primary);
}

.nav-btn.active span {
  opacity: 1;
  background: #e8f5e9;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 10;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(22, 20, 17, 0.42);
}

.modal {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

/* 팝업이 새로 열릴 때만 재생 — 열린 채로 내부 상태만 바뀌는 재렌더에는 안 걸리게
   body.popup-entering는 render()가 방금 새로 연 팝업일 때만 한 프레임 붙였다 뗌 */
.popup-entering .modal {
  animation: sheetPop 0.18s ease;
}

.modal h2 {
  margin: 0 0 4px;
  font-size: var(--fs-lg);
  font-weight: 800;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* 모달 sticky 헤더 (긴 폼용) */
.modal-sticky-head {
  position: sticky;
  top: -24px;      /* modal padding-top 만큼 위로 당겨서 상단에 붙임 */
  z-index: 2;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 0 12px;
  margin: -24px -20px 12px;
  padding-left: 20px;
  padding-right: 20px;
  border-bottom: 1px solid var(--line);
}

.modal-sticky-head h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 800;
}

.modal-sticky-head .close-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 0;
  font-size: var(--fs-lg);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
/* grid 아이템이 콘텐츠 최소폭 밑으로 줄어들 수 있게 — 글꼴 확대 시 입력 행이 화면을 넘는 문제 방지 */
.field > * {
  min-width: 0;
}

/* 생일/입양일 같은 날짜 2개를 나란히 — iOS Safari 호환 */
.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.field-pair .field {
  min-width: 0;
}

/* 날짜 3칸 입력 (YYYY . MM . DD) — 네이티브 date picker 대체 */
.date-trio-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}
.date-trio-wrap input {
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
  box-sizing: border-box;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  padding: 12px 6px;
  font-size: var(--fs-base);
  font-family: inherit;
  background: #fff;
  color: var(--text, #222);
  min-width: 0;
}
.date-trio-wrap input:focus {
  outline: none;
  border-color: var(--primary, #3ecf8e);
}
.date-trio-wrap input::-webkit-inner-spin-button,
.date-trio-wrap input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.date-trio-wrap .date-trio-y {
  flex: 2 1 0;
  width: auto !important;
  min-width: 0;
}
.date-trio-wrap .date-trio-sm {
  flex: 1 1 0;
  width: auto !important;
  min-width: 0;
}
.date-trio-sep {
  color: #aaa;
  font-size: var(--fs-md);
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.photo-picker {
  margin: 8px 0 16px;
}

.photo-picker input[type="file"],
.photo-picker input[type="hidden"] {
  display: none;
}

.photo-picker label {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  cursor: pointer;
}

#petPhotoPreview {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  overflow: hidden;
  font-size: var(--fs-3xl);
}

#petPhotoPreview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-picker strong {
  color: var(--primary);
  font-size: var(--fs-base);
}

/* ── 사진 크롭(위치 조정/확대) 모달 ─────────────────────────── */
.crop-modal-backdrop {
  z-index: 20; /* 펫 등록/수정 모달(.modal-backdrop, z-index:10) 위에 뜨도록 */
}

.crop-modal {
  display: flex;
  flex-direction: column;
}

.crop-viewport {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  margin: 4px auto 0;
  overflow: hidden;
  border-radius: 16px;
  background: #1a1a1a;
  touch-action: none;
  cursor: grab;
}
.crop-viewport:active { cursor: grabbing; }

.crop-viewport img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.crop-mask-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(20, 20, 17, 0.55);
  pointer-events: none;
}

.crop-hint {
  margin: 12px 0 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: center;
}

.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
}
.crop-zoom-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}
.crop-zoom-icon {
  font-size: var(--fs-md);
  flex-shrink: 0;
}

.crop-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.crop-actions .secondary { flex: 1; }
.crop-actions .primary { flex: 2; }

.lineage-extra {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 16px;
  background: #fafafa;
}

.lineage-extra > strong {
  font-size: var(--fs-base);
}

.lineage-photo input {
  display: none;
}

.lineage-photo label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 800;
  cursor: pointer;
}

.lineage-photo span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-soft);
  overflow: hidden;
}

.lineage-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.field label {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.required {
  color: #e5484d;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f7f8f9;
  color: var(--text);
  font-size: var(--fs-base);
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.check-list {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  background: #fafafa;
}

.check-list.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
}

.check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.compact .check-row {
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 6px;
  min-height: 44px;
  font-size: var(--fs-base);
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 22px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.compact .check-row:has(input:checked) {
  border-color: var(--primary);
  background: #e8f5ee;
}

.compact .check-row input {
  width: 16px;
  height: 16px;
}

.toggle-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  margin: 12px 0;
  padding: 14px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 16px;
  background: #ffffff;
  cursor: pointer;
}

.toggle-card input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.toggle-card span {
  display: grid;
  gap: 3px;
}

.toggle-card strong {
  color: var(--text);
  font-size: var(--fs-base);
}

.toggle-card small {
  color: var(--muted);
  font-size: var(--fs-sm);
}


.inline-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.full {
  grid-column: 1 / -1;
}

@media (max-width: 360px) {
  .quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* v1.0.1 점검에서 제거: .notif-banner / .notif-banner button — 알림 배너 폐지로 사용처 0개 */

/* ── 알림 오버레이 ── */
.notif-overlay {
  position: fixed;
  /* 기본: 하단바 위 — safe area 보상 */
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}
body.has-ad-banner .notif-overlay {
  /* 배너 있을 때: 하단바(--ad-margin) + 배너(--ad-h) + 여유 8px 위 */
  bottom: calc(var(--ad-margin, 70px) + var(--ad-h, 0px) + 8px);
}
.notif-overlay {
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 32px));
  z-index: 6;
  animation: notif-slide-up 0.25s ease;
}

@keyframes notif-slide-up {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.notif-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 배지 pill */
.notif-card-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 99px;
  letter-spacing: 0.3px;
}

/* 아바타 + 텍스트 행 */
.notif-card-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.notif-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.notif-avatar-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  flex-shrink: 0;
}

.notif-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.notif-card-text strong {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.notif-card-text span {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
}

/* 버튼 행: 미루기 | 완료(넓게) */
.notif-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.notif-act-snooze,
.notif-act-done {
  padding: 14px 6px;
  border-radius: 14px;
  font-size: var(--fs-base);
  font-weight: 700;
  text-align: center;
  width: 100%;
}

.notif-act-snooze { background: #f2f2f2; color: #555; }
.notif-act-done   { background: var(--primary); color: #fff; }

/* 스누즈 드롭업 */
.notif-snooze-wrap {
  position: relative;
}

.snooze-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 1;
}

.snooze-menu.open { display: block; }

.snooze-menu button {
  display: block;
  width: 100%;
  padding: 11px 14px;
  text-align: left;
  font-size: var(--fs-base);
  font-weight: 600;
  background: transparent;
  color: var(--text);
  border-bottom: 1px solid #f0f0f0;
}

.snooze-menu button:last-child { border-bottom: none; }

/* 건너뛰기 — 미루기 드롭업 맨 아래 구분 */
.snooze-menu button:last-child {
  border-top: 1.5px solid #ebebeb;
  color: #aaa;
  font-weight: 500;
}

/* ── 월간 리포트 모달 ── */
.monthly-report-modal {
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}
.mr-header { text-align: center; margin-bottom: 20px; }
.mr-badge {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}
.mr-title { font-size: var(--fs-xl); font-weight: 800; margin: 0 0 6px; }
.mr-sub { font-size: var(--fs-base); color: var(--muted); margin: 0; }
.mr-sub strong { color: var(--text); }

.mr-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mr-section-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
}
.mr-pet-row { display: flex; flex-direction: column; gap: 8px; }
.mr-pet-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mr-pet-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  flex-shrink: 0;
}
.mr-pet-count {
  margin-left: auto;
  font-size: var(--fs-sm);
  color: var(--muted);
  background: #f2f2f2;
  padding: 2px 8px;
  border-radius: 99px;
}
.mr-pet-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 46px; }
.mr-chip {
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: #f2f2f2;
  color: var(--text);
}
.mr-chip.warn { background: #fff0f0; color: #c0392b; }
.mr-breeding-row { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }

/* ── 브리딩 개체 선택 ── */
.tree-picker-wrap {
  background: #f8fdf8;
  border: 1.5px solid #d4edda;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.tree-picker-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.tree-picker-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.tree-picker-header .tree-picker-label { margin-bottom: 0; }
.tree-back-btn { font-size: var(--fs-sm); padding: 4px 10px; }
.tree-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tree-picker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border: 1.5px solid #d4edda;
  border-radius: 14px;
  cursor: pointer;
  min-width: 72px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tree-picker-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(45,139,78,0.12);
}

/* ── 가계도 모달 ── */
.family-tree-modal {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.family-tree-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.family-tree-modal-body {
  overflow: auto;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  flex: 1;
}
.family-tree-modal-body .family-tree-wrap {
  border: none;
  background: none;
  padding: 0;
}

/* ── 브리딩 가계도 (위→아래) ── */
.family-tree-wrap {
  background: #f8fdf8;
  border: 1.5px solid #d4edda;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}
.family-tree-header {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.tree-root-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.family-tree-scroll {
  display: flex;
  flex-direction: row;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* 각 브랜치: 세로로 쌓임 */
.tree-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

/* 카드 */
.tree-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #f0f8f0;
  border-radius: 14px;
  text-align: center;
  min-width: 80px;
  max-width: 110px;
}
.tree-card-root {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.tree-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #e0f0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  flex-shrink: 0;
}
.tree-card-info { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.tree-card-name { font-size: var(--fs-sm); font-weight: 700; }
.tree-sex { font-size: var(--fs-xs); color: var(--muted); }
.tree-card-morph { font-size: var(--fs-xs); color: var(--muted); }

/* 부모 커플 행 */
.tree-couple {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.tree-couple-x {
  font-size: var(--fs-base);
  color: #b0b8c1;
  padding-top: 14px;
  flex-shrink: 0;
}

/* 세로 연결선 */
.tree-vline {
  width: 2px;
  height: 20px;
  background: #c8e6c9;
  flex-shrink: 0;
}

/* 자녀 행 */
.tree-gen {
  display: flex;
  flex-direction: row;
  gap: 0;
}
.tree-gen-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 6px;
  position: relative;
}

/* 여러 자녀: 수평선 + 수직 스텁 */
.tree-gen-multi .tree-gen-item {
  padding-top: 14px;
}
/* 수평 연결선 — 각 아이템 전체 폭 */
.tree-gen-multi .tree-gen-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #c8e6c9;
}
/* 첫 아이: 오른쪽 절반만 선 */
.tree-gen-multi .tree-gen-item:first-child::before {
  left: 50%;
}
/* 마지막 아이: 왼쪽 절반만 선 */
.tree-gen-multi .tree-gen-item:last-child::before {
  right: 50%;
}
/* 수직 스텁 — 수평선에서 카드까지 */
.tree-gen-multi .tree-gen-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 14px;
  background: #c8e6c9;
}

/* ── 새끼 루틴 설정 모달 ── */
.offspring-setup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offspring-setup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border-radius: 12px;
}

.offspring-setup-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  flex-shrink: 0;
  overflow: hidden;
}

.offspring-setup-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.offspring-setup-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.offspring-setup-info strong {
  font-size: var(--fs-base);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offspring-setup-info span {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.offspring-routine-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1.5px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
}

.offspring-routine-btn.done {
  border-color: #b0bec5;
  background: #eceff1;
  color: #78909c;
}

/* ── 가계도 아코디언 트리 ── */
.acc-tree { display: flex; flex-direction: column; }
.acc-node { display: flex; flex-direction: column; }
.acc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.acc-row:active { background: #f0f8f0; }
.acc-row-root {
  background: #f0f8f0;
  margin-bottom: 4px;
  border: 1.5px solid #d4edda;
}
.acc-toggle {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  font-size: var(--fs-xs);
  color: #aaa;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.1s, color 0.1s;
}
.acc-toggle.open { color: var(--primary); }
.acc-toggle:hover { background: #eee; }
.acc-toggle-gap { width: 24px; flex-shrink: 0; }
.acc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8f5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  flex-shrink: 0;
}
.acc-avatar-root {
  width: 44px;
  height: 44px;
  font-size: var(--fs-xl);
  background: #d4edda;
}
.acc-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-name { font-size: var(--fs-base); font-weight: 600; }
.acc-morph { font-size: var(--fs-xs); color: var(--muted); }
.acc-role-tag {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary-soft, #eef3ff);
  color: var(--primary, #3b6cff);
  font-size: var(--fs-xs);
  font-weight: 700;
  vertical-align: middle;
}
.acc-detail-arrow { font-size: var(--fs-lg); color: #ccc; flex-shrink: 0; }
.acc-children {
  border-left: 2px solid #e8f5e9;
  margin-left: 18px;
  padding-top: 2px;
  padding-bottom: 2px;
}
.acc-group-divider {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 4px 6px;
  margin-top: 4px;
}
.acc-partner-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.acc-group-label { font-size: var(--fs-xs); color: #aaa; font-weight: 600; }
.acc-group-morph { font-size: var(--fs-xs); color: #bbb; }

/* ── 가계도 모달 (새 디자인) ── */
.tree-root-wrap { margin-bottom: 20px; }
.tree-card-lg {
  flex-direction: row !important;
  align-items: center;
  text-align: left !important;
  gap: 14px;
  padding: 14px 16px;
  background: #f0f8f0;
  border-radius: 16px;
  min-width: 0;
  max-width: 100%;
}
.tree-card-lg .tree-card-info { align-items: flex-start !important; }
.tree-avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #d4edda;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xl);
  flex-shrink: 0;
}
.tree-card-species { font-size: var(--fs-xs); color: #bbb; }
.tree-avatar-ext {
  background: #f0f0f0;
  font-size: var(--fs-md);
  color: #999;
}
.tree-card-external { opacity: 0.75; }
.tree-section-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 16px 0 8px;
}
.tree-parent-row { margin-bottom: 4px; }
.tree-back-btn {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--primary);
  /* icon-btn의 42x42 고정 크기 해제 → "← 뒤로" 글자 길이에 맞춤 */
  width: auto;
  height: auto;
  min-width: 0;
  padding: 6px 10px;
  white-space: nowrap;
}
.tree-group { margin-bottom: 20px; }
.tree-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f8f8;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.tree-group-label { font-size: var(--fs-xs); color: #aaa; font-weight: 600; flex-shrink: 0; }
.tree-partner-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.tree-group-partner-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.tree-offspring-list { display: flex; flex-direction: column; gap: 6px; }
.tree-offspring-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.tree-offspring-chip:active { background: #f0f8f0; border-color: var(--primary); }
.tree-chip-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8f5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  flex-shrink: 0;
}
.tree-chip-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tree-chip-name { font-size: var(--fs-base); font-weight: 600; }
.tree-chip-morph { font-size: var(--fs-xs); color: var(--muted); }
.tree-chip-arrow { font-size: var(--fs-lg); color: #ccc; flex-shrink: 0; }

.breeding-clutch-label {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
  padding: 4px 0 8px;
  margin-bottom: 0;
}

/* ── 설정 모달 섹션 ── */
.settings-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

/* v1.0.1 점검에서 제거: .settings-devzone / .dev-badge — 개발자 전용 섹션 폐지로 사용처 0개 */

.settings-section:last-of-type { border-bottom: none; }

.settings-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  font-size: var(--fs-base);
  font-weight: 500;
}

.settings-value {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* 알림 권한 버튼 (설정 탭) */
.notif-perm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.notif-perm-btn:hover { background: var(--surface-soft); }
.notif-perm-btn.perm-granted { border-color: #4caf50; color: #2e7d32; background: #f1f8e9; }
.notif-perm-btn.perm-denied  { border-color: #e57373; color: #c62828; background: #ffebee; }
.notif-perm-btn.perm-default { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.notif-perm-icon { font-size: var(--fs-sm); line-height: 1; }
.notif-perm-text { font-size: var(--fs-sm); line-height: 1; }

/* 샘플 데이터 정리 모달 */
.sample-cleanup-modal {
  max-width: 360px;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}
.sample-cleanup-stats {
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 14px 16px;
}
.sample-cleanup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: var(--fs-base);
}
.sample-cleanup-row span { color: var(--muted); }
.sample-cleanup-row strong { font-weight: 800; }

/* 알림 설정 가이드 모달 */
.notif-guide-modal {
  max-width: 360px;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}
.notif-guide-steps {
  margin: 0 0 20px;
  padding: 16px 16px 16px 36px;
  background: var(--surface-soft);
  border-radius: 12px;
  font-size: var(--fs-base);
  color: var(--text);
  line-height: 1.9;
}
.notif-guide-steps li { padding-left: 4px; }
.notif-guide-steps li::marker { color: var(--primary); font-weight: 800; }

.backup-warn {
  color: var(--accent);
  font-weight: 600;
}

/* 번식 기록 요약 칩 */
.breeding-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.breeding-summary-chip {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: var(--fs-sm);
  color: var(--text);
}
.breeding-summary-chip.muted {
  color: var(--muted);
}

/* 기록 타임라인 연도·월 그룹 */
.timeline-year-group {
  margin-bottom: 4px;
}
.timeline-year-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 0 8px;
  background: none;
  border: none;
  border-bottom: 2px solid var(--line);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.timeline-year-header:hover { color: var(--primary); }


.timeline-month-group {
  margin-bottom: 4px;
}
.timeline-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.timeline-month-header:hover { color: var(--primary); }
.timeline-month-count {
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

/* 기록 타임라인 더보기 버튼 */
.timeline-more-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: var(--fs-sm);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}
.timeline-more-btn:hover {
  background: var(--line);
  color: var(--text);
}

.quiet-times {
  margin-top: 12px;
  padding: 12px;
  background: #fafafa;
  border-radius: 12px;
  display: grid;
  gap: 8px;
}

.quiet-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  font-size: var(--fs-base);
  font-weight: 500;
}

.quiet-time-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiet-hour-input {
  width: 44px !important;
  font-size: var(--fs-md) !important;
}

.quiet-hour-label {
  color: var(--muted);
  font-size: var(--fs-base);
  font-weight: 700;
}

.toggle-pill {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: #ccc;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle-pill.on { background: var(--primary); }

.toggle-pill span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: left 0.2s;
}

.toggle-pill.on span { left: 25px; }

/* 오늘 할 일 FAB */
.today-fab {
  position: fixed;
  right: calc(50% - 240px + 20px);
  bottom: calc(90px + env(safe-area-inset-bottom, 0px)); /* 하단바 위 — safe area 보상 */
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: var(--fs-2xl);
  line-height: 1;
  box-shadow: 0 8px 24px rgba(45, 139, 78, 0.35);
  z-index: 3;
  display: grid;
  place-items: center;
}

@media (max-width: 480px) {
  .today-fab {
    right: 20px;
  }
}
body.has-ad-banner .today-fab {
  bottom: calc(var(--ad-margin, 70px) + var(--ad-h, 0px) + 20px);
}

/* 반려동물 슬롯 카운터 */
.pet-slot-info {
  position: fixed;
  right: calc(50% - 240px + 84px);
  bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  background: #fff;
  border: 1.5px solid var(--primary);
  border-radius: 20px;
  padding: 5px 12px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  white-space: nowrap;
  line-height: 1;
}
@media (max-width: 480px) {
  .pet-slot-info { right: 84px; }
}
body.has-ad-banner .pet-slot-info {
  bottom: calc(var(--ad-margin, 70px) + var(--ad-h, 0px) + 38px);
}

/* 바텀시트 모달 — 배너 광고 위로 올리기 */
body.has-ad-banner .modal-backdrop {
  padding-bottom: calc(var(--ad-margin, 70px) + var(--ad-h, 0px));
}
body.has-ad-banner .modal {
  border-radius: 20px;
}

/* 오늘 할 일 설정 모달 */
.task-setup-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.task-setup-row {
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.task-setup-row.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.task-setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-setup-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}

.task-setup-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.task-setup-time {
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: var(--fs-base);
  color: var(--text);
  width: 108px;
  flex-shrink: 0;
  background: #fff;
}

.task-setup-time:disabled {
  opacity: 0.3;
  pointer-events: none;
}


.day-selector {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.day-btn {
  flex: 1;
  height: 32px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.day-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.monthly-day {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
}

.day-num-input {
  width: 58px !important;
  min-height: unset !important;
  padding: 8px 6px !important;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: var(--fs-base);
  font-weight: 700;
  text-align: center;
  background: #f7f8f9;
  -moz-appearance: textfield;
}

.day-num-input::-webkit-inner-spin-button,
.day-num-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 품종 커스텀 피커 */
.species-trigger {
  width: 100%;
  min-height: 42px;
  padding: 10px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  color: #888;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-base);
  text-align: left;
}

.species-trigger.has-value {
  color: var(--text);
}

.picker-arrow {
  font-size: var(--fs-sm);
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.species-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  margin-top: 4px;
}

.species-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  color: var(--text);
  border-bottom: 1px solid #f0f0f0;
  font-size: var(--fs-base);
  font-weight: 500;
}

.species-item:last-child {
  border-bottom: none;
}

.species-item.selected {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.conn-more-btn {
  display: block;
  width: 100%;
  padding: 11px 16px;
  background: #fafafa;
  border: none;
  border-top: 1px solid #f0f0f0;
  color: var(--primary, #3b6cff);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.conn-year-head {
  padding: 6px 16px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted, #888);
  background: #f5f5f5;
  border-top: 1px solid #f0f0f0;
}

/* ── 커스텀 시간 피커 ─────────────────────────────── */
.time-picker-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f7f8f9;
  border: 1.5px solid #e8e8e8;
  border-radius: 14px;
  padding: 10px 14px;
  flex-wrap: wrap; /* 글꼴 확대 시 시:분이 다음 줄로 — 가로 넘침 방지 */
  max-width: 100%;
  box-sizing: border-box;
}

.ampm-group {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid #e0e0e0;
  background: #fff;
}

.ampm-btn {
  padding: 8px 13px;
  background: transparent;
  color: #aaa;
  font-size: var(--fs-sm);
  font-weight: 700;
  border: none;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.ampm-btn + .ampm-btn {
  border-left: 1px solid #e8e8e8;
}

.ampm-btn.on {
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
}

.time-num-input {
  width: 48px !important;
  min-height: unset !important;
  padding: 6px 4px !important;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: var(--fs-lg);
  font-weight: 700;
  text-align: center;
  color: var(--text);
  background: #fff;
  -moz-appearance: textfield;
}

.time-num-input::-webkit-inner-spin-button,
.time-num-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.time-colon {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: #ccc;
  line-height: 1;
}

.time-disabled {
  font-size: var(--fs-base);
  color: #ccc;
  font-weight: 600;
  padding: 0 4px;
  letter-spacing: 1px;
}

/* ── 반복 주기 버튼 ─────────────────────────────── */
.task-freq-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.freq-btn {
  flex: none;
  padding: 7px 14px;
  border: 1.5px solid #e2e2e2;
  border-radius: 20px;
  background: #fff;
  color: #888;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.freq-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.freq-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* freq-wrap — 줄바꿈 허용 (반복 주기 등) */
.freq-wrap {
  flex-wrap: wrap;
}

/* 더 길게… 하위 칩 */
.freq-sub-row {
  padding-left: 8px;
  margin-top: 6px !important;
}
.freq-btn.freq-sub {
  font-size: var(--fs-sm);
  padding: 5px 12px;
  border-color: #d0d0d0;
}

/* N주마다 스테퍼 */
.nweekly-stepper-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.stepper-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid #e0e0e0;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.stepper-btn:active {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.stepper-val {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  min-width: 52px;
  text-align: center;
}

/* 다음 예정일 미리보기 */
.next-date-preview {
  font-size: var(--fs-sm);
  color: var(--primary);
  margin-top: 8px;
  font-weight: 500;
}

/* chip-scroll — 가로 한 줄 스크롤 (반려동물·유형 선택) */
.chip-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.chip-scroll::-webkit-scrollbar {
  display: none;
}
.chip-scroll .freq-btn {
  flex-shrink: 0;
}

/* ── 펫 카드 알림 설정 버튼 ──────────────────────────── */
.pet-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.routine-edit-btn {
  flex: 1;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--muted);
  border: none;
  border-radius: 10px;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}

.routine-edit-btn:hover {
  background: #e8eaed;
}

.routine-edit-btn.has-routine {
  background: var(--primary-soft);
  color: var(--primary);
}

.routine-edit-btn.has-routine:hover {
  background: #d4f0de;
}

.weight-pet-selector {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}
.weight-pet-selector::-webkit-scrollbar { display: none; }
.weight-pet-selector.is-dragging { cursor: grabbing; }
.weight-pet-selector .chip { flex-shrink: 0; }

/* 홈 화면 특이사항 카드뉴스 */
.home-insight-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}
.home-insight-strip::-webkit-scrollbar { display: none; }
.home-insight-strip.is-dragging { cursor: grabbing; }
.home-insight-card {
  flex: 0 0 auto;
  width: 200px;
  background: #fbf7ea;
  border: 1px solid #f0e6c8;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.home-insight-pet {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.home-insight-pet img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.home-insight-pet strong {
  font-size: var(--fs-sm);
  color: var(--text);
}
.home-insight-text {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: #5d4e23;
  font-weight: 500;
  word-break: keep-all;
}
.home-insight-icon { margin-right: 4px; }

/* 체중 기록 빈 상태 */
.weight-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 0 8px;
  color: var(--muted);
  font-size: var(--fs-base);
}

.weight-empty span {
  font-size: var(--fs-2xl);
}

.weight-empty p {
  margin: 0;
}

.weight-empty .secondary {
  margin-top: 4px;
  font-size: var(--fs-sm);
}

/* ── 체중 빠른 입력 모달 ─────────────────────────────── */
.quick-weight-modal {
  max-width: 320px;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px;
}

.quick-weight-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.quick-weight-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.quick-weight-avatar-ph {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  flex-shrink: 0;
}

.quick-weight-body {
  margin-bottom: 20px;
}

.quick-weight-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: 12px;
  padding: 4px 14px 4px 4px;
}

.quick-weight-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--text);
  padding: 10px 8px;
  width: 0;
  min-width: 0;
  -moz-appearance: textfield;
}

.quick-weight-input::-webkit-inner-spin-button,
.quick-weight-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.quick-weight-unit {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.quick-weight-prev {
  margin: 8px 0 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: right;
}

.quick-weight-actions {
  display: flex;
  gap: 8px;
}

.quick-weight-actions .secondary { flex: 1; }
.quick-weight-actions .primary   { flex: 2; }

/* ── 파충류 일괄 피딩 모달 ───────────────────────────── */
.bulk-feed-modal {
  max-width: 360px;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px;
}

.bulk-feed-header {
  margin-bottom: 14px;
}

.bulk-feed-all {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 700;
  margin-bottom: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.bulk-feed-all.on {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.bulk-feed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.bulk-feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.12s;
}

.bulk-feed-row.checked {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.bulk-feed-pet {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bulk-feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.bulk-feed-avatar-ph {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
}

.bulk-feed-name {
  font-size: var(--fs-base);
  font-weight: 700;
}

.bulk-feed-check {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.bulk-feed-actions {
  display: flex;
  gap: 8px;
}

.bulk-feed-actions .secondary { flex: 1; }
.bulk-feed-actions .primary   { flex: 2; }

/* ── 루틴 편집 모달 ────────────────────────────────── */
.routine-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.close-btn {
  /* v1.0.1 점검: 접근성 — 최소 44dp 클릭 영역 */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: var(--fs-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.routine-entry {
  border: 1.5px solid #e8e8e8;
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s;
}

.routine-entry.off {
  background: #fafafa;
  border-color: #f0f0f0;
}

.routine-entry-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.routine-entry-label {
  flex: 1;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
}

.routine-entry.off .routine-entry-label {
  color: var(--muted);
}

.icon-del {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f5f5f5;
  border: none;
  color: #bbb;
  font-size: var(--fs-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.icon-del:hover {
  background: #fdecea;
  color: #e53935;
}

.routine-entry-body {
  padding: 12px 14px 14px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.routine-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remove-time-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f0f0;
  border: none;
  color: var(--muted);
  font-size: var(--fs-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.add-time-btn {
  align-self: flex-start;
  padding: 7px 14px;
  border: 1.5px dashed var(--primary);
  border-radius: 8px;
  background: white;
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}

.task-times-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.add-routine-section {
  margin-top: 12px;
  padding: 16px;
  background: #f7faf8;
  border-radius: 16px;
  border: 1.5px solid #e4ede7;
}

.add-routine-section-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.add-routine-btn {
  width: 100%;
  padding: 13px;
  border: 1.5px dashed #b8d4c2;
  border-radius: 12px;
  background: white;
  color: var(--primary);
  font-size: var(--fs-base);
  font-weight: 700;
  cursor: pointer;
}

.add-routine-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* ── 펫 상세 루틴 요약 ─────────────────────────────── */
.routine-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-base);
}

.routine-summary-row:last-child {
  border-bottom: none;
}

.routine-summary-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   홈 화면 — 오늘 할 일 (펫루틴 스타일)
══════════════════════════════════════════════════ */

/* 회상 카드 — 작년 이맘때 (기록 탭 월간 리포트에서 사용) */
.memory-card {
  background: linear-gradient(135deg, #fdf8ee 0%, #fef3e2 100%);
  border: 1px solid #f0e0bc;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.memory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.memory-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #b07d2a;
}
.memory-date {
  font-size: var(--fs-xs);
  color: #c9a05a;
}
.memory-entry {
  display: flex;
  align-items: center;
  gap: 10px;
}
.memory-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.memory-avatar-emoji {
  background: #fff8e8;
  border: 1px solid #f0ddb0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
}
.memory-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.memory-pet {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #5a3e0a;
}
.memory-desc {
  font-size: var(--fs-sm);
  color: #8a6030;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 진행 현황 */
.home-progress-wrap {
  background: white;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.home-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-base);
  color: #555;
  margin-bottom: 8px;
}

.home-pct {
  font-size: var(--fs-base);
  font-weight: 800;
  color: var(--primary);
}

.home-progress-bar {
  background: #e8e8e8;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.home-progress-bar > div {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* 오늘 할 일 섹션 헤더 */
.today-section {
  display: flex;
  flex-direction: column;
}
.today-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
}
.today-section-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
}
.today-section-count {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: #fff;
  background: #aaa;
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 1.6;
}
/* 카드 스택 */
.today-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.today-empty-msg {
  text-align: center;
  padding: 48px 0;
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.8;
}

/* 홈 카드 */
.hcard {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.07);
  transition: opacity 0.2s;
}

.hcard.all-done {
  opacity: 0.72;
}

/* 홈 화면 파충류 종 그룹 */
.species-group {
  background: #f7f5ef;
  border-radius: 18px;
  overflow: hidden;
}
.species-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.species-group-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: #5d4e23;
  flex: 1;
  min-width: 0;
}
.species-group-count {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
}
.species-group-done {
  flex-shrink: 0;
  white-space: nowrap;
}
.species-group-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 10px 10px;
}

/* 카드 헤더 */
.hcard-head {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hcard-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xl);
  overflow: hidden;
  flex-shrink: 0;
}

.hcard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hcard-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hcard-name {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #1a1a1a;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hcard-sub {
  font-size: var(--fs-sm);
  color: #999;
  display: block;
}

.hcard-type-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 99px;
  padding: 4px 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.hcard-arrow {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.hcard-arrow.up {
  transform: rotate(-90deg);
}

/* 구분선 */
.hcard-divider {
  height: 1px;
  background: #f5f5f5;
  margin: 0 16px;
}

/* 할 일 목록 */
.hcard-tasks {
  padding: 4px 16px 2px;
}
.hcard-tasks:last-child { padding-bottom: 14px; }

.hcard-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f8f8f8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.hcard-task:last-child {
  border-bottom: none;
}

.hcard-task.done {
  cursor: default;
}
/* 완료 상태 — 체크·타이틀·시간만 흐리게, 메모 버튼은 선명하게 유지 */
.hcard-task.done .hcard-check.checked {
  opacity: 0.65;
}
.hcard-task.done .hcard-task-time {
  color: #ddd;
}

/* 커스텀 체크박스 */
.hcard-check {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid #ddd;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s;
}

.hcard-check.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.hcard-task-title {
  flex: 1;
  font-size: var(--fs-base);
  color: #1a1a1a;
  font-weight: 500;
}

.hcard-task.done .hcard-task-title {
  text-decoration: line-through;
  color: #bbb;
}

.hcard-task-time {
  font-size: var(--fs-sm);
  color: #bbb;
  flex-shrink: 0;
}

/* 최근 기록 */
.hcard-recent {
  font-size: var(--fs-sm);
  color: #aaa;
  padding: 6px 16px 14px;
  line-height: 1.5;
}

/* 오늘 할 일 카드 — 이상증상 바로가기 */
.hcard-foot {
  padding: 4px 16px 12px;
}
.hcard-symptom-btn {
  background: #fff0f0;
  color: #c0392b;
  border: 1px solid #f5c6c6;
  border-radius: 12px;
  padding: 7px 14px;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

/* 이상증상 버튼 강조 */
.quick-grid button.quick-symptom {
  background: #fff0f0;
  color: #c0392b;
  border: 1px solid #f5c6c6;
}

.quick-grid button.quick-symptom:hover {
  background: #fde0e0;
  color: #a93226;
}

/* 나이 배지 */
.badge-age {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-xs);
}

.badge-inactive {
  background: #f3f3f3;
  color: #888;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}

/* 비활성 펫 섹션 */
.inactive-pets-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.inactive-pets-toggle {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}

.inactive-arrow { transition: none; }
.inactive-arrow.up { }

/* 펫 비활성 배너 */
.pet-inactive-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #666;
  margin-top: 12px;
}

/* 펫 상태 모달 옵션 */
.pet-status-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-status-opt {
  all: unset;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--line);
  cursor: pointer;
  transition: border-color 0.15s;
}

.pet-status-opt:hover { border-color: #ccc; }
.pet-status-opt.selected { border-color: var(--primary); background: var(--primary-soft); }

.pet-status-emoji { font-size: var(--fs-xl); }

.pet-status-label {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
}

.pet-status-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 1px;
}

/* ── 온보딩 ──────────────────────────────────────────────── */
.ob-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: white;
  padding: 0 24px 40px;
  box-sizing: border-box;
}

.ob-screen.ob-scroll {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 상단 네비 (뒤로/진행상태) */
.ob-topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 8px;
  flex-shrink: 0;
}

.ob-topnav-title {
  flex: 1;
  font-size: var(--fs-base);
  font-weight: 700;
  color: #333;
}

.ob-back-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: #333;
  flex-shrink: 0;
}

/* 진행 점 */
.ob-progress {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}

.ob-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0e0e0;
  transition: background 0.2s, width 0.2s;
}

.ob-dot.active {
  background: var(--primary);
  width: 18px;
  border-radius: 4px;
}

.ob-dot.done {
  background: #a8d5b8;
}

/* 헤더 (step 1) */
.ob-header {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 0 16px;
  gap: 12px;
}

.ob-title {
  font-size: var(--fs-2xl);
  font-weight: 900;
  color: #111;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin: 0;
}

.ob-sub {
  font-size: var(--fs-base);
  color: #999;
  margin: 0;
  font-weight: 500;
  line-height: 1.5;
}

/* 카테고리 버튼 (step 1) */
.ob-cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.ob-cat-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-soft);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.ob-cat-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.ob-cat-icon {
  font-size: var(--fs-3xl);
  flex-shrink: 0;
}

.ob-cat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ob-cat-info strong {
  font-size: var(--fs-md);
  font-weight: 800;
  color: #111;
}

.ob-cat-info small {
  font-size: var(--fs-sm);
  color: #999;
  font-weight: 500;
}

/* 폼 바디 (step 2~4) */
.ob-form-body {
  flex: 1;
  padding-top: 4px;
}

.ob-field {
  margin-bottom: 16px;
}

.ob-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.ob-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #555;
  margin-bottom: 6px;
}

.ob-req {
  color: var(--primary);
}

.ob-input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  font-size: var(--fs-md);
  font-weight: 500;
  color: #111;
  background: white;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.ob-input:focus {
  border-color: var(--primary);
}


.ob-select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  font-size: var(--fs-md);
  font-weight: 500;
  color: #111;
  background: white;
  box-sizing: border-box;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  font-family: inherit;
}

.ob-select:focus {
  border-color: var(--primary);
}

/* 온보딩 성별 버튼 그룹 */
.ob-sex-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ob-sex-btn {
  flex: 1 1 auto;
  min-width: 80px;
  padding: 12px 10px;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  background: #fff;
  font-size: var(--fs-base);
  font-weight: 500;
  color: #555;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ob-sex-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

/* 사진 */
.ob-photo-label {
  display: block;
  text-align: center;
  margin-bottom: 20px;
  cursor: pointer;
}

.ob-photo-circle {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface-soft);
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ob-photo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ob-photo-placeholder {
  font-size: var(--fs-4xl);
}

/* 사진 동그라미 + 카메라 배지 래퍼 (배지가 원 밖에 걸치도록 overflow 분리) */
.ob-photo-wrap {
  position: relative;
  display: inline-block;
}

/* 항상 보이는 카메라 배지 — 모바일에서도 탭 위치가 명확하도록 */
.ob-photo-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.ob-photo-hint {
  margin: 8px 0 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  text-align: center;
}

/* ── 기록 탭 서브탭 (.content 밖 flex 영역 → 항상 topbar 바로 아래 고정) ── */
.records-subtabs {
  display: flex;
  gap: 8px;
  padding: 10px 24px 6px;
  background: #fff;
  flex-shrink: 0;
  z-index: 2;
}

.subtab-btn {
  flex: 1;
  padding: 9px 0;
  border-radius: 10px;
  font-size: var(--fs-base);
  font-weight: 600;
  background: #f4f4f4;
  color: var(--muted);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.subtab-btn.active {
  background: var(--primary);
  color: #fff;
}

/* ── FAB 모달 탭 ────────────────────────────────────── */
.fab-modal-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
}

.fab-tab-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 10px;
  font-size: var(--fs-base);
  font-weight: 600;
  background: #f4f4f4;
  color: var(--muted);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.fab-tab-btn.active {
  background: var(--primary);
  color: #fff;
}

/* ── 설정 탭 (풀페이지) ──────────────────────────────── */
.settings-tab {
  padding: 20px 16px 32px;
}

/* ── 산란 차수 입력 ──────────────────────────────────── */
.clutch-no-field { gap: 4px; }

.clutch-no-display {
  display: flex;
  align-items: center;
  gap: 6px;
}

.clutch-no-input {
  width: 64px;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: var(--fs-lg);
  font-weight: 700;
  text-align: center;
  color: var(--primary);
}

.clutch-no-unit {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
}

.clutch-no-hint {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 2px;
}

/* ── 해칭 후 등록 프롬프트 ───────────────────────────── */
.hatchling-prompt-modal {
  text-align: center;
}

.hatchling-eggs {
  font-size: var(--fs-2xl);
  letter-spacing: 2px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.hatchling-prompt-modal h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: 8px;
}

.hatchling-prompt-modal p {
  font-size: var(--fs-base);
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.hatchling-done-msg {
  color: var(--text) !important;
}

.hatchling-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.hatchling-pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e0e0e0;
  transition: background 0.2s;
}

.hatchling-pip.done {
  background: var(--primary);
}

/* 일괄 등록 폼 */
.hatchling-batch-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hatchling-row {
  display: grid;
  grid-template-columns: 20px 1fr 88px 90px;
  align-items: center;
  gap: 8px;
}

.hatchling-row-num {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.hatchling-name-input,
.hatchling-sex-select,
.hatchling-morph-input {
  padding: 9px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: var(--fs-base);
  background: #fafafa;
  width: 100%;
  box-sizing: border-box;
}

.hatchling-name-input:focus,
.hatchling-sex-select:focus,
.hatchling-morph-input:focus {
  border-color: var(--primary);
  background: #fff;
  outline: none;
}

/* 토스트 */
.app-toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(30, 30, 30, 0.88);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: var(--fs-base);
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  pointer-events: none;
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-toast-undo {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(30, 30, 30, 0.88);
  color: #fff;
  border-radius: 999px;
  font-size: var(--fs-base);
  font-weight: 500;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 20px;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 40px);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.app-toast-undo.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-undo-btn {
  background: none;
  border: none;
  color: #7fcfb4;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  pointer-events: auto;
}

/* 체크리스트 (step 3) */
.ob-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ob-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}

.ob-check-row.checked {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.ob-check-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  background: white;
}

.ob-check-box.on {
  background: var(--primary);
  border-color: var(--primary);
}

.ob-check-label {
  flex: 1;
  font-size: var(--fs-base);
  font-weight: 600;
  color: #222;
}

.ob-freq-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #999;
  background: #f0f0f0;
  padding: 3px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.ob-check-row.checked .ob-freq-badge {
  background: #d4edda;
  color: var(--primary);
}

/* 시간/주기 설정 목록 (step 4) */
.ob-setup-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ob-setup-row {
  background: var(--surface-soft);
  border-radius: 16px;
  padding: 14px 16px;
}

.ob-setup-row-label {
  font-size: var(--fs-base);
  font-weight: 800;
  color: #222;
  margin-bottom: 10px;
}

/* 하단 버튼 영역 */
.ob-bottom {
  padding-top: 20px;
  flex-shrink: 0;
}

.ob-bottom-hint {
  text-align: center;
  font-size: var(--fs-sm);
  color: #aaa;
  font-weight: 600;
  margin-bottom: 10px;
}

.ob-footer-note {
  text-align: center;
  padding-top: 8px;
}

.ob-divider {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #bbb;
  text-align: center;
  margin: 8px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ob-divider::before,
.ob-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ebebeb;
}

.ob-field-row-pair {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
}

.ob-lineage-block {
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 14px 14px 8px;
  margin-bottom: 12px;
}

.ob-lineage-title {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}

.ob-lineage-photo-label {
  display: inline-block;
  cursor: pointer;
}

.ob-lineage-photo-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  color: #999;
  overflow: hidden;
}

.ob-lineage-photo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── 설정 완료 화면 ─────────────────────────────────────────── */
.setup-done-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: white;
  padding: 0 24px 48px;
  box-sizing: border-box;
}

.setup-done-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 56px;
}

/* 체크 원형 애니메이션 */
.setup-done-check {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}

.setup-done-svg {
  width: 100%;
  height: 100%;
}

.setup-done-circle {
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: drawCircle 0.5s ease forwards;
}

.setup-done-tick {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawTick 0.35s ease forwards 0.45s;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawTick {
  to { stroke-dashoffset: 0; }
}

.setup-done-title {
  font-size: var(--fs-2xl);
  font-weight: 900;
  color: #111;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.setup-done-sub {
  font-size: var(--fs-base);
  color: #888;
  margin: 0 0 28px;
  font-weight: 500;
}

/* 펫 프로필 카드 */
.setup-done-pet {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-soft);
  border-radius: 16px;
  padding: 14px 18px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.setup-done-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xl);
  flex-shrink: 0;
  overflow: hidden;
}

.setup-done-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.setup-done-pet-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.setup-done-pet-info strong {
  font-size: var(--fs-md);
  font-weight: 800;
  color: #111;
}

.setup-done-pet-info span {
  font-size: var(--fs-sm);
  color: #999;
  font-weight: 500;
}

/* 루틴 목록 */
.setup-done-routines {
  width: 100%;
  box-sizing: border-box;
}

.setup-done-routines-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #aaa;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.setup-done-routine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #f4f4f4;
}

.setup-done-routine-row:last-child {
  border-bottom: none;
}

.setup-done-routine-name {
  font-size: var(--fs-base);
  font-weight: 600;
  color: #222;
}

.setup-done-routine-meta {
  font-size: var(--fs-sm);
  color: var(--primary);
  font-weight: 600;
}

.setup-done-no-routine {
  font-size: var(--fs-base);
  color: #aaa;
  text-align: center;
  margin: 8px 0 0;
}

/* 데이터 저장 안내 — 온보딩 마지막 화면 */
.setup-done-storage-notice {
  margin: 24px 0 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--primary-soft);
  text-align: center;
}
.setup-done-storage-title {
  margin: 0 0 8px;
  font-size: var(--fs-base);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.5;
}
.setup-done-storage-body {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.7;
}

.setup-done-bottom {
  padding-top: 16px;
  flex-shrink: 0;
}

/* ── 홈 고정 헤더 (.content 밖, records-subtabs와 동일 방식) ── */
.today-outer-header {
  background: var(--surface);
  padding: 12px 24px 10px;
}

/* ── 스트릭 ──────────────────────────────────────────────── */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff8e8;
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 10px;
  transition: background 0.2s;
}

/* 스트릭 배지/배너가 탭 가능함을 알리는 표시 */
.streak-chevron {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #b45309;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.streak-badge.complete .streak-chevron {
  color: var(--primary);
  border-color: var(--primary);
}
.streak-miss-banner .streak-chevron {
  color: #9b6a62;
  border-color: #e8cfc9;
  margin-left: auto;
}

/* 달력 날짜 시트 — 읽기 전용 (체크 토글 불가) */
.sheet-task.readonly { cursor: default; }

.streak-badge.complete {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* 스트릭 시작 전 안내 배지 (days=0) — 중립 톤 */
.streak-badge.starter {
  background: #f7f7f5;
  border-color: var(--line);
}
.streak-badge.starter .streak-next {
  color: #777;
  flex: 1;
}
.streak-badge.starter .streak-chevron {
  color: #999;
  border-color: var(--line);
}

.streak-fire {
  font-size: var(--fs-lg);
  flex-shrink: 0;
}

.streak-days {
  font-size: var(--fs-base);
  font-weight: 800;
  color: #b45309;
  white-space: nowrap;
  flex-shrink: 0;
}

.streak-badge.complete .streak-days {
  color: var(--primary);
}

.streak-next {
  font-size: var(--fs-sm);
  color: #92400e;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  word-break: keep-all;
}

.streak-check {
  font-size: var(--fs-sm);
  color: var(--primary);
  font-weight: 700;
  background: #d1fae5;
  padding: 3px 9px;
  border-radius: 10px;
}

/* 연속 미수행 배너 */
.streak-miss-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff1f2;
  border: 1.5px solid #fecdd3;
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 10px;
  word-break: keep-all;
}

.streak-miss-banner span {
  font-size: var(--fs-base);
  font-weight: 700;
  color: #be123c;
}

.streak-miss-banner small {
  font-size: var(--fs-sm);
  color: #e11d48;
  font-weight: 500;
}

.streak-recover-btn {
  margin-top: 6px;
  padding: 7px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}
.streak-recover-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.streak-shield-used {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: #9b6a62;
  font-weight: 500;
}

/* 마일스톤 팝업 */
.streak-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  box-sizing: border-box;
}

.streak-popup {
  background: white;
  border-radius: 24px;
  padding: 32px 28px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.streak-popup-emoji {
  font-size: var(--fs-6xl);
  line-height: 1;
  margin-bottom: 16px;
}

.streak-popup-title {
  font-size: var(--fs-xl);
  font-weight: 900;
  color: #111;
  margin: 0 0 10px;
}

.streak-popup-body {
  font-size: var(--fs-base);
  color: #666;
  line-height: 1.6;
  margin: 0 0 16px;
}

.streak-popup-days {
  display: inline-block;
  background: #fff8e8;
  border: 2px solid #fde68a;
  color: #b45309;
  font-size: var(--fs-md);
  font-weight: 800;
  padding: 8px 20px;
  border-radius: 30px;
  margin-bottom: 20px;
}

.streak-popup-close {
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: var(--fs-md);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

/* ── 브리딩 오버뷰 (기록 탭) ─────────────────────────── */
.breeding-overview {
  padding: 12px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clutch-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.clutch-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.clutch-pet-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clutch-pet-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
}

.clutch-pet-name {
  font-size: var(--fs-base);
  font-weight: 700;
  display: block;
}

.clutch-no-badge {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--primary);
  background: #e8f5ee;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.clutch-date {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* 클러치 타임라인 */
.clutch-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 4px;
  margin-bottom: 12px;
}

/* ── 수컷 번식 기록 ── */
.male-breed-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.male-breed-entry:last-child { border-bottom: none; }

.male-breed-pair {
  font-weight: 700;
  font-size: var(--fs-base);
  margin-bottom: 2px;
}
.male-breed-date {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: 6px;
}
.male-breed-step {
  font-size: var(--fs-sm);
  color: var(--text);
  padding: 2px 0;
}
.male-breed-step.muted {
  color: var(--muted);
}

.clutch-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  position: relative;
  font-size: var(--fs-base);
}

.clutch-step + .clutch-step::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -8px;
  width: 2px;
  height: 10px;
  background: #e0e0e0;
}

.clutch-step.done + .clutch-step.done::before { background: var(--primary); }
.clutch-step.done + .clutch-step.pending::before { background: #e0e0e0; }

.clutch-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  background: #fff;
  flex-shrink: 0;
}

.clutch-step.done .clutch-step-dot {
  background: var(--primary);
  border-color: var(--primary);
}

.clutch-step.pending .clutch-step-dot {
  border-color: #ccc;
  background: #f5f5f5;
}

.clutch-step-label {
  flex: 1;
  color: var(--text);
}

.clutch-step.pending .clutch-step-label {
  color: var(--muted);
}

.clutch-step.muted .clutch-step-dot {
  background: #ccc;
  border-color: #ccc;
}

.clutch-step.muted .clutch-step-label {
  color: var(--muted);
}

.clutch-step-date {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.clutch-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 반려동물 상세 브리딩 */
.pet-clutch-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.pet-clutch-row:last-child { border-bottom: none; }

.pet-clutch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* ── 홈 상태 카드 (Phase 1) ──────────────────────────────── */
/* 기획서 22-4: "오늘 우리 아이 상태"를 진행바·루틴보다 먼저 노출 */

.home-status-greeting {
  padding: 8px 4px 4px;
  margin-bottom: 4px;
}

.home-status-greeting h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text, #222);
  margin: 0 0 2px;
  line-height: 1.3;
}

.home-status-greeting p {
  font-size: var(--fs-base);
  color: var(--muted, #888);
  margin: 0;
}

/* 필터 바 + 뷰 토글 */
.home-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.home-filter-row .segmented { flex: 1; min-width: 0; }

.status-symptom {
  color: #c45a36;
  font-weight: 500;
}

/* 홈 화면 반려동물 이름 검색 */
.home-search-row {
  margin-bottom: 12px;
}

.home-search-input {
  width: 100%;
  min-height: 42px;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  padding: 10px 14px;
  background: #f7f8f9;
  color: var(--text);
  font-size: var(--fs-base);
  transition: border-color 0.15s;
}

.home-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

/* 펫 상세 메타 카드 — 빈 값 안내 */
.stat-hint {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted, #aaa);
  font-style: normal;
  line-height: 1.4;
}

/* 설정 안내 (알림 차단 등) */
.settings-hint {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: var(--fs-sm);
  color: var(--muted, #888);
  background: #fafafa;
  border-radius: 8px;
  line-height: 1.5;
}
.delegation-banner,
.backup-pending-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
  font-size: var(--fs-sm);
  color: #7a5800;
  cursor: pointer;
}
.delegation-banner span,
.backup-pending-banner span {
  margin-left: auto;
  font-weight: 600;
  color: #b36b00;
}
.delegation-date-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.delegation-date-row .field {
  flex: 1;
  min-width: 0;
}
.delegation-date-sep {
  padding-bottom: 12px;
  color: var(--muted);
  font-size: var(--fs-base);
  flex-shrink: 0;
}

/* ── 펫 삭제 확인 모달 ───────────────────────────────────── */
.confirm-modal {
  max-width: 360px;
  padding: 24px 22px calc(20px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.confirm-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff5ec;
  color: #c45a36;
  font-size: var(--fs-xl);
  font-weight: 700;
}

.confirm-modal h2 {
  margin: 0 0 12px;
  font-size: var(--fs-lg);
  font-weight: 700;
}

.confirm-modal p {
  margin: 0 0 8px;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text, #333);
}

.confirm-impact {
  list-style: none;
  padding: 12px 14px;
  margin: 12px 0;
  background: #fafafa;
  border-radius: 10px;
  text-align: left;
}

.confirm-impact li {
  font-size: var(--fs-sm);
  color: var(--text, #333);
  padding: 2px 0;
  position: relative;
  padding-left: 14px;
}

.confirm-impact li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: #c45a36;
  font-weight: 800;
}

.confirm-warn-text {
  font-size: var(--fs-sm) !important;
  color: var(--muted, #888) !important;
  margin: 4px 0 16px !important;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.confirm-actions button {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.confirm-actions .secondary {
  background: #f5f5f5;
  color: var(--text, #333);
}

.confirm-actions .danger {
  background: #c45a36;
  color: #fff;
}

.confirm-actions .danger:hover {
  background: #a84a2a;
}

/* ── 루틴 완료 메모 버튼 ──────────────────────────────────── */
.hcard-memo-btn {
  flex-shrink: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: #999;
  background: #f0f0f0;
  border: none;
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  opacity: 1;
  line-height: 1.4;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}
.hcard-memo-btn:active {
  background: #e0e0e0;
}
.hcard-memo-btn.has-memo {
  color: var(--primary);
  background: #e6f4ec;
}

/* ── 완료 메모 모달 ───────────────────────────────────────── */
.task-note-modal {
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.task-note-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.task-note-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.task-note-avatar-ph {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  flex-shrink: 0;
}

.task-note-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.task-note-textarea {
  width: 100%;
  height: 80px;
  border: 1.5px solid #eee;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: var(--fs-base);
  font-family: inherit;
  color: #1a1a1a;
  resize: none;
  box-sizing: border-box;
  background: #fafafa;
}
.task-note-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.task-note-photo-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--primary);
  background: #e6f4ec;
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.task-note-photo-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}
.task-note-photo-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}
.task-note-photo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: var(--fs-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-note-actions {
  display: flex;
  gap: 10px;
}
.task-note-actions button {
  flex: 1;
}

/* ── 이상증상 노트 (symptoms 아래 별도 줄) ───────────────── */
.record-note {
  color: var(--muted);
  margin-top: 3px;
}

/* ── 기록 사진 썸네일 ─────────────────────────────────────── */
.record-photo {
  margin-top: 8px;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* ── 타임라인 기록 행 — 메모 아이콘 정렬 ─────────────────── */
.record-body-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.record-body-row .small {
  flex: 1;
  min-width: 0;
}

/* ── 타임라인·달력 메모 보기 버튼 ────────────────────────── */
.record-memo-btn {
  flex-shrink: 0;
  font-size: var(--fs-md);
  line-height: 1;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.record-memo-btn:active {
  background: #f0f0f0;
}

/* ── 접종 이력 삭제 버튼 ────────────────────────── */
.record-delete-btn {
  background: none;
  border: none;
  padding: 0 0 0 6px;
  font-size: var(--fs-sm);
  cursor: pointer;
  opacity: 0.45;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
}
.record-delete-btn:active { opacity: 0.9; }

/* ── 상태 카드 메모 아이콘 버튼 ────────────────────────── */
.status-memo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-base);
  line-height: 1;
  background: none;
  border: none;
  padding: 2px 4px;
  margin-left: 2px;
  cursor: pointer;
  border-radius: 6px;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.status-memo-btn:active {
  background: rgba(0,0,0,0.06);
}

/* ── 피딩 세부 입력 필드 (단독/벌크 공용) ───────────────── */
.feeding-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.feeding-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feeding-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  width: 36px;
  flex-shrink: 0;
}
.feeding-select,
.feeding-input {
  flex: 1;
  font-size: var(--fs-base);
  padding: 8px 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.feeding-select:focus,
.feeding-input:focus {
  border-color: var(--primary);
  background: #fff;
}

/* ── 예방접종 이력 섹션 ──────────────────────────────────── */
.vac-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.vac-row:last-of-type { border-bottom: none; }
.vac-badge {
  font-size: var(--fs-sm);
  padding: 2px 8px;
  border-radius: 20px;
  background: #e5f3f0;
  color: #0d9488;
  white-space: nowrap;
}
.vac-badge.soon {
  background: #fff7ed;
  color: #ea580c;
}
.vac-badge.overdue {
  background: #fff1f2;
  color: #e11d48;
}
.vac-section-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 10px 0 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.vac-section-label:first-of-type {
  margin-top: 2px;
  padding-top: 0;
  border-top: none;
}
.vac-history-toggle {
  margin-top: 6px;
  cursor: pointer;
  color: var(--primary);
  font-size: var(--fs-sm);
}

/* ── 메모 보기 모달 — 텍스트 영역 ───────────────────────── */
.log-memo-view-text {
  font-size: var(--fs-base);
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8f8f8;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

/* ── 성장 앨범 ───────────────────────────────────────────── */
.album-month-group {
  margin-bottom: 16px;
}
.album-month-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 2px;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
.album-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: #f0f0f0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.album-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.album-cell:active .album-thumb {
  transform: scale(0.97);
}

/* ── 홈 카드 예방접종 섹션 ────────────────────────────────── */
.hcard-vac {
  padding: 8px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hcard-vac-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hcard-vac-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.hcard-vac-date {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-right: auto;
}

.hcard-vac-badge {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.hcard-vac-badge.overdue {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.hcard-vac-badge.soon {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

/* ── 스트릭 마일스톤 뱃지 모달 ────────────────────────────── */
.streak-milestones-modal {
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  max-height: 80vh;
  overflow-y: auto;
}

.streak-milestones-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.streak-ms-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 16px 24px;
  margin-bottom: 20px;
}

.streak-ms-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.streak-ms-val {
  font-size: var(--fs-2xl);
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.streak-ms-lbl {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 500;
}

.streak-ms-divider {
  width: 1px;
  height: 36px;
  background: var(--line);
  margin: 0 16px;
}

.streak-milestones-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

/* 뱃지 모달 탭 + 누적 마일스톤 */
.badge-tab-row {
  margin-bottom: 14px;
}
.total-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.total-metric-label {
  font-size: var(--fs-base);
  font-weight: 700;
}
.total-metric-count {
  font-size: var(--fs-sm);
  color: var(--muted);
}
.total-metric-count strong {
  color: var(--primary);
  font-size: var(--fs-base);
}
.total-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.total-grid .streak-milestone-item {
  padding: 8px 6px;
  gap: 3px;
}
.total-grid .streak-milestone-emoji {
  font-size: var(--fs-lg);
}

.streak-milestone-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  transition: opacity 0.2s;
}

.streak-milestone-item.achieved {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.streak-milestone-item.locked {
  opacity: 0.45;
}

.streak-milestone-emoji {
  font-size: var(--fs-2xl);
  line-height: 1;
}

.streak-milestone-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
}

.streak-milestone-item.achieved .streak-milestone-label {
  color: var(--primary);
}

.streak-ms-hint {
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 0;
}

/* ── 함께한 이야기 — 펫 평생 리포트 ───────────────────────── */
.life-report-modal {
  max-height: 85vh;
  overflow-y: auto;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.life-report-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.life-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0 14px;
}

.life-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.life-avatar-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: var(--surface-2, #f4f4f0);
}

.life-hero-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.life-days {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.life-section {
  margin-bottom: 14px;
}

.life-section-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 8px;
}

.life-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.life-row:last-of-type {
  border-bottom: 0;
}

.life-row span:last-child {
  color: var(--muted);
  text-align: right;
}

/* 건강 이력 — 접종 이력 서브행 (최근 2건 멀티라인) */
.life-row-sub {
  align-items: flex-start;
  font-size: var(--fs-xs);
}
.life-row-sub span:first-child {
  color: var(--muted);
}
.life-row-sub span:last-child {
  line-height: 1.7;
}
.life-row-indent span:first-child {
  padding-left: 24px; /* 위 💉 row 아이콘과 들여쓰기 정렬 */
}

/* 건강 이력 대분류 헤더 (💉 예방접종 / ⚠️ 이상증상) */
.life-group-head {
  border-bottom: 0;
  padding-bottom: 2px;
}
.life-group-head span:first-child {
  font-weight: 700;
  color: var(--text);
}
.life-group-head + .life-row-sub,
.life-row-sub + .life-row-sub {
  border-bottom: 0;
}

.life-first-photo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.life-first-photo img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
}

.life-first-photo .small {
  color: var(--muted);
}
