/* ============================================================================
   Pulse — Light "Recovery" Design System (Vanilla CSS, mobile-first)
   Clean WHOOP-inspired light theme: soft grey canvas, white rounded cards,
   diffuse shadows, bold near-black headings, confident green accent, and the
   signature 4-ring Performance & Recovery Hub.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Canvas & surfaces */
  --canvas: #f2f3f5;
  --card-bg: #ffffff;
  --card-inset: #f6f7f9;
  --card-border: #ebedf0;
  --hairline: #eef0f2;
  --card-shadow: 0 1px 2px rgba(17, 24, 28, 0.04), 0 8px 24px rgba(17, 24, 28, 0.06);
  --card-shadow-hover: 0 2px 4px rgba(17, 24, 28, 0.05), 0 14px 34px rgba(17, 24, 28, 0.09);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Zone color components (H S L) — app.js sets these as inline colors */
  --color-green: 152, 60%, 42%;
  --color-yellow: 32, 95%, 50%;
  --color-red: 0, 78%, 58%;
  --color-blue: 250, 72%, 62%;   /* sleep = violet/indigo, WHOOP-ish */
  --color-purple: 250, 72%, 62%;

  --recovery-green: hsl(var(--color-green));
  --warning-yellow: hsl(var(--color-yellow));
  --strain-red: hsl(var(--color-red));
  --sleep-blue: hsl(var(--color-blue));
  --accent: hsl(var(--color-green));
  --accent-strong: #15803d;

  /* Text */
  --text-primary: #14181b;
  --text-secondary: #5b6670;
  --text-muted: #97a1aa;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --transition-smooth: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ============================================================================
   Layout — mobile first
   ============================================================================ */

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.1rem 1rem calc(2.5rem + env(safe-area-inset-bottom, 0));
}

@media (min-width: 768px) {
  .container { padding: 2rem 1.75rem 3rem; }
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.brand-section { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }

.brand-mark {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, hsl(152, 62%, 45%), hsl(160, 64%, 38%));
  box-shadow: 0 4px 12px hsla(152, 60%, 38%, 0.35);
}
.brand-mark svg { width: 22px; height: 22px; }

.brand-text { min-width: 0; }
.brand-text h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}
.brand-text p {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 1px;
}
.dot-sep { color: var(--text-muted); }

.live-indicator {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--recovery-green);
  box-shadow: 0 0 0 0 hsla(152, 60%, 42%, 0.5);
  animation: pulse-dot 2.4s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 hsla(152, 60%, 42%, 0.45); }
  70% { box-shadow: 0 0 0 6px hsla(152, 60%, 42%, 0); }
  100% { box-shadow: 0 0 0 0 hsla(152, 60%, 42%, 0); }
}

.control-group { display: flex; align-items: center; gap: 0.5rem; flex: none; }

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
  font-family: inherit;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  transition: var(--transition-smooth);
  box-shadow: 0 1px 2px rgba(17,24,28,0.05);
}
.btn:hover { box-shadow: var(--card-shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn .ic { width: 18px; height: 18px; flex: none; }

.btn-primary {
  background: linear-gradient(135deg, hsl(152, 62%, 44%), hsl(158, 64%, 39%));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px hsla(152, 60%, 38%, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, hsl(152, 64%, 46%), hsl(158, 66%, 40%));
  box-shadow: 0 6px 20px hsla(152, 60%, 38%, 0.4);
}

.icon-btn { padding: 0; width: 44px; min-width: 44px; }
.icon-btn .ic { width: 19px; height: 19px; color: var(--text-secondary); }

@media (max-width: 460px) {
  .btn-label { display: none; }
  #sync-btn { width: 44px; min-width: 44px; padding: 0; }
}

/* ============================================================================
   Tabs (segmented)
   ============================================================================ */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  background: #e8eaed;
  border-radius: 13px;
  padding: 4px;
  margin-bottom: 1.1rem;
}
.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.6rem 0.5rem;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  min-height: 40px;
  transition: var(--transition-smooth);
}
.tab-btn.active {
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(17,24,28,0.12);
}

/* ============================================================================
   Cards
   ============================================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* Section icon badges */
.ic-badge {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  flex: none;
}
.ic-badge svg { width: 17px; height: 17px; }
.badge-green { background: hsla(152, 60%, 42%, 0.12); color: var(--recovery-green); }
.badge-amber { background: hsla(32, 95%, 50%, 0.14); color: var(--warning-yellow); }

.ai-meta-tag {
  margin-left: auto;
  background: hsla(152, 60%, 42%, 0.12);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ============================================================================
   Performance & Recovery Hub — signature rings
   ============================================================================ */
.hub-card { margin-bottom: 1rem; }

.dials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
@media (min-width: 560px) {
  .dials-grid { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
}

.dial-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.85rem 0.4rem 0.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}
.dial-card:hover { background: var(--card-inset); }

.dial-svg-wrapper {
  position: relative;
  width: 104px; height: 104px;
  margin-bottom: 0.6rem;
}
@media (min-width: 560px) {
  .dial-svg-wrapper { width: 116px; height: 116px; }
}

.dial-svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }

.dial-track {
  fill: none;
  stroke: #edeff2;
  stroke-width: 11px;
}
.dial-progress {
  fill: none;
  stroke-width: 11px;
  stroke-linecap: round;
  stroke: var(--text-muted);
  transition: stroke-dashoffset 1.1s cubic-bezier(0.25, 0.8, 0.25, 1), stroke 0.4s ease;
}

.dial-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.dial-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.dial-unit {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.dial-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}
.dial-status {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Zone stroke colors (toggled by app.js on .dial-progress) */
.dial-progress.recovery-green { stroke: var(--recovery-green); }
.dial-progress.warning-yellow { stroke: var(--warning-yellow); }
.dial-progress.strain-red { stroke: var(--strain-red); }
.dial-progress.sleep-blue { stroke: var(--sleep-blue); }

/* ============================================================================
   Secondary vitals
   ============================================================================ */
.secondary-vitals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}
@media (min-width: 560px) { .secondary-vitals { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .secondary-vitals { grid-template-columns: repeat(6, 1fr); } }

.vital-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}
.vital-box-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.vital-box-value {
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.vital-box-trend {
  font-size: 0.7rem;
  margin-top: 0.2rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.vital-box-trend.muted { color: var(--text-muted); }

/* ============================================================================
   Split content
   ============================================================================ */
.content-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 960px) {
  .content-split { grid-template-columns: 1.5fr 1fr; gap: 1.25rem; align-items: start; }
}

/* ============================================================================
   AI insights panel
   ============================================================================ */
.insight-section { padding: 1rem 0; border-top: 1px solid var(--hairline); }
.insight-section:first-of-type { padding-top: 0; border-top: none; }
.insight-section:last-child { padding-bottom: 0; }

.insight-section h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}
.ic-dot {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: grid; place-items: center;
  flex: none;
}
.ic-dot svg { width: 15px; height: 15px; }
.dot-green { background: hsla(152, 60%, 42%, 0.12); color: var(--recovery-green); }
.dot-red { background: hsla(0, 78%, 58%, 0.12); color: var(--strain-red); }
.dot-amber { background: hsla(32, 95%, 50%, 0.14); color: var(--warning-yellow); }
.dot-blue { background: hsla(250, 72%, 62%, 0.13); color: var(--sleep-blue); }

.insight-body {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}
.insight-body p { margin-bottom: 0.55rem; }
.insight-body strong { color: var(--text-primary); font-weight: 700; }
.insight-body em { color: var(--text-muted); }
.insight-body ul { padding-left: 1.1rem; margin: 0.4rem 0; }
.insight-body li { margin-bottom: 0.4rem; }
.insight-body h1, .insight-body h2, .insight-body h3 {
  font-size: 0.95rem; color: var(--text-primary); margin: 0.6rem 0 0.4rem;
}

.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0.7rem 0; }
.insight-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  background: var(--card-inset);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-width: 360px;
}
.insight-body th {
  background: #eef0f2;
  color: var(--text-primary);
  font-weight: 700;
  text-align: left;
  padding: 0.55rem 0.7rem;
  white-space: nowrap;
}
.insight-body td {
  padding: 0.55rem 0.7rem;
  border-top: 1px solid var(--card-border);
  color: var(--text-secondary);
}

/* ============================================================================
   Nutrition panel
   ============================================================================ */
.calorie-tally {
  background: var(--card-inset);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  margin-bottom: 1.1rem;
}
.calorie-tally-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.calorie-tally-goal {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.cal-of { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

.calorie-tally-bar {
  height: 8px;
  background: #e7e9ec;
  border-radius: 999px;
  overflow: hidden;
}
.calorie-tally-progress {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, hsl(152, 62%, 45%), hsl(168, 64%, 44%));
  transition: width 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.macro-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}
.macro-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}
.macro-name { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.macro-numbers {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.macro-bar {
  height: 8px;
  background: #e7e9ec;
  border-radius: 999px;
  overflow: hidden;
}
.macro-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.protein-fill { background: hsl(0, 78%, 60%); }
.carbs-fill { background: hsl(32, 95%, 52%); }
.fat-fill { background: hsl(250, 72%, 64%); }

/* Log form */
.log-form { margin-bottom: 1.3rem; }
.log-input-group { display: flex; gap: 0.5rem; }
.log-input {
  flex: 1;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid #dfe2e6;
  color: var(--text-primary);
  padding: 0.7rem 0.85rem;
  border-radius: 11px;
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 44px;
  transition: var(--transition-smooth);
}
.log-input::placeholder { color: var(--text-muted); }
.log-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsla(152, 60%, 42%, 0.15);
}
.log-input--block { width: 100%; }
.log-form .btn-primary { flex: none; padding-inline: 1.2rem; }

.log-history-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.meals-history {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
@media (min-width: 768px) {
  .meals-history {
    max-height: 360px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.meal-item {
  background: var(--card-inset);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.meal-details { min-width: 0; flex: 1; }
.meal-details h4 {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meal-details p { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
.meal-macros { text-align: right; flex: none; }
.meal-cal {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.meal-breakdown { color: var(--text-secondary); font-size: 0.7rem; margin-top: 0.1rem; }

/* ============================================================================
   Alerts
   ============================================================================ */
.alerts-section:not(:empty) { margin-bottom: 1rem; }
.alert-banner {
  background: hsla(0, 78%, 58%, 0.07);
  border: 1px solid hsla(0, 78%, 58%, 0.22);
  color: #b42318;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.alert-icon { flex: none; color: var(--strain-red); margin-top: 1px; }
.alert-icon svg { width: 18px; height: 18px; display: block; }

/* ============================================================================
   Settings modal
   ============================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 27, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal {
  width: 100%;
  max-width: 460px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(20,24,27,0.3);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.modal-header h3 { font-size: 1.15rem; font-weight: 700; }
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  transition: var(--transition-smooth);
}
.modal-close:hover { background: var(--card-inset); color: var(--text-primary); }
.modal-close svg { width: 20px; height: 20px; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.form-hint { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.4; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* ============================================================================
   Loader
   ============================================================================ */
.loader-container {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  background: rgba(242, 243, 245, 0.92);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 2000;
}
.loader-container.active { display: flex; }
.spinner {
  width: 46px; height: 46px;
  border: 4px solid #e3e6e9;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 1.1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.3rem; }
.loader-subtext { font-size: 0.82rem; color: var(--text-secondary); }

/* ============================================================================
   Accessibility
   ============================================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================================
   Mobile Navigation & Responsive Styling
   ============================================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
  z-index: 999;
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left: 1rem;
  padding-right: 1rem;
}

.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  height: 100%;
  transition: var(--transition-smooth);
}

.bottom-nav .nav-item i {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.bottom-nav .nav-item.active {
  color: var(--accent-strong);
}

.bottom-nav .nav-item.active svg {
  color: var(--accent-strong);
}

/* Tab display toggles on mobile vs desktop */
.tab-view {
  display: none;
}
.tab-view.active {
  display: block;
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0) + 1rem);
  }
  
  .bottom-nav {
    display: flex;
  }
  
  /* Stack tables on mobile */
  .insight-body table {
    min-width: 100% !important;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  
  .insight-body thead {
    display: none; /* Hide header row */
  }
  
  .insight-body tr {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  }
  
  .insight-body td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    padding: 0.5rem 0;
    border-top: 1px dashed var(--hairline);
    font-size: 0.85rem;
  }
  
  .insight-body td:first-child {
    border-top: none;
  }
  
  /* Bold first item (usually exercise name) and align left/make blocky */
  .insight-body td:first-child {
    display: block;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    padding-bottom: 0.4rem;
  }
  
  .insight-body td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    margin-right: 0.5rem;
  }
  
  /* Hide the data-label prefix for the main title column */
  .insight-body td:first-child::before {
    display: none;
  }
}

@media (min-width: 768px) {
  /* On desktop, bypass mobile wrappers entirely */
  .tab-view {
    display: contents !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
