/* Vita Health 365 — /mypage/wellness/check-in/history
 *
 * Trend cards + weekly log table, ported from
 * /wellness/checkin/history/index.html. The visual identity matches
 * the existing history page so members get the same data presentation
 * they're used to — only the outer shell changes (mypage chrome
 * instead of /wellness/* qm-nav).
 */

:root {
  --vdw-bg:        #FBF7EE;
  --vdw-card:      #FFFFFF;
  --vdw-border:    #E6DFCF;
  --vdw-ink:       #1B1F18;
  --vdw-quiet:     #80847A;
  --vdw-forest:    #2C3D2A;
  --vdw-terracotta:#C8674C;
}

.vdw-history-shell {
  max-width: 920px; margin: 0 auto;
  padding: 12px clamp(16px, 3vw, 28px) 40px;
  color: var(--vdw-ink);
}
.vdw-history-shell,
.vdw-history-shell * {
  font-family: 'Noto Sans', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
}

.vdw-back { color: var(--vdw-quiet); font-size: 13px; text-decoration: none; }
.vdw-back:hover { color: var(--vdw-forest); text-decoration: underline; }

.vdw-h1 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 600;
  font-size: clamp(26px, 4vw, 32px); line-height: 1.2;
  color: var(--vdw-ink); margin: 12px 0 8px;
}
.vdw-lede {
  color: var(--vdw-quiet); font-size: 14.5px; line-height: 1.55;
  margin: 0 0 24px; max-width: 560px;
}

/* Trend cards (sparkline + headline number) */
.vdw-trend-grid {
  display: grid; gap: 14px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.vdw-trend-card {
  background: var(--vdw-card); border: 1px solid var(--vdw-border);
  border-radius: 14px; padding: 16px 18px;
}
.vdw-trend-label {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--vdw-quiet); font-weight: 600;
}
.vdw-trend-value {
  font-family: 'Fraunces', Georgia, serif; font-weight: 500;
  font-size: 28px; color: var(--vdw-ink);
  margin: 6px 0 4px; line-height: 1;
  font-feature-settings: "tnum";
}
.vdw-trend-delta { font-size: 12px; color: var(--vdw-quiet); }
.vdw-trend-delta.up   { color: #8a3d1d; }
.vdw-trend-delta.down { color: var(--vdw-forest); }
.vdw-trend-spark { margin-top: 10px; }

/* History table */
.vdw-card {
  background: var(--vdw-card); border: 1px solid var(--vdw-border);
  border-radius: 14px; padding: 20px 22px; margin-bottom: 14px;
}
.vdw-card h2 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 600;
  font-size: 18px; margin: 0 0 12px;
}
.vdw-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.vdw-table th, .vdw-table td {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--vdw-border);
  font-variant-numeric: tabular-nums;
}
.vdw-table th {
  font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--vdw-quiet); font-weight: 600;
}
.vdw-table tbody tr:last-child td { border-bottom: none; }
.vdw-table td.dim { color: var(--vdw-quiet); }
.vdw-table .completion {
  display: inline-flex; align-items: center; gap: 8px;
}
.vdw-table .bar {
  width: 60px; height: 6px; background: var(--vdw-border);
  border-radius: 999px; overflow: hidden;
}
.vdw-table .bar-fill { height: 100%; background: var(--vdw-forest); }

.vdw-empty {
  text-align: center; padding: 56px 24px; color: var(--vdw-quiet);
}
.vdw-empty h2 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 600;
  font-size: 20px; color: var(--vdw-ink); margin: 0 0 10px;
}
.vdw-empty .vdw-cta {
  display: inline-block; background: var(--vdw-forest); color: white;
  padding: 10px 22px; border-radius: 10px; text-decoration: none;
  font-size: 14px; font-weight: 600; margin-top: 12px;
}

.vdw-loading { text-align: center; padding: 36px 20px; color: var(--vdw-quiet); }

/* Per-row expanded analysis */
.vdw-row-detail {
  background: #F4EFDF; font-size: 13px; line-height: 1.6;
  padding: 14px 16px; color: var(--vdw-ink);
}
.vdw-row-detail h4 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 600;
  font-size: 13.5px; margin: 0 0 6px; color: var(--vdw-forest);
}
.vdw-row-detail .group { margin-bottom: 10px; }
.vdw-row-detail .group:last-child { margin-bottom: 0; }
.vdw-row-detail .focus {
  background: #FFFBF2; border: 1px solid #E8B88A; border-radius: 8px;
  padding: 8px 12px; margin-top: 4px;
}
.vdw-row-toggle {
  background: none; border: none; color: var(--vdw-forest);
  font-size: 12px; cursor: pointer; padding: 0; font-weight: 600;
}
.vdw-row-toggle:hover { text-decoration: underline; }

/* i18n */
.vdw-i18n [data-i18n]      { display: none; }
.vdw-i18n [data-i18n="en"] { display: inline; }
html[data-lang="ko"] .vdw-i18n [data-i18n="en"] { display: none; }
html[data-lang="ko"] .vdw-i18n [data-i18n="ko"] { display: inline; }

@media (max-width: 720px) {
  .vdw-table { font-size: 12px; }
  .vdw-table th, .vdw-table td { padding: 8px 6px; }
  .vdw-table .bar { width: 36px; }
}
