/* Body dashboard: living body record, signal mirror, practices, panels. */

.body-hero,
.body-mirror,
.dashboard-quicknav,
.dashboard-section,
.health-focus,
.body-nudge {
  max-width: 920px;
}

.body-hero {
  display: grid;
  gap: 1.5rem;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

/* Pillar name — visual continuation of "Temenos" in the sidebar */
.body-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--thread-color);
  text-transform: none;
  line-height: 1;
}

.body-eyebrow-mark {
  display: inline-block;
  width: 1.9rem;
  height: 1.75rem;
  flex-shrink: 0;
  background: var(--thread-color);
  opacity: 0.95;
  -webkit-mask: url('../img/body-clean.png') center / contain no-repeat;
  mask: url('../img/body-clean.png') center / contain no-repeat;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--thread-color) 30%, transparent));
}

/* Tagline — refined italic subtitle beneath the pillar name */
.body-hero-copy h1 {
  max-width: 640px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 0.25rem;
}

.body-hero-copy p:last-child {
  max-width: 620px;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.dashboard-kicker {
  color: var(--thread-color);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ── Body section headings (matches Mind's eyebrow + h2 pattern) */
.body-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.body-section-head h2 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0.15rem 0 0;
}

.body-section-eyebrow {
  font-size: 0.68rem;
  color: var(--thread-color);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ── Flag context note */
.body-flag-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.9rem;
  margin-top: -0.4rem;
}

.body-memory {
  display: grid;
  gap: 0.08rem;
  align-self: end;
  padding: 1rem;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--thread-color) 18%, transparent), transparent 45%),
    var(--bg-surface);
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--thread-color));
  border-radius: var(--radius-md);
}

.body-memory-label {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.body-memory strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1;
}

.body-memory span:not(.body-memory-label) {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.body-memory p {
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.body-mirror {
  padding: 1.25rem;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ai-color) 8%, transparent), transparent 45%),
    var(--bg-surface);
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--ai-color));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.body-mirror h2 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
}

.body-mirror-grid {
  display: grid;
  gap: 0.75rem;
}

.body-mirror article {
  min-height: 8rem;
  padding: 0.9rem;
  background: color-mix(in srgb, var(--bg-raised) 72%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.body-mirror article span,
.sparkline-reading {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.body-mirror article p {
  margin-top: 0.25rem;
  color: var(--text-secondary);
}

.dashboard-quicknav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.quicknav-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.85rem;
  row-gap: 0.15rem;
  min-height: 6rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.quicknav-card:hover {
  background: color-mix(in srgb, var(--thread-color) 5%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--thread-color) 70%, var(--border));
  transform: translateY(-2px);
}

.body-nav-icon {
  display: block;
  grid-row: 1 / 3;
  width: 2rem;
  height: 2rem;
  background: var(--thread-color);
  opacity: 0.95;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--thread-color) 12%, transparent));
}

.body-nav-icon--nourish {
  -webkit-mask: url('../img/recipe-library.png') center / contain no-repeat;
  mask: url('../img/recipe-library.png') center / contain no-repeat;
}

.body-nav-icon--signals {
  -webkit-mask: url('../img/blood-work.png') center / contain no-repeat;
  mask: url('../img/blood-work.png') center / contain no-repeat;
}

.body-nav-icon--rhythm {
  -webkit-mask: url('../img/meal-plan.png') center / contain no-repeat;
  mask: url('../img/meal-plan.png') center / contain no-repeat;
}

.quicknav-label {
  align-self: end;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
}

.quicknav-desc {
  align-self: start;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.dashboard-section {
  padding: 1.25rem;
}

.dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.dashboard-section-head h2,
.dashboard-section-head h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
}

.dashboard-test-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}

.marker-group-grid {
  display: grid;
  gap: 0.75rem;
}

.marker-group {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  background: color-mix(in srgb, var(--bg-raised) 72%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.marker-group h4 {
  color: var(--text-primary);
  font-size: 1.05rem;
}

.marker-traffic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.marker-chip {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 8.4rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
}

.marker-chip--normal {
  border-color: color-mix(in srgb, var(--thread-color) 58%, var(--border));
  background: color-mix(in srgb, var(--thread-color) 7%, transparent);
}

.marker-chip--high {
  border-color: color-mix(in srgb, #e06c75 78%, var(--border));
  background: color-mix(in srgb, #e06c75 9%, transparent);
}

.marker-chip--low {
  border-color: color-mix(in srgb, var(--ai-color) 68%, var(--border));
  background: color-mix(in srgb, var(--ai-color) 8%, transparent);
}

.marker-chip-name {
  max-width: 10rem;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marker-chip-val {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.marker-chip--high .marker-chip-val {
  color: color-mix(in srgb, #e06c75 82%, var(--text-primary));
}

.marker-chip--low .marker-chip-val {
  color: var(--ai-color);
}

.sparkline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.sparkline-card {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-height: 8rem;
  padding: 0.8rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ai-color) 5%, transparent), transparent),
    var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sparkline-label {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkline-value {
  color: var(--thread-color);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.sparkline-canvas {
  width: 100% !important;
  height: 42px !important;
  margin-top: auto;
}

@media (min-width: 620px) {
  .dashboard-quicknav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .body-hero {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.28fr);
    align-items: end;
  }

  .body-mirror-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .marker-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Panel insight card ──────────────────────────────────── */
.insight-card {
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
}

.insight-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.85rem 0;
  text-align: left;
  background: transparent;
  gap: 0.75rem;
  transition: opacity var(--transition);
}
.insight-toggle:hover { opacity: 0.8; }

.insight-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.insight-toggle-label strong {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--thread-color);
}

.insight-toggle-label span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.insight-card.is-open .mind-thread-chevron {
  transform: rotate(90deg);
}

.insight-body {
  padding-bottom: 0.5rem;
}

.insight-illuminate {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-line;
}

.insight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* ── Interpret panel ─────────────────────────────────────── */
.interpret-wrap {
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.07));
  padding-top: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.interpret-status {
  font-size: 0.8rem;
  min-height: 1.2em;
}

/* ── Panel timeline ──────────────────────────────────────── */
.panel-timeline {
  padding: 0.6rem 0 1.2rem;
}

.panel-timeline-line {
  position: relative;
  height: 2px;
  background: var(--border-color, rgba(255,255,255,0.1));
  margin: 1.4rem 0.6rem 0;
  border-radius: 2px;
}

.panel-timeline-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 2px solid var(--text-muted, #666);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, transform 0.15s;
}

.panel-timeline-dot.is-latest {
  border-color: var(--thread-color);
  background: var(--thread-color);
  width: 13px;
  height: 13px;
}

.panel-timeline-dot:hover {
  border-color: var(--thread-color);
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 2;
}

.panel-timeline-dot:hover .panel-timeline-tooltip {
  opacity: 1;
  pointer-events: none;
}

.panel-timeline-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg, #252825);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  color: var(--text-primary, #fff);
  font-size: 0.72rem;
  white-space: nowrap;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

/* Flagged panels carry an amber ring on the timeline */
.panel-timeline-dot.has-signals:not(.is-latest) {
  border-color: #bfa06a;
}

/* ── Health focus chips ──────────────────────────────────── */
.health-focus {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.health-focus-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.health-focus-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* ── Stale-panel nudge ───────────────────────────────────── */
.body-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1.1rem;
  background: rgba(191, 160, 106, 0.08);
  border: 1px solid rgba(191, 160, 106, 0.25);
  border-radius: var(--radius-md, 10px);
  transition: border-color var(--transition);
}
.body-nudge:hover { border-color: rgba(191, 160, 106, 0.5); }
.body-nudge-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.body-nudge-action {
  font-size: 0.8rem;
  font-weight: 500;
  color: #bfa06a;
  white-space: nowrap;
}

/* ── Top-rated recipes ───────────────────────────────────── */
.top-rated-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.7rem;
}
.top-rated-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.top-rated-card:hover {
  border-color: var(--thread-color);
  transform: translateY(-2px);
}
.top-rated-strip { height: 4px; flex-shrink: 0; }
.top-rated-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.85rem 0.85rem;
}
.top-rated-title {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.25;
  color: var(--text-primary);
}
.top-rated-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.top-rated-stars { color: var(--thread-color); letter-spacing: 1px; }

/* ── Profile header ──────────────────────────────────────── */
.profile-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}


/* ── Profile reset section ───────────────────────────────── */
.profile-reset-section {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  max-width: 560px;
}

.profile-reset-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Shared pillar hero standardization: Body + Mind */
.body-hero,
.mind-hero,
.body-mirror,
.mind-mirror,
.dashboard-quicknav,
.dashboard-section,
.health-focus,
.body-nudge,
.mind-rhythm,
.mind-path,
.mind-thread,
.mind-capture,
.mind-prompts,
.mind-ai-reflection {
  max-width: 920px;
}

.body-hero,
.mind-hero {
  display: grid;
  gap: 1.5rem;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.body-eyebrow,
.mind-hero .mind-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--thread-color);
  text-transform: none;
  line-height: 1;
}

.body-eyebrow-mark,
.mind-eyebrow-mark {
  width: 1.9rem;
  height: 1.75rem;
  flex-shrink: 0;
  background: var(--thread-color);
  opacity: 0.95;
}

.body-hero-copy h1,
.mind-hero-copy h1 {
  max-width: 640px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 0.25rem;
}

.body-hero-copy p:last-child,
.mind-hero-copy p:last-child {
  max-width: 620px;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.body-memory,
.mind-memory {
  display: grid;
  gap: 0.16rem;
  align-self: end;
  min-height: 8.4rem;
  padding: 1rem;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--thread-color) 18%, transparent), transparent 45%),
    var(--bg-surface);
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--thread-color));
  border-radius: var(--radius-md);
}

.body-memory-label,
.mind-memory-label {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.body-memory strong,
.mind-memory strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1;
}

.body-memory span:not(.body-memory-label),
.body-memory p,
.mind-memory span:not(.mind-memory-label),
.mind-memory p {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
}

.body-memory p,
.mind-memory p {
  margin-top: 0.45rem;
}

.mind-memory-meter {
  width: 100%;
  height: 0.42rem;
  margin: 0.55rem 0 0.2rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--thread-color) 16%, var(--bg-raised));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--thread-color) 18%, transparent);
}

.mind-memory-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--thread-color);
}

.mind-ring-scroll-btn {
  justify-self: start;
  margin-top: 0.35rem;
}

@media (min-width: 720px) {
  .body-hero,
  .mind-hero {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.28fr);
    align-items: end;
  }
}
