/* ============================================
   PLEXY DASHBOARD — Neutral State Design System
   Architectural · Matte · Premium
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Neutral State Brand Palette */
  --bg: #EAE7DF;
  --card: #F5F3ED;
  --primary: #1E1F21;
  --accent: #C2A987;
  --text-primary: #1E1F21;
  --text-secondary: #6E7458;
  --divider: #D5D0C4;
  --tag-bg: #1E1F21;
  --tag-text: #EAE7DF;
  --status-active: #6E7458;
  --status-warning: #C2A987;
  --status-queued: #D5D0C4;
  --chat-user-bg: #1E1F21;
  --chat-user-text: #EAE7DF;
  --chat-plexy-bg: #F5F3ED;
  --chat-plexy-text: #1E1F21;

  /* Shadows — warm tinted, subtle */
  --shadow-sm: 0 1px 3px rgba(30, 31, 33, 0.04), 0 1px 2px rgba(30, 31, 33, 0.03);
  --shadow-md: 0 4px 12px rgba(30, 31, 33, 0.06), 0 1px 3px rgba(30, 31, 33, 0.04);
  --shadow-lg: 0 12px 32px rgba(30, 31, 33, 0.08), 0 4px 12px rgba(30, 31, 33, 0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Type Scale */
  --text-xs: clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Dashboard Layout --- */
.dashboard {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: relative;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-5) var(--space-4) 0;
  scroll-behavior: smooth;
}

/* --- Header --- */
.section-header {
  padding: var(--space-6) 0 var(--space-4);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.logo-text {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-primary);
}

.header-location {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.greeting {
  font-size: var(--text-2xl);
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.header-date {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  font-weight: 400;
}

/* --- Cards --- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title-row .section-title {
  margin-bottom: 0;
}

/* --- Status Badges --- */
.status-badge {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.status-active {
  background: var(--status-active);
  color: var(--tag-text);
}

.status-queued {
  background: var(--status-queued);
  color: var(--text-primary);
}

.status-warning {
  background: var(--status-warning);
  color: var(--text-primary);
}

/* --- Calendar --- */
.calendar-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cal-event {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background var(--transition-interactive);
  border-radius: var(--radius-sm);
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.cal-event:last-child {
  border-bottom: none;
}

.cal-event:active {
  background: rgba(194, 169, 135, 0.08);
}

.cal-time {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  min-width: 48px;
  font-variant-numeric: tabular-nums lining-nums;
  padding-top: 1px;
}

.cal-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.cal-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.cal-location {
  font-size: var(--text-xs);
  color: var(--text-secondary);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

/* --- Trading --- */
.trading-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.trading-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums lining-nums;
}

.metric-positive {
  color: var(--status-active);
}

.metric-negative {
  color: #9E6B5A;
}

.trading-meta {
  border-top: 1px solid var(--divider);
  padding-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meta-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.meta-value {
  font-size: var(--text-xs);
  color: var(--text-primary);
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
}

/* --- Projects --- */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--divider);
}

.project-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.project-item:first-child {
  padding-top: 0;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}

.project-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.project-status {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: var(--space-2);
}

.progress-bar-container {
  height: 3px;
  background: var(--divider);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-1);
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 600ms var(--ease-out);
}

.progress-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* --- News --- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background var(--transition-interactive);
  border-radius: var(--radius-sm);
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  margin-left: calc(-1 * var(--space-2));
  margin-right: calc(-1 * var(--space-2));
}

.news-item:last-child {
  border-bottom: none;
}

.news-item:active {
  background: rgba(194, 169, 135, 0.06);
}

.news-headline {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 2px;
}

.news-source {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}


/* --- Reminders --- */
.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.reminder-item:last-child {
  border-bottom: none;
}

.reminder-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  margin-top: 1px;
  transition: background var(--transition-interactive),
              border-color var(--transition-interactive);
  position: relative;
}

.reminder-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.reminder-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.reminder-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.45;
  transition: opacity var(--transition-interactive),
              color var(--transition-interactive);
}

.reminder-done,
.reminder-checkbox:checked ~ .reminder-text {
  color: var(--text-secondary);
  text-decoration: line-through;
  opacity: 0.6;
}

/* --- Last Updated Pill --- */
.last-updated {
  display: inline-block;
  font-size: 0.625rem;
  color: var(--text-secondary);
  opacity: 0.6;
  letter-spacing: 0.03em;
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--divider);
  width: 100%;
  text-align: right;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: var(--space-6) 0 var(--space-4);
}

.site-footer a {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition-interactive);
}

.site-footer a:active {
  color: var(--accent);
}

/* --- Chat Spacer --- */
.chat-spacer {
  height: var(--space-4);
}

.chat-spacer-extra {
  height: 84px; /* Space for fixed chat bar */
}

/* --- Chat Bar (Fixed Bottom) --- */
.chat-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  padding: var(--space-3) var(--space-4);
  padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
  border-top: 1px solid var(--divider);
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--card);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-3);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--divider);
  transition: border-color var(--transition-interactive),
              box-shadow var(--transition-interactive);
}

.chat-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--text-primary);
  outline: none;
  padding: var(--space-1) 0;
  min-width: 0;
}

.chat-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.chat-mic-btn,
.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition-interactive),
              transform var(--transition-interactive);
  -webkit-tap-highlight-color: transparent;
}

.chat-mic-btn {
  background: transparent;
  color: var(--text-secondary);
}

.chat-mic-btn:active {
  transform: scale(0.92);
  background: rgba(194, 169, 135, 0.15);
}

.chat-mic-btn.recording {
  background: var(--accent);
  color: var(--primary);
  animation: pulse-mic 1.2s ease-in-out infinite;
}

@keyframes pulse-mic {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

.chat-send-btn {
  background: var(--primary);
  color: var(--bg);
}

.chat-send-btn:active {
  transform: scale(0.92);
}

/* --- Chat Overlay (Expanded) --- */
.chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 350ms var(--ease-out);
  will-change: transform;
  padding-bottom: 80px;
}

.chat-overlay.open {
  transform: translateY(0);
}

.chat-expanded {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  padding-top: max(var(--space-4), env(safe-area-inset-top));
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.chat-header-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.chat-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-interactive),
              transform var(--transition-interactive);
}

.chat-close-btn:active {
  transform: scale(0.92);
  background: var(--divider);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: var(--space-5) var(--space-4);
  padding-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chat-bubble {
  max-width: 85%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  animation: bubble-in 300ms var(--ease-out);
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-user {
  background: var(--chat-user-bg);
  color: var(--chat-user-text);
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
}

.chat-plexy {
  background: var(--chat-plexy-bg);
  color: var(--chat-plexy-text);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
  border: 1px solid var(--divider);
}

.chat-bubble p {
  margin: 0;
}

/* --- Scroll fade for cards (stagger) --- */
.card {
  opacity: 0;
  animation: card-enter 500ms var(--ease-out) forwards;
}

.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 60ms; }
.card:nth-child(3) { animation-delay: 120ms; }
.card:nth-child(4) { animation-delay: 180ms; }
.card:nth-child(5) { animation-delay: 240ms; }
.card:nth-child(6) { animation-delay: 300ms; }

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header doesn't get card animation */
.section-header {
  opacity: 1;
  animation: fade-in 400ms var(--ease-out);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .chat-overlay {
    transition-duration: 0.01ms !important;
  }
}

/* --- Tablet & Desktop --- */
@media (min-width: 600px) {
  .main-content {
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-6) 0;
  }

  .chat-bar {
    max-width: 560px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .card {
    padding: var(--space-6);
  }

  .greeting {
    font-size: var(--text-2xl);
  }

  .trading-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .main-content {
    max-width: 640px;
    padding: var(--space-8) var(--space-8) 0;
  }

  .chat-bar {
    max-width: 640px;
  }

  .card {
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-8);
  }

  .section-header {
    padding: var(--space-8) 0 var(--space-6);
  }

  .cal-event:hover {
    background: rgba(194, 169, 135, 0.06);
  }

  .news-item:hover {
    background: rgba(194, 169, 135, 0.06);
  }


  .chat-mic-btn:hover {
    background: rgba(194, 169, 135, 0.15);
  }

  .chat-send-btn:hover {
    background: #35363A;
  }

  .chat-close-btn:hover {
    background: var(--divider);
  }

  .site-footer a:hover {
    color: var(--accent);
  }
}

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chat-input:focus-visible {
  outline: none;
}

/* --- Scrollbar styling (subtle) --- */
.main-content::-webkit-scrollbar {
  width: 4px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: var(--radius-full);
}

.chat-messages::-webkit-scrollbar {
  width: 3px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: var(--radius-full);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  align-self: flex-start;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}


/* ── Health Tracker ─────────────────────────────────── */
.health-tracker {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.health-input-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.health-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.health-slider-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.health-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--divider);
  outline: none;
}
.health-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.health-value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
}
.health-submit-btn {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}
.health-submit-btn:hover {
  opacity: 0.85;
}
.health-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.health-recommendations {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}
.health-recommendations ul {
  margin: 8px 0 0 0;
  padding-left: 18px;
}
.health-recommendations li {
  margin-bottom: 6px;
}
.health-recommendations .health-status {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: var(--text-base);
}
.health-recommendations .health-status.good { color: #6E7458; }
.health-recommendations .health-status.moderate { color: var(--accent); }
.health-recommendations .health-status.poor { color: #c0392b; }


  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.health-slider-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.health-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--divider);
  outline: none;
}
.health-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #EAE7DF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.health-value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
}
.health-submit-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}
.health-submit-btn:hover {
  opacity: 0.85;
}
.health-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.health-recommendations {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}
.health-recommendations ul {
  margin: 8px 0 0 0;
  padding-left: 18px;
}
.health-recommendations li {
  margin-bottom: 6px;
}
.health-recommendations .health-status {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: var(--text-base);
}
.health-recommendations .health-status.good { color: #6E7458; }
.health-recommendations .health-status.moderate { color: var(--accent); }
.health-recommendations .health-status.poor { color: #c0392b; }

/* ── Health Tracker V2: Streak Banner */
.ht-streak-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 14px 16px;
  background: #F5F3ED;
  border-radius: 10px;
  border: 1px solid var(--divider);
}
.ht-streak-count {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.ht-streak-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.ht-streak-milestone {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: #6E7458;
  margin-top: 2px;
}
.ht-streak-milestone:empty {
  display: none;
}

/* ── Health Tracker V2: Zone Bar */
.ht-zone-bar {
  position: relative;
  display: flex;
  height: 26px;
  border-radius: 6px;
  overflow: visible;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  user-select: none;
}
.ht-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  line-height: 1;
}
.ht-zone-red {
  flex: 0 0 25%;
  background: #c0392b;
  border-radius: 6px 0 0 6px;
}
.ht-zone-amber {
  flex: 0 0 35%;
  background: var(--accent);
}
.ht-zone-green {
  flex: 0 0 40%;
  background: #6E7458;
  border-radius: 0 6px 6px 0;
}
.ht-zone-marker {
  position: absolute;
  top: -6px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--text-primary);
  transition: left 0.25s ease;
  pointer-events: none;
}

/* ── Health Tracker V2: Mindset Message */
.ht-mindset-msg {
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  line-height: 1.5;
  background: transparent;
}
.ht-mindset-msg:empty {
  display: none;
}

/* ── Health Tracker V2: Pain Prompts */
.ht-pain-prompts {
  background: #f5e6df;
  border: 1px solid #e0c4b4;
  border-radius: 10px;
  padding: 14px 16px;
}
.ht-pain-prompts-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #c0392b;
  margin-bottom: 8px;
}
.ht-pain-prompts ul {
  margin: 0;
  padding-left: 18px;
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.6;
}
.ht-pain-prompts li {
  margin-bottom: 4px;
}

/* ── Health Tracker V2: Activity & Sleep Section */
.act-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, #999);
  margin-bottom: 6px;
}
.act-section-label:not(:first-child) {
  margin-top: 14px;
}
.act-sleep-label {
  margin-bottom: 8px;
}
.as-sleep-row {
  display: flex;
  gap: 8px;
}
.as-sleep-btn {
  padding: 6px 16px;
  border: 2px solid var(--divider, #D5D0C4);
  border-radius: 5px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #999);
  cursor: pointer;
  transition: all 0.2s ease;
}
.as-sleep-btn:hover {
  border-color: #6E7458;
  color: var(--text-primary);
}
.as-sleep-btn.active {
  background: #6E7458;
  color: #fff;
  border-color: #6E7458;
}

/* ── Health Tracker V2: Resilience Journey */
.ht-resilience {
  padding: 14px 16px;
  background: #F5F3ED;
  border-radius: 10px;
  border: 1px solid var(--divider);
}
.ht-resilience-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.ht-resilience-stages {
  display: flex;
  align-items: center;
  gap: 0;
}
.ht-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 6px 4px;
  border-radius: 8px;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}
.ht-stage-icon {
  font-size: 18px;
  margin-bottom: 2px;
  opacity: 0.4;
}
.ht-stage-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.ht-stage.active {
  background: var(--accent);
}
.ht-stage.active .ht-stage-icon {
  opacity: 1;
}
.ht-stage.active .ht-stage-text {
  color: #fff;
  font-weight: 700;
}
.ht-stage-connector {
  width: 20px;
  height: 2px;
  background: var(--divider);
  flex-shrink: 0;
}

/* ── Health Tracker V2: Mobile */
@media (max-width: 480px) {
  .ht-streak-count {
    font-size: 24px;
  }
  .ht-zone-bar {
    font-size: 10px;
    height: 22px;
  }
  .ht-zone-marker {
    border-left-width: 5px;
    border-right-width: 5px;
    border-top-width: 6px;
    top: -5px;
  }
  .ht-stage-icon {
    font-size: 15px;
  }
  .ht-stage-text {
    font-size: 11px;
  }
  .ht-stage-connector {
    width: 12px;
  }
}

/* FX pairs layout */
.fx-pairs-block {
  padding: 10px 0 0 0;
  border-top: 1px solid var(--divider, rgba(0,0,0,0.06));
  margin-top: 4px;
}
.fx-pairs-block .meta-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #999);
  margin-bottom: 6px;
}
.fx-pairs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fx-pair-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(110, 116, 88, 0.1);
  color: var(--text-primary, #1E1F21);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* FX positions and trades */
.fx-positions-section,
.fx-trades-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.fx-sub-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8A8A8A;
  margin-bottom: 10px;
}
.fx-empty {
  font-size: 13px;
  color: #8A8A8A;
  padding: 4px 0;
}
.fx-pos-card {
  background: #EAE7DF;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.fx-pos-card:last-child { margin-bottom: 0; }
.fx-pos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.fx-pos-pair {
  font-size: 15px;
  font-weight: 600;
  color: #1E1F21;
}
.fx-pos-tags {
  display: flex;
  gap: 4px;
}
.fx-pos-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.fx-tag-pb {
  background: rgba(194,169,135,0.12);
  color: #C2A987;
}
.fx-tag-short {
  background: rgba(198,40,40,0.08);
  color: #C62828;
}
.fx-tag-long {
  background: rgba(46,125,50,0.08);
  color: #2E7D32;
}
.fx-pos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.fx-pos-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fx-pos-mlabel {
  font-size: 10px;
  color: #8A8A8A;
  letter-spacing: 0.02em;
}
.fx-pos-mval {
  font-size: 13px;
  font-weight: 600;
  color: #1E1F21;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-pos-targets {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-wrap: wrap;
}
.fx-pos-tp {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #8A8A8A;
}
.fx-pos-tpval {
  font-weight: 600;
  color: #1E1F21;
}
.fx-tp-hit {
  color: #2E7D32;
}
.fx-tp-check {
  color: #2E7D32;
  font-size: 12px;
}
.fx-tp-pending {
  color: #8A8A8A;
  font-size: 12px;
}
.fx-trade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.fx-trade-row:last-child { border-bottom: none; }
.fx-trade-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fx-trade-pair {
  font-size: 13px;
  font-weight: 600;
  color: #1E1F21;
}
.fx-trade-meta {
  font-size: 10px;
  color: #8A8A8A;
}
.fx-trade-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.fx-trade-pnl {
  font-size: 13px;
  font-weight: 600;
}
.fx-trade-result {
  font-size: 10px;
  color: #8A8A8A;
}

/* Crypto positions and trades sections */
.crypto-positions-section,
.crypto-trades-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* Health tracker exercises */
.ht-exercises-section {
  margin-top: 14px;
  padding: 14px;
  background: #EAE7DF;
  border-radius: 10px;
  border-left: 3px solid #C2A987;
}
.ht-exercises-title {
  font-size: 13px;
  font-weight: 700;
  color: #1E1F21;
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}
.ht-exercises-subtitle {
  font-size: 11px;
  color: #8A8A8A;
  margin-bottom: 12px;
}
.ht-exercise-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ht-exercise-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ht-exercise-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #C2A987;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.ht-exercise-detail {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ht-exercise-name {
  font-size: 13px;
  font-weight: 600;
  color: #1E1F21;
}
.ht-exercise-desc {
  font-size: 11px;
  color: #6B6B6B;
  line-height: 1.4;
}


/* ── Body Composition ─────────────────────────────── */
.bc-empty { text-align: center; padding: 1.5rem 1rem; }
.bc-upload-btn {
  display: inline-block; margin-top: 0.75rem;
  padding: 0.5rem 1.25rem; border: 1px solid var(--accent, #C2A987);
  background: transparent; color: var(--accent, #C2A987);
  border-radius: 6px; font-size: var(--text-sm); cursor: pointer;
}
.bc-upload-btn:active { background: var(--accent, #C2A987); color: #1E1F21; }

.bc-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
}
.bc-title-row { display: flex; flex-direction: column; gap: 0.15rem; }
.bc-title { font-weight: 600; font-size: var(--text-base); color: var(--text-primary); }
.bc-date { font-size: var(--text-xs); color: var(--text-secondary); }

.bc-upload-btn-sm {
  padding: 0.3rem 0.75rem; border: 1px solid var(--accent, #C2A987);
  background: transparent; color: var(--accent, #C2A987);
  border-radius: 5px; font-size: 11px; cursor: pointer; white-space: nowrap;
}
.bc-upload-btn-sm:active { background: var(--accent, #C2A987); color: #1E1F21; }

.bc-summary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 480px) {
  .bc-summary { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
}
.bc-metric { text-align: center; }
.bc-val { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.bc-unit { font-size: 0.7rem; color: var(--text-secondary); margin-left: 1px; }
.bc-label {
  display: block; font-size: 0.65rem; color: var(--text-secondary);
  margin-top: 0.1rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.bc-delta { display: block; font-size: 0.65rem; margin-top: 0.1rem; }
.bc-good { color: #6E7458; }
.bc-bad { color: #A85B5B; }
.bc-flat { color: var(--text-secondary); }

.bc-expand-btn {
  display: block; width: 100%; padding: 0.4rem; border: none;
  background: transparent; color: var(--accent, #C2A987);
  font-size: var(--text-sm); cursor: pointer; text-align: center;
}

.bc-detail { padding-top: 0.5rem; border-top: 1px solid var(--border, #333); }
.bc-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.15rem 0.75rem; margin-bottom: 0.75rem;
}
.bc-detail-row {
  display: flex; justify-content: space-between;
  align-items: baseline; padding: 0.3rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.bc-detail-row:last-child { border-bottom: none; }
.bc-detail-label { font-size: 0.8rem; color: var(--text-secondary); }
.bc-detail-val { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); text-align: right; }
.bc-detail-val small { font-weight: 400; color: var(--text-secondary); }

.bc-trends { margin-top: 0.5rem; }
.bc-trend-title { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 0.35rem; }
#bcTrendChart { width: 100%; height: 160px; }




/* ── Body Score Heatmap ──────────────────────────── */
.bs-section-wrap { margin-bottom: 0.75rem; }

.bs-hero { text-align: center; padding: 0.5rem 0 0.5rem; }
.bs-gauge-wrap {
  position: relative; width: 160px; height: 160px; margin: 0 auto 0.5rem;
}
.bs-gauge-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.bs-gauge-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); text-align: center;
}
.bs-gauge-num {
  font-size: 44px; font-weight: 700; line-height: 1;
  letter-spacing: -0.03em; color: var(--text-primary, #EAE7DF);
}
.bs-gauge-sub {
  font-size: 12px; color: var(--text-secondary, #999); margin-top: 2px;
}
.bs-gauge-bonus {
  font-size: 10px; color: #6E7458; margin-top: 2px; font-weight: 600;
}
.bs-consistency-row {
  border-top: 1px dashed rgba(110, 116, 88, 0.3);
  margin-top: 4px;
  padding-top: 8px;
}
.bs-consistency-row .bs-pillar-name {
  color: #6E7458;
  font-weight: 600;
}
.bs-date {
  font-size: 12px; color: var(--text-secondary, #999); text-align: center;
}

.bs-legend {
  display: flex; justify-content: center; gap: 1rem;
  margin: 0.5rem 0 0.75rem;
}
.bs-leg-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-secondary, #999); font-weight: 500;
}
.bs-leg-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}

.bs-group { margin-bottom: 0.6rem; }
.bs-group-header {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-secondary, #999);
  padding: 0 0.25rem 0.35rem;
}

.bs-metric-card {
  background: var(--card-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px; overflow: hidden;
}

.bs-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
}
.bs-row:last-child { border-bottom: none; }

.bs-row-left { display: flex; flex-direction: column; gap: 1px; }
.bs-row-name {
  font-size: 13px; font-weight: 500;
  color: var(--text-primary, #EAE7DF);
}
.bs-row-val {
  font-size: 11px; color: var(--text-secondary, #999);
}

.bs-row-right {
  display: flex; align-items: center; gap: 8px;
}
.bs-bar-track {
  width: 60px; height: 5px;
  background: var(--border, rgba(255,255,255,0.08));
  border-radius: 3px; overflow: hidden;
}
.bs-bar-fill {
  height: 100%; border-radius: 3px; width: 0%;
}
.bs-row-score {
  font-size: 14px; font-weight: 700; min-width: 26px; text-align: right;
}

.bs-insights { padding: 0.25rem 0; }
.bs-insight {
  display: flex; gap: 0.6rem; padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
}
.bs-insight:last-child { border-bottom: none; }
.bs-insight-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  margin-top: 6px;
}
.bs-insight-text {
  font-size: 12px; line-height: 1.5;
  color: var(--text-secondary, #999);
}

/* ── Combined Trading P&L ───────────────────────────── */
.trading-pnl-card { margin-bottom: 0.75rem; }

.tpnl-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.25rem 0;
}
.tpnl-label {
  font-size: 13px; color: var(--text-secondary, #999);
}
.tpnl-value {
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: -0.02em;
}
.tpnl-positive { color: #6E7458; }
.tpnl-negative { color: #A85B5B; }

.tpnl-sub {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 11px; color: var(--text-secondary, #999);
  padding-top: 0.15rem;
}
.tpnl-sep { opacity: 0.4; }

/* ── Body Score Collapsible Metrics ─────────────────── */
.bs-toggle-row {
  display: flex; justify-content: center;
  padding: 0.5rem 0 0.25rem;
}
.bs-toggle-btn {
  background: none; border: 1px solid rgba(194,169,135,0.3);
  color: #C2A987; font-size: 12px; font-weight: 500;
  padding: 6px 20px; border-radius: 20px;
  cursor: pointer; letter-spacing: 0.03em;
  transition: all 0.25s ease;
}
.bs-toggle-btn:hover {
  background: rgba(194,169,135,0.08);
  border-color: rgba(194,169,135,0.5);
}
.bs-collapse-wrap {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.35s ease;
}
.bs-collapse-wrap.bs-expanded {
  max-height: 2000px; opacity: 1;
}

/* ── Pillar Breakdown Bars ─────────────────────────── */
.bs-pillar-card { padding: 0; }
.bs-pillar-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
}
.bs-pillar-row:last-child { border-bottom: none; }
.bs-pillar-left { display: flex; flex-direction: column; gap: 1px; }
.bs-pillar-name {
  font-size: 13px; font-weight: 500;
  color: var(--text-primary, #EAE7DF);
}
.bs-pillar-weight {
  font-size: 10px; color: var(--text-secondary, #999);
  letter-spacing: 0.02em;
}
.bs-pillar-placeholder {
  font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
  color: var(--accent, #C2A987); opacity: 0.7;
  margin-left: 4px;
}
.bs-pillar-right {
  display: flex; align-items: center; gap: 8px;
}
.bs-pillar-bar-track {
  width: 80px; height: 6px;
  background: var(--border, rgba(255,255,255,0.08));
  border-radius: 3px; overflow: hidden;
}
.bs-pillar-bar-fill {
  height: 100%; border-radius: 3px; width: 0%;
}
.bs-pillar-score {
  font-size: 15px; font-weight: 700; min-width: 28px; text-align: right;
}

/* ── Brain Training UI ─────────────────────────────── */
.bt-checks-row {
  display: flex; gap: 12px; margin-bottom: 10px;
}
.bt-check-label {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 13px; color: var(--text-primary);
}
.bt-checkbox {
  display: none;
}
.bt-check-mark {
  width: 22px; height: 22px;
  border: 2px solid var(--divider, #D5D0C4);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
}
.bt-checkbox:checked + .bt-check-mark {
  background: #6E7458;
  border-color: #6E7458;
}
.bt-checkbox:checked + .bt-check-mark::after {
  content: "\2713";
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.bt-check-text {
  font-size: 12px; color: var(--text-secondary, #999);
}
.bt-progress-text {
  font-size: 12px; color: var(--text-secondary, #999);
  margin-bottom: 6px;
}
.bt-progress-bar-track {
  width: 100%; height: 5px;
  background: var(--divider, #D5D0C4);
  border-radius: 3px; overflow: hidden;
}
.bt-progress-bar-fill {
  height: 100%; border-radius: 3px;
  background: #6E7458;
  transition: width 0.4s ease;
}





/* ═══════════════════════════════════════════════════════
   Health Tracker — unified spacing & titles (FINAL)
   ═══════════════════════════════════════════════════════ */

/* Parent container: flex column with consistent gap */
.health-tracker {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);   /* 16px — same as card margin-bottom elsewhere */
  margin-bottom: var(--space-4);
}

/* Cards inside health-tracker: let parent gap handle spacing */
.health-tracker > .card {
  margin-bottom: 0;
}

/* Body Score sits above health-tracker as a sibling */
#bodyScoreSection {
  margin-bottom: var(--space-4);
}

/* Hide empty body comp placeholder */
#bodyCompCard:empty { display: none; }

/* ── Unified sub-section titles ── */
.ht-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

/* Body Composition title (rendered by JS) — match the others */
.bc-title {
  font-weight: 600 !important;
  font-size: 1rem !important;
  color: var(--text-primary) !important;
}

/* ── Back Pain card internal spacing ── */
#backPainCard .ht-streak-banner { margin-bottom: 0.5rem; }
#backPainCard .health-input-row { margin-top: 0.5rem; }
#backPainCard .health-submit-btn { margin-top: 0.75rem; display: block; }
#backPainCard .ht-mindset-msg { margin-top: 0.75rem; }
#backPainCard .health-recommendations { margin-top: 0.5rem; }
#backPainCard .ht-exercises-section { margin-top: 0.75rem; }
#backPainCard .ht-pain-prompts { margin-top: 0.75rem; }

/* ── Collapsible trade sections ────────────────────── */
.fx-collapse-toggle {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fx-collapse-toggle:active { opacity: 0.7; }
.collapse-arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
  color: #7A7974;
}
.fx-collapse-toggle.collapsed .collapse-arrow {
  transform: rotate(-90deg);
}
#cryptoTradesList.collapsed,
#fxTradesList.collapsed,
#researchLastScanList.collapsed,
#researchSignalList.collapsed,
#researchTradeList.collapsed,
#researchOpenPositions.collapsed,
#researchRejectList.collapsed,
#goldPosList.collapsed,
#goldFillsList.collapsed,
#goldRotList.collapsed {
  display: none;
}


/* ===== Boyner's Bugle Link Card ===== */
.bugle-link-card {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: var(--card);
  color: var(--text-primary);
}
.bugle-link-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.bugle-link-card:active { transform: translateY(0); }
.bugle-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.bugle-link-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.bugle-link-arrow {
  font-size: 20px;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}
.bugle-link-card:hover .bugle-link-arrow { transform: translateX(4px); color: var(--accent); }

/* P&L % subtext (FIX-PNL-001) */
.metric-sub {
    display: block;
    font-size: 11px;
    color: #888;
    font-weight: 400;
    margin-top: 2px;
}

/* ─── WP-7 exec mode badge + drift banner (read-only) ─── */
.wp7-hidden { display: none !important; }
.wp7-exec-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 6px 0;
  flex-wrap: wrap;
}
.wp7-mode-badge {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
}
.wp7-mode-paper {
  background: #E5F4EA; color: #1F6A3A; border-color: #B6DCC2;
}
.wp7-mode-demo {
  background: #FFF3D6; color: #8A5A00; border-color: #F2D78A;
}
.wp7-mode-live {
  background: #FBD9D9; color: #9A1F1F; border-color: #F1A9A9;
}
.wp7-drift-status {
  font-size: 11px;
  font-weight: 500;
  color: #6E7458;
  letter-spacing: 0.02em;
}
.wp7-drift-banner {
  margin: 6px 0 12px 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-width: 1px;
  border-style: solid;
}
.wp7-drift-banner.wp7-warn {
  background: #FFF7E0; color: #6B4500; border-color: #F2D17A;
}
.wp7-drift-banner.wp7-critical {
  background: #FCE0E0; color: #781414; border-color: #ECA8A8;
}
.wp7-banner-sev {
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.wp7-banner-msg { flex: 1 1 auto; }
.wp7-banner-detail {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  font-size: 11px;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
}
.wp7-banner-detail:hover { background: rgba(0,0,0,0.05); }
.wp7-banner-body {
  flex-basis: 100%;
  margin: 6px 0 0 0;
  background: rgba(0,0,0,0.04);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
}
/* ─── end WP-7 ─── */

/* ── FIX-032: Open Trade Health strip + 7-bar trail ─────────────── */
.fx-health {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 6px 10px;
    background: #faf7f0;
    border-radius: 6px;
    font-size: 12px;
}
.fx-health-pill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.fx-health-pill-VALID    { background:#e8f5e9; color:#2e7d32; }
.fx-health-pill-WATCH    { background:#fff8e1; color:#a06800; }
.fx-health-pill-DRIFTING { background:#fde7d4; color:#c25600; }
.fx-health-pill-INVALID  { background:#fdecec; color:#c0392b; }

.fx-health-score { color:#2C2C2C; flex-shrink:0; }
.fx-health-from  { color:#888; }
.fx-health-to    { color:#2C2C2C; font-weight:700; }
.fx-health-arrow { color:#999; font-weight:700; }
.fx-health-delta-down { color:#c25600; font-weight:600; }
.fx-health-delta-up   { color:#2e7d32; font-weight:600; }
.fx-health-delta-flat { color:#888; }

.fx-health-reasons {
    color: #666;
    font-size: 11px;
    flex: 1;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fx-health-trail {
    display: flex;
    gap: 2px;
    align-items: center;
    margin-top: 6px;
    padding-left: 10px;
}
.fx-health-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: #ddd;
}
.fx-health-dot-VALID    { background:#a5d6a7; }
.fx-health-dot-WATCH    { background:#ffd54f; }
.fx-health-dot-DRIFTING { background:#ffb280; }
.fx-health-dot-INVALID  { background:#e57373; }
.fx-health-trail-label  { font-size:10px; color:#888; margin-left:6px; }
