*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: #f5f5f5;
  color: #212121;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
}

/* ─── Views ─── */
.view { display: none; min-height: 100vh; flex-direction: column; }
.view.active { display: flex; }

/* ─── Hero (Login top section) ─── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 24px;
  background: #fff;
}

.hero-title {
  font-size: 22px;
  font-weight: 800;
  color: #1565C0;
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

.hero-image {
  width: 220px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-photo {
  background: #66BB6A;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 48px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* ─── Auth Card (Login form card) ─── */
.auth-card {
  background: #fff;
  border-top: 1px solid #e0e0e0;
  flex: 1;
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
}

.tab {
  flex: 1;
  padding: 14px;
  background: #f5f5f5;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: #757575;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.active {
  background: #fff;
  color: #212121;
  font-weight: 700;
  border-bottom: 2px solid #1565C0;
}

.login-form {
  padding: 20px 20px 32px;
}

/* ─── Input rows ─── */
.input-row {
  display: flex;
  align-items: center;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  margin-bottom: 8px;
  background: #fff;
  overflow: hidden;
}

.input-row input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  outline: none;
  font-size: 15px;
  color: #212121;
  background: transparent;
}

.input-row input::placeholder { color: #9e9e9e; }

.req {
  color: #e53935;
  font-size: 14px;
  padding-right: 10px;
  flex-shrink: 0;
}

.login-error {
  color: #e53935;
  font-size: 13px;
  margin-bottom: 8px;
  min-height: 18px;
}

.btn-dark {
  width: 100%;
  padding: 14px;
  background: #212121;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}

.login-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #424242;
  cursor: pointer;
}

.find-link {
  font-size: 14px;
  color: #424242;
  text-decoration: none;
}

.find-link:hover { text-decoration: underline; }

/* ─── Inner Header ─── */
.inner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  color: #1565C0;
}

.header-icon {
  background: none;
  border: none;
  font-size: 20px;
  color: #424242;
  cursor: pointer;
  padding: 4px 8px;
}

/* ─── View body ─── */
.view-body {
  padding: 0 0 80px;
  flex: 1;
}

.page-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  padding: 20px 16px 16px;
  color: #212121;
}

/* ─── Form Cards ─── */
.form-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  margin: 0 0 8px;
}

.form-card-title {
  background: #ECEFF1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #37474F;
  border-bottom: 1px solid #e0e0e0;
}

.field-block {
  padding: 12px 16px 4px;
}

.field-label {
  display: block;
  font-size: 14px;
  color: #424242;
  margin-bottom: 6px;
}

.form-card .input-row {
  margin: 0 16px 12px;
}

.field-block .input-row {
  margin: 0 0 0;
}

/* ─── Gender select ─── */
.input-row select {
  flex: 1;
  padding: 12px 14px;
  border: none;
  outline: none;
  font-size: 15px;
  color: #212121;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

/* ─── Captcha ─── */
.captcha-audio-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 8px;
}

.audio-btn {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: #424242;
  padding: 2px;
}

.audio-time {
  font-size: 12px;
  color: #616161;
}

.audio-bar-wrap {
  flex: 1;
  height: 4px;
  background: #bdbdbd;
  border-radius: 2px;
  overflow: hidden;
}

.audio-bar-inner {
  width: 0%;
  height: 100%;
  background: #424242;
}

.captcha-img-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 4px;
}

.captcha-img-row canvas {
  flex: 1;
  display: block;
  border-radius: 4px;
}

.captcha-req-row {
  padding: 0 16px 4px;
}

.btn-refresh {
  background: none;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  color: #616161;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── Form error / footer ─── */
.form-error {
  color: #e53935;
  font-size: 13px;
  text-align: center;
  padding: 8px 16px 0;
  min-height: 20px;
}

.form-footer {
  display: flex;
  gap: 8px;
  padding: 16px;
}

.btn-cancel {
  flex: 1;
  padding: 14px;
  background: #fff;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  color: #424242;
  cursor: pointer;
}

.btn-primary {
  flex: 1;
  padding: 14px;
  background: #1565C0;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Terms ─── */
.terms-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #E3F2FD;
  margin: 0 0 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: #1565C0;
  line-height: 1.5;
}

.notice-check {
  color: #1565C0;
  font-size: 16px;
  flex-shrink: 0;
  font-weight: 700;
}

.terms-section {
  border: 1px solid #e0e0e0;
  margin-bottom: 8px;
}

.terms-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ECEFF1;
  font-size: 14px;
  font-weight: 600;
  color: #37474F;
  border-bottom: 1px solid #e0e0e0;
}

.terms-cb {
  width: 18px;
  height: 18px;
  accent-color: #1565C0;
  cursor: pointer;
}

.terms-section-body {
  padding: 14px 16px;
  font-size: 13px;
  color: #424242;
  line-height: 1.6;
  max-height: 160px;
  overflow-y: auto;
}

.terms-section-body.small p { margin-bottom: 6px; }
.terms-section-body.small ul { padding-left: 16px; margin-bottom: 6px; }
.terms-section-body.small li { margin-bottom: 2px; }

.terms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.terms-table th, .terms-table td {
  border: 1px solid #bdbdbd;
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  word-break: keep-all;
}

.terms-table th {
  background: #f5f5f5;
  font-weight: 600;
}

.terms-all {
  padding: 16px;
  border-top: 1px solid #e0e0e0;
  margin-top: 8px;
}

.terms-all-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #212121;
  cursor: pointer;
}

.terms-all-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1565C0;
}

/* ─── Success ─── */
#view-success {
  justify-content: space-between;
}

.success-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 32px;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.success-title {
  font-size: 18px;
  font-weight: 700;
  color: #1565C0;
  text-align: center;
  margin-bottom: 24px;
}

.success-body {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
  font-size: 14px;
  color: #424242;
  line-height: 1.8;
  width: 100%;
  margin-bottom: 32px;
}

.success-body p { margin-bottom: 8px; }
.success-body p:last-child { margin-bottom: 0; }

.btn-main {
  width: 100%;
  padding: 16px;
  background: #1565C0;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

/* ─── Bottom Nav ─── */
.bottom-nav {
  display: flex;
  border-top: 1px solid #e0e0e0;
  background: #fff;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0 14px;
  background: none;
  border: none;
  font-size: 11px;
  color: #757575;
  cursor: pointer;
}

.nav-btn svg { color: #757575; }
.nav-btn.active { color: #1565C0; }
.nav-btn.active svg { color: #1565C0; }

/* ─── Home View ─── */
#view-home {
  background: #eeeeee;
  flex-direction: column;
}

.home-header {
  display: flex;
  align-items: center;
  background: #1E88E5;
  padding: 10px 16px;
  gap: 10px;
}

.home-hamburger {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
}

.home-header-title {
  flex: 1;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.home-add-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.hint-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.hint-text {
  text-align: center;
  width: 100%;
}

.hint-line1 {
  font-size: 15px;
  color: #1565C0;
  margin-bottom: 2px;
}

.hint-line2 {
  font-size: 15px;
  font-weight: 700;
  color: #1565C0;
  line-height: 1.5;
}

.hint-arrow-svg {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.calendar-wrap {
  background: #eeeeee;
  padding: 0 0 4px;
  position: relative;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 12px 6px;
  background: #eeeeee;
}

.cal-nav-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #424242;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
}

.cal-month-label {
  font-size: 18px;
  font-weight: 700;
  color: #212121;
  min-width: 110px;
  text-align: center;
}

.cal-head-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-head {
  text-align: center;
  font-size: 13px;
  color: #616161;
  padding: 8px 0;
}

.cal-head.sun { color: #e53935; }
.cal-head.sat { color: #1e88e5; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  text-align: center;
  padding: 6px 0;
  font-size: 15px;
  color: #212121;
  cursor: pointer;
  background: #eeeeee;
  border-top: 1px solid #d0d0d0;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.cal-dot-wrap {
  display: flex;
  gap: 2px;
  justify-content: center;
}

.cal-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid #616161;
  flex-shrink: 0;
}

.cal-indicator.success {
  background: #212121;
  border-color: #212121;
}

.cal-day:hover { background: #e0e0e0; }
.cal-day.sun { color: #e53935; }
.cal-day.sat { color: #1e88e5; }
.cal-day.empty { cursor: default; }

.cal-day.today {
  border: 2px solid #1565C0;
  font-weight: 700;
  color: #1565C0;
}

.cal-day.selected {
  background: #1E88E5;
  color: #fff !important;
  font-weight: 700;
}

.home-stats {
  background: #eeeeee;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-box {
  background: #fff;
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  justify-content: center;
  gap: 40px;
  align-items: center;
}

.stats-box:last-child {
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  justify-content: flex-start;
}

.success-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #212121;
}

.circle {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.circle.filled { background: #212121; }
.circle.empty  { border: 2px solid #212121; background: transparent; }

.stats-divider { display: none; }

.stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: #212121;
  padding: 4px 0;
}

.stats-value {
  color: #212121;
  font-weight: 400;
}

.day-section {
  flex: 1;
  background: #eeeeee;
  padding: 16px 16px 80px;
}

.day-title {
  font-size: 15px;
  font-weight: 700;
  color: #212121;
  margin-bottom: 12px;
}

/* ─── 기록 목록 ─── */
.day-record-item {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  gap: 12px;
}

.record-time {
  font-size: 15px;
  font-weight: 600;
  color: #212121;
  min-width: 48px;
}

.record-status {
  flex: 1;
  font-size: 15px;
  color: #424242;
}

.record-actions {
  display: flex;
  gap: 6px;
}

.record-act-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #9e9e9e;
}

.record-act-btn:hover { color: #424242; }

.no-records-box {
  border: 2px dashed #bdbdbd;
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: #9e9e9e;
  font-size: 14px;
  line-height: 2;
  background: #fff;
}

/* ─── 배변 등록 페이지 ─── */
#view-record {
  background: #f5f5f5;
  flex-direction: column;
}

.record-body {
  flex: 1;
  padding: 0 16px 100px;
}

.record-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  padding: 24px 0 8px;
  color: #212121;
}

.record-subtitle {
  font-size: 14px;
  color: #424242;
  margin-bottom: 20px;
  padding: 0 4px;
}

.record-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 16px 20px;
  margin-bottom: 12px;
}

.record-card-label {
  font-size: 15px;
  font-weight: 700;
  color: #212121;
  margin-bottom: 14px;
}

.datetime-row {
  display: flex;
  gap: 10px;
}

.datetime-btn {
  flex: 1;
  padding: 12px 8px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: #212121;
  cursor: pointer;
  text-align: center;
}

.success-options {
  display: flex;
  gap: 10px;
}

.option-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  font-size: 15px;
  color: #212121;
}

.option-btn input[type="radio"] { display: none; }

.option-circle {
  width: 20px;
  height: 20px;
  border: 2px solid #9e9e9e;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-btn input:checked ~ .option-circle {
  border-color: #1E88E5;
}

.option-btn input:checked ~ .option-circle::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #1E88E5;
  border-radius: 50%;
}

.option-btn input:checked ~ .option-text {
  color: #1E88E5;
  font-weight: 600;
}

.option-btn:has(input:checked) {
  border-color: #1E88E5;
}

.option-btn input:checked ~ .option-circle {
  background: #1E88E5;
  border-color: #1E88E5;
}

.option-btn input:checked ~ .option-circle::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

/* ─── 등록 페이지1 ─── */
.r1-body { background: #f5f5f5; }

.record-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 16px;
}

.rdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #bdbdbd;
}

.rdot.active { background: #1E88E5; }

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #9e9e9e;
  background: none;
  font-size: 11px;
  color: #757575;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 4px;
  font-weight: 600;
}

.duration-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.duration-options .option-btn {
  flex: 1 1 calc(33.333% - 7px);
  min-width: 0;
}

.record-card-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #212121;
}

.shape-desc {
  font-size: 14px;
  color: #1E88E5;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.custom-direct-input {
  margin-top: 8px;
}

.shape-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.shape-item {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #f5f5f5;
  aspect-ratio: 1;
}

.shape-item.selected { border-color: #1E88E5; }

.shape-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── 등록 페이지2/3 공통 ─── */
.btn-all-none {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: #424242;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
}

.btn-all-none:active { background: #f5f5f5; }

.btn-all-none.triggered {
  border-color: #1E88E5;
  background: #E3F2FD;
  color: #1E88E5;
  font-weight: 600;
}

/* 세부 약물 정보 */
.med-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0f0f0;
  display: none;
}

.med-detail.show { display: block; }

.field-sub-label {
  font-size: 14px;
  font-weight: 600;
  color: #424242;
  margin: 12px 0 6px;
}

.field-select-wrap {
  position: relative;
}

.field-select-wrap select {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: #212121;
  appearance: none;
  cursor: pointer;
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #757575;
  font-size: 14px;
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  color: #212121;
  background: #fff;
}

.field-input:focus, .field-select-wrap select:focus {
  outline: none;
  border-color: #1E88E5;
}

.record-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 0;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}

.record-footer .btn-cancel {
  flex: 1;
  padding: 16px;
  border-radius: 0;
  border: none;
  border-right: 1px solid #e0e0e0;
  font-size: 16px;
}

.record-footer .btn-primary {
  flex: 1;
  padding: 16px;
  border-radius: 0;
  font-size: 16px;
}

/* ─── 네비게이션 드로어 ─── */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.nav-backdrop.open { opacity: 1; pointer-events: auto; }

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #fff;
  z-index: 501;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.nav-drawer.open { transform: translateX(0); }

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.nav-user-title {
  font-size: 16px;
  font-weight: 700;
  color: #212121;
}

.nav-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #757575;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.nav-menu {
  list-style: none;
  flex: 1;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  font-size: 16px;
  color: #212121;
  cursor: pointer;
}

.nav-item:hover { background: #f5f5f5; }

.nav-icon {
  display: flex;
  align-items: center;
  width: 24px;
  flex-shrink: 0;
}

.nav-footer {
  padding: 20px 24px;
  border-top: 1px solid #f0f0f0;
}

.nav-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  font-size: 15px;
  color: #757575;
  cursor: pointer;
  padding: 0;
}

/* ─── 통계 페이지 ─── */
.stats-page-body {
  flex: 1;
  background: #f5f5f5;
  padding: 0 16px 40px;
  overflow-y: auto;
}

.stats-page-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  padding: 20px 0 8px;
  color: #212121;
}

.stats-week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.stats-week-label {
  font-size: 14px;
  color: #424242;
  font-weight: 500;
  min-width: 180px;
  text-align: center;
}

.stats-week-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #9e9e9e;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

.stat-boxes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.stat-box-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 14px 12px;
  position: relative;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-box-card.cyan   { border: 1.5px solid #00BCD4; }
.stat-box-card.pink   { border: 1.5px solid #E91E63; }
.stat-box-card.green  { border: 1.5px solid #4CAF50; }
.stat-box-card.yellow { border: 1.5px solid #FF9800; }

.stat-box-label {
  font-size: 13px;
  color: #757575;
  margin-bottom: 6px;
}

.stat-box-val {
  font-size: 26px;
  font-weight: 700;
}

.stat-box-card.cyan   .stat-box-val { color: #00BCD4; }
.stat-box-card.pink   .stat-box-val { color: #E91E63; }
.stat-box-card.green  .stat-box-val { color: #4CAF50; }
.stat-box-card.yellow .stat-box-val { color: #FF9800; }

.stat-box-icon {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 24px;
}

.stats-section-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px 20px;
  margin-bottom: 10px;
}

.stats-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #212121;
  margin-bottom: 16px;
}

.stats-num-row {
  display: flex;
  justify-content: space-around;
}

.stats-num-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stats-big-num {
  font-size: 32px;
  font-weight: 700;
  color: #212121;
  line-height: 1;
}

.stats-num-label {
  font-size: 13px;
  color: #9e9e9e;
}

.stat-shape-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  color: #424242;
}

.stat-shape-row:last-child { border-bottom: none; }

.stat-shape-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4CAF50;
  flex-shrink: 0;
}

.stat-shape-dot.red { background: #E53935; }

.stat-shape-label { flex: 1; }

.stat-shape-count {
  font-size: 14px;
  color: #424242;
  white-space: nowrap;
}

/* ─── 피커 공통 ─── */
.picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.picker-overlay[hidden] {
  display: none;
}

.picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

.picker-sheet {
  position: relative;
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px 16px 12px;
  z-index: 1;
}

.picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding-top: 12px;
}

.picker-cancel {
  background: none;
  border: none;
  font-size: 15px;
  color: #1E88E5;
  cursor: pointer;
  font-weight: 500;
}

.picker-ok {
  background: none;
  border: none;
  font-size: 15px;
  color: #1E88E5;
  cursor: pointer;
  font-weight: 700;
}

/* ─── 날짜 피커 ─── */
.dp-nav-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 12px;
}

.dp-arrow {
  background: none;
  border: none;
  font-size: 22px;
  color: #424242;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
}

.dp-label {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: #212121;
  cursor: pointer;
  padding: 4px 8px;
}

.dp-head-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 4px;
}

.dp-head-row span {
  font-size: 13px;
  color: #757575;
  padding: 4px 0;
}

.dp-head-sun { color: #e53935 !important; }
.dp-head-sat { color: #1e88e5 !important; }

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dp-day {
  text-align: center;
  padding: 8px 0;
  font-size: 14px;
  color: #212121;
  cursor: pointer;
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-day:hover { background: #f0f0f0; }
.dp-day.other { color: #bdbdbd; }
.dp-day.sun   { color: #e53935; }
.dp-day.sat   { color: #1e88e5; }

.dp-day.today {
  border: 1.5px solid #1E88E5;
  color: #1E88E5;
  font-weight: 700;
}

.dp-day.selected {
  background: #1E88E5;
  color: #fff !important;
  font-weight: 700;
}

/* ─── 시간 목록 드롭다운 ─── */
.time-list-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
}

.time-list-backdrop[hidden] { display: none; }

.time-list {
  position: fixed;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  overflow-y: auto;
  max-height: 220px;
  width: 180px;
  z-index: 200;
}

.time-list[hidden] { display: none; }

.time-list-item {
  padding: 13px 18px;
  font-size: 15px;
  color: #212121;
  cursor: pointer;
  white-space: nowrap;
}

.time-list-item:hover { background: #f5f5f5; }
.time-list-item.selected { background: #eeeeee; }
