/* ─────────────────────────────────────────────────────────────
   phase4.css · Phase 4 depth surfaces
   4.1 Trend Detail, 4.2 Change-Log History,
   4.3 Product Attachments, 4.4 7-Day Strip
   ───────────────────────────────────────────────────────────── */

/* ══════════════════════════════════════════════════════════════
   4.1 — TREND DETAIL PAGE
   ══════════════════════════════════════════════════════════════ */

.td-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.trend-header {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.trend-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.trend-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.td-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2f20, #2a5a38);
  border: 2px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--mint);
  flex-shrink: 0;
}

.td-identity { display: flex; flex-direction: column; gap: 4px; }
.td-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.td-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.td-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.trend-header-right { display: flex; align-items: center; }

.td-window-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-raised);
  border-radius: var(--r-pill);
  padding: 3px;
}
.td-toggle-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 120ms;
}
.td-toggle-btn.active {
  background: var(--mint-dim);
  border-color: var(--border-mid);
  color: var(--mint);
}
.td-toggle-btn:not(.active):not([disabled]):hover {
  background: var(--surface-2);
  color: var(--text);
}
.td-toggle-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.td-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.td-meta-date { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.td-meta-sep { color: var(--text-subtle); font-size: 0.82rem; }
.td-meta-completeness {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78rem; color: var(--text-muted);
}
.td-completeness-bar {
  width: 60px; height: 6px;
  background: var(--bg-raised);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.td-completeness-fill {
  display: block; height: 100%;
  background: var(--mint);
  border-radius: var(--r-pill);
}

/* Chart cards */
.td-charts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.td-chart-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.td-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.td-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--mint);
  margin-bottom: 2px;
}

.td-chart-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin: 0;
}

.td-callout {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}
.td-callout-value { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.td-callout-delta { font-size: 0.78rem; font-weight: 600; }
.td-callout-delta.down { color: var(--mint); }
.td-callout-delta.up { color: var(--amber); }

/* SVG charts */
.td-chart-area {
  background: var(--bg-raised);
  border-radius: var(--r-sm);
  overflow: hidden;
  position: relative;
}
.td-chart-svg {
  width: 100%;
  height: 160px;
  display: block;
}
.td-x-axis {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px 2px;
}
.td-x-axis span {
  font-size: 0.62rem;
  color: var(--text-subtle);
}

/* Macro strips */
.td-macro-strips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.td-mini-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.td-mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.td-mini-title { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.td-mini-callout { display: flex; align-items: baseline; gap: 6px; }
.td-mini-value { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.td-mini-delta { font-size: 0.72rem; font-weight: 600; }
.td-mini-delta.up { color: var(--mint); }
.td-mini-delta.down { color: var(--blue); }

.td-mini-chart {
  background: var(--bg-raised);
  border-radius: var(--r-sm);
  overflow: hidden;
  height: 60px;
}
.td-mini-svg { width: 100%; height: 100%; display: block; }

/* Bar chart (training) */
.td-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  background: var(--bg-raised);
  border-radius: var(--r-sm);
  padding: 4px 6px;
}
.td-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: opacity 120ms;
}
.td-bar.active { background: var(--mint); opacity: 0.75; }
.td-bar.rest { background: var(--text-subtle); opacity: 0.3; }
.td-bar:hover { opacity: 1; }

/* Recovery grid */
.td-recovery-section { margin-top: 0; }
.td-recovery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Change-log timeline in trend page */
.td-changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 8px;
}

.td-tl-entry {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 20px;
}
.td-tl-entry.last { padding-bottom: 0; }

.td-tl-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.td-tl-dot.nutrition { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.td-tl-dot.training { background: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,0.12); }
.td-tl-dot.recovery { background: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,0.12); }
.td-tl-dot.phase { background: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.td-tl-dot.supplements { background: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }

.td-tl-connector {
  position: absolute;
  left: 14px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--border-soft);
}

.td-tl-content { flex: 1; min-width: 0; }
.td-tl-date { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.td-tl-what { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.td-tl-why { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; }

.td-tl-diff {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.td-diff-before {
  font-size: 0.78rem; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-sm); padding: 4px 10px;
  text-decoration: line-through;
}
.td-diff-arrow { color: var(--mint); font-size: 0.85rem; font-weight: 700; }
.td-diff-after {
  font-size: 0.78rem; font-weight: 700; color: var(--mint);
  background: var(--mint-dim); border: 1px solid var(--border-mid);
  border-radius: var(--r-sm); padding: 4px 10px;
}

/* Paywall */
.td-paywall {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  min-height: 200px;
}
.td-paywall-blur {
  filter: blur(6px);
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
  padding: 20px;
}
.td-paywall-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 24px;
  background: linear-gradient(180deg, rgba(13,17,23,0.2) 0%, rgba(13,17,23,0.75) 35%, rgba(13,17,23,0.9) 100%);
  z-index: 2;
}
.td-paywall-icon { font-size: 1.8rem; margin-bottom: 8px; }
.td-paywall-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.td-paywall-desc { font-size: 0.82rem; color: var(--text-muted); max-width: 520px; line-height: 1.5; margin-bottom: 12px; }
.td-paywall-btn { margin-top: 4px; }

.td-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 0.9rem;
}

.td-back-link {
  margin-top: 20px;
  text-align: center;
}
.td-back-link a {
  color: var(--mint);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.td-back-link a:hover { opacity: 0.8; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--r-pill, 999px);
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 120ms, transform 80ms;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--mint);
  color: #051a0e;
  box-shadow: 0 4px 16px rgba(74, 222, 128, 0.22);
}


/* ══════════════════════════════════════════════════════════════
   4.2 — CHANGE-LOG HISTORY PAGE
   ══════════════════════════════════════════════════════════════ */

.clp-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.clp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  padding: 16px 22px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.clp-header-left { display: flex; align-items: center; gap: 14px; }
.clp-identity { display: flex; flex-direction: column; gap: 4px; }
.clp-page-title { font-size: 1.25rem; font-weight: 700; color: var(--text); line-height: 1.2; margin: 0; }
.clp-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.clp-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.clp-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.clp-chip {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms;
}
.clp-chip.active {
  background: var(--mint-dim);
  border-color: var(--mint);
  color: var(--mint);
}

/* Timeline */
.clp-timeline { position: relative; padding-left: 0; }

.clp-event {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0 20px;
  margin-bottom: 0;
}

.clp-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.clp-date-badge {
  font-size: 0.75rem; font-weight: 700; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 5px 12px;
  white-space: nowrap;
  margin-bottom: 8px;
  text-align: center;
}
.clp-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.clp-dot--nutrition { background: #f47174; }
.clp-dot--training { background: #60a5fa; }
.clp-dot--supplements { background: var(--mint); }
.clp-dot--phase { background: var(--amber); }
.clp-dot--recovery { background: #a78bfa; }

.clp-line {
  width: 2px; flex: 1;
  background: var(--border-soft);
  margin-top: 4px;
}

.clp-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 180ms;
}
.clp-card:hover { border-color: var(--border-mid); }

.clp-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.clp-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--r-pill);
  padding: 4px 12px;
}
.clp-cat--nutrition { background: rgba(244,113,116,0.10); color: #f47174; border: 1px solid rgba(244,113,116,0.20); }
.clp-cat--training { background: rgba(96,165,250,0.10); color: #60a5fa; border: 1px solid rgba(96,165,250,0.20); }
.clp-cat--supplements { background: var(--mint-dim); color: var(--mint); border: 1px solid var(--border-mid); }
.clp-cat--phase { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.clp-cat--recovery { background: rgba(167,139,250,0.10); color: #a78bfa; border: 1px solid rgba(167,139,250,0.20); }

.clp-what { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.clp-why { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }

.clp-diffs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.clp-diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
}
.clp-diff-old { color: var(--text-muted); text-decoration: line-through; }
.clp-diff-arrow { color: var(--mint); font-weight: 700; }
.clp-diff-new { color: var(--mint); font-weight: 700; }

.clp-day-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mint);
  text-decoration: none;
  transition: opacity 120ms;
}
.clp-day-link:hover { opacity: 0.8; }

/* Stats bar */
.clp-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.clp-stat {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-card);
}
.clp-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.clp-stat-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: var(--text-subtle);
}
.clp-stat-cats { display: flex; flex-direction: column; gap: 4px; }
.clp-stat-cat {
  font-size: 0.75rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}

/* Paywall */
.clp-paywall {
  position: relative;
  min-height: 260px;
  margin-top: 16px;
}
.clp-paywall-blur {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  opacity: 0.45;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.clp-ghost-card {
  height: 80px;
  background: var(--surface-2);
  border-radius: var(--r-md);
}
.clp-paywall-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13,17,23,0) 0%, rgba(13,17,23,0.65) 30%, rgba(13,17,23,0.95) 70%, rgba(13,17,23,1) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 8px;
  z-index: 2;
}
.clp-paywall-icon { font-size: 1.8rem; margin-bottom: 4px; }
.clp-paywall-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; }
.clp-paywall-desc { font-size: 0.85rem; color: var(--text-muted); max-width: 420px; margin-bottom: 8px; line-height: 1.45; }
.clp-paywall-btn { margin-top: 4px; }

/* Empty state */
.clp-empty {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}
.clp-empty-icon { font-size: 2rem; margin-bottom: 12px; }
.clp-empty-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.clp-empty-sub { font-size: 0.85rem; color: var(--text-muted); max-width: 480px; margin: 0 auto; line-height: 1.5; }

.clp-back-link {
  margin-top: 20px;
  text-align: center;
}
.clp-back-link a {
  color: var(--mint);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.clp-back-link a:hover { opacity: 0.8; }


/* ══════════════════════════════════════════════════════════════
   4.3 — PRODUCT ATTACHMENTS
   ══════════════════════════════════════════════════════════════ */

.pa-attachments-wrap { margin-top: 14px; }
.pa-stack-wrap { margin-top: 14px; }

/* In-context product card */
.pa-inline-card { margin-bottom: 10px; }

.pa-connector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.pa-connector-line {
  width: 2px; height: 14px;
  background: var(--border-mid);
  border-radius: 1px;
  margin-left: 14px;
}
.pa-connector-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-subtle);
}

.pa-product-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  border-left: 3px solid var(--mint);
}
.pa-product-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pa-product-info { flex: 1; min-width: 0; }
.pa-product-name { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.pa-product-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pa-note { font-size: 0.72rem; color: var(--text-muted); }

.pa-shop-link,
.pa-shop-link-sm {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
  text-decoration: none;
  transition: all 120ms;
}
.pa-shop-link:hover,
.pa-shop-link-sm:hover {
  color: var(--mint);
  border-color: var(--border-mid);
}
.pa-shop-link-sm {
  padding: 3px 10px;
  font-size: 0.7rem;
}

/* Disclosure badges */
.badge-affiliate-sm {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  background: rgba(96, 165, 250, 0.10);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.22);
}
.badge-sponsor-sm {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  background: rgba(167, 139, 250, 0.10);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.22);
}

/* Today's Stack */
.pa-stack-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.pa-stack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.pa-stack-list { display: flex; flex-direction: column; gap: 4px; }
.pa-stack-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.pa-stack-info { flex: 1; min-width: 0; }
.pa-stack-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.pa-stack-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.pa-stack-source { font-size: 0.72rem; color: var(--text-muted); }

/* Free tier count */
.pa-free-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  margin-top: 10px;
}
.pa-count-icon { font-size: 1rem; }
.pa-count-text { font-size: 0.82rem; color: var(--text-muted); flex: 1; }
.pa-count-lock { font-size: 0.72rem; opacity: 0.5; }


/* ══════════════════════════════════════════════════════════════
   4.4 — 7-DAY CONSISTENCY STRIP
   ══════════════════════════════════════════════════════════════ */

.ds-strip-section {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.ds-strip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ds-strip-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.ds-strip-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ds-day-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.ds-day-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: all 160ms;
}
.ds-day-tile.active {
  border-color: var(--border-mid);
  box-shadow: 0 0 0 2px var(--mint-dim), 0 0 12px rgba(74, 222, 128, 0.15);
}
.ds-day-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
}
.ds-day-status {
  font-size: 1.1rem;
  font-weight: 700;
}
.ds-day-status.logged { color: var(--mint); }
.ds-day-status.missed { color: var(--text-subtle); opacity: 0.5; }
.ds-day-cal {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ds-trend-note {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--mint-faint);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

/* ── Depth links (View trends → / View change history →) ── */

.cl-depth-links {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.cl-depth-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mint);
  text-decoration: none;
  transition: opacity 120ms;
}
.cl-depth-link:hover { opacity: 0.8; }


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .td-macro-strips { grid-template-columns: 1fr; }
  .td-recovery-grid { grid-template-columns: 1fr; }
  .clp-stats-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .td-page,
  .clp-page { padding: 12px 14px 50px; }

  .trend-header-top { flex-direction: column; align-items: flex-start; }
  .trend-header-right { width: 100%; }
  .td-window-toggle { width: 100%; justify-content: center; }

  .td-macro-strips { grid-template-columns: 1fr; }
  .td-recovery-grid { grid-template-columns: 1fr; }

  .ds-day-strip { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .ds-day-tile { padding: 8px 4px; }
  .ds-day-name { font-size: 0.6rem; }
  .ds-day-status { font-size: 0.9rem; }
  .ds-day-cal { font-size: 0.6rem; }

  .clp-event { grid-template-columns: 1fr; gap: 0; }
  .clp-rail { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 8px; }
  .clp-date-badge { margin-bottom: 0; }
  .clp-line { display: none; }
  .clp-stats-bar { grid-template-columns: 1fr; }
}
