:root {
  --report-bg: #F7F8F5;
  --report-primary: #6FAF9A;
  --report-deep: #315B4E;
  --report-mint: #DDEFE7;
  --report-bluegray: #E7EEF1;
  --report-text: #25332E;
  --report-sub: #738079;
  --report-warning: #F6D8C8;
}

body {
  color: var(--report-text);
}

.app {
  background: var(--report-bg);
}

.report-scroll {
  padding-bottom: 22px;
}

.report-header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #F0F1F3;
  position: sticky;
  top: 0;
  z-index: 100;
}

.report-subtitle {
  margin-top: 6px;
  color: var(--report-sub);
  font-size: 14px;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.pet-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-top: 10px;
  padding: 6px 12px 6px 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--report-deep);
  border: 1px solid rgba(49, 91, 78, 0.1);
  box-shadow: 0 8px 22px rgba(49, 91, 78, 0.08);
  font-size: 14px;
  font-weight: 800;
}
.pet-select.static { cursor: default; }

.pet-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--report-mint);
  color: var(--report-deep);
  font-size: 13px;
}

.report-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin-top: 18px;
  padding: 5px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(49, 91, 78, 0.1);
}

.report-tabs button {
  height: 42px;
  border-radius: 6px;
  color: var(--report-sub);
  font-size: 14px;
  font-weight: 800;
  border: 1px solid #E4EAE7;
}

.report-tabs button.active {
  background: var(--report-mint);
  color: var(--report-deep);
  box-shadow: inset 0 0 0 1px rgba(111, 175, 154, 0.35);
}

.report-card,
.metric-card {
  background: #fff;
  border: 1px solid rgba(49, 91, 78, 0.08);
  box-shadow: 0 10px 28px rgba(49, 91, 78, 0.07);
}

.report-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 11px;
}

.hero-summary {
  background:
    linear-gradient(135deg, rgba(221, 239, 231, 0.95), rgba(255, 255, 255, 0.96)),
    #fff;
}

.card-kicker {
  color: var(--report-deep);
  font-size: 12px;
  font-weight: 800;
}

.hero-summary h2,
.empty-report h2 {
  margin-top: 7px;
  font-size: 18px;
  letter-spacing: 0;
}

.hero-summary p {
  margin-top: 10px;
  color: var(--report-text);
  font-size: 14px;
  line-height: 1.65;
}

.hero-summary .safe-note {
  margin-top: 14px;
  padding: 12px 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--report-sub);
  font-size: 12px;
}

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

.metric-card {
  min-width: 0;
  min-height: 142px;
  padding: 15px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--report-mint);
  color: var(--report-deep);
  font-size: 21px;
}

.metric-label {
  margin-top: 12px;
  color: var(--report-sub);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  margin-top: 4px;
  color: var(--report-text);
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0;
}

.metric-card small {
  margin-top: auto;
  color: var(--report-sub);
  font-size: 12px;
  line-height: 1.35;
}

.section-head.tight {
  margin-bottom: 14px;
}

.section-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--report-mint);
  color: var(--report-deep);
  font-size: 12px;
  font-weight: 800;
}

.section-copy {
  margin-top: 14px;
  color: var(--report-sub);
  font-size: 13px;
  line-height: 1.55;
}

.stacked-progress {
  display: flex;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--report-bluegray);
}

.stacked-progress span {
  display: block;
  min-width: 3px;
}

.complete {
  background: var(--report-primary);
}

.missed {
  background: var(--report-warning);
}

.late {
  background: #BCD7E2;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
  color: var(--report-sub);
  font-size: 12px;
}

.legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: static;
  border: 0;
}

.bar-list,
.meal-list {
  display: grid;
  gap: 12px;
}

.bar-row,
.meal-row {
  display: grid;
  grid-template-columns: minmax(72px, 88px) 1fr minmax(28px, auto);
  align-items: center;
  gap: 10px;
  color: var(--report-text);
  font-size: 13px;
}

.bar-track,
.meal-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--report-bluegray);
}

.bar-track i,
.meal-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--report-primary);
}

.meal-track i {
  background: var(--report-deep);
  opacity: 0.82;
}

.bar-count,
.meal-count {
  color: var(--report-sub);
  font-weight: 800;
  text-align: right;
}

.weight-main {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) 1.2fr;
  gap: 12px;
  align-items: center;
}

.weight-main span {
  color: var(--report-sub);
  font-size: 12px;
  font-weight: 700;
}

.weight-main strong {
  display: block;
  margin-top: 5px;
  color: var(--report-deep);
  font-size: 30px;
  letter-spacing: 0;
}

.line-chart {
  width: 100%;
  height: auto;
}

.line-chart polyline {
  fill: none;
  stroke: var(--report-primary);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart circle {
  fill: #fff;
  stroke: var(--report-deep);
  stroke-width: 3;
}

.hospital-box,
.test-result {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 10px;
  background: var(--report-bg);
}

.hospital-box > .material-symbols-rounded,
.test-result > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fff;
  color: var(--report-deep);
  flex-shrink: 0;
}

.hospital-box strong,
.test-result strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.hospital-box p,
.test-result span,
.test-result small {
  display: block;
  margin-top: 3px;
  color: var(--report-sub);
  font-size: 12px;
  line-height: 1.45;
}

.check-summary {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  list-style: none;
}

.check-summary li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--report-sub);
  font-size: 13px;
}

.check-summary li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--report-primary);
  flex-shrink: 0;
}

.test-result {
  margin-bottom: 14px;
}

.empty-report {
  text-align: center;
  margin-bottom: 6px;
}

.empty-report > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 11px;
  background: var(--report-bluegray);
  color: var(--report-deep);
  font-size: 28px;
}

.empty-report p {
  margin: 8px 0 16px;
  color: var(--report-sub);
  font-size: 13px;
  line-height: 1.55;
}

.report-modal {
  position: absolute;
  inset: 0;
  z-index: 250;
  display: none;
}

.report-modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 26, 0.42);
}

.modal-panel {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  padding: 18px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  font-size: 18px;
}

.modal-panel p {
  margin-top: 12px;
  color: var(--report-sub);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
}

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

.modal-actions .btn {
  min-height: 46px;
  padding: 0 12px;
}

@media (max-width: 370px) {
  .report-scroll {
    padding-left: 18px;
    padding-right: 18px;
  }

  .report-card {
    padding: 16px;
  }

  .metric-card {
    min-height: 136px;
    padding: 13px;
  }

  .metric-card strong {
    font-size: 23px;
  }

  .bar-row,
  .meal-row {
    grid-template-columns: minmax(62px, 78px) 1fr minmax(24px, auto);
    gap: 8px;
    font-size: 12px;
  }

  .weight-main {
    grid-template-columns: 1fr;
  }
}

/* ── 기간 직접 지정 ─────────────────────────────────── */
.report-range {
  display: flex; align-items: flex-end; gap: 8px;
  margin: 12px 0 4px;
}
.report-range .rr-field { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.report-range .rr-label { font-size: 12px; font-weight: 600; color: var(--report-sub, #777); }
.report-range .rr-tilde { padding-bottom: 12px; color: var(--report-sub, #999); }
.report-range .btn { flex: 0 0 auto; padding: 0 16px; min-height: 0; height: 47px; align-self: flex-end; }
