.tpc-container {
  max-width: 800px;
  margin: 0 auto;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(219,225,234,0.7);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  padding: 26px;
}

.tpc-container * {
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.tpc-header {
  text-align: center;
  margin-bottom: 24px;
}

.tpc-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-header p {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-notification {
  background: var(--soft, #f8fafc);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--muted);
  border: 1px solid rgba(219,225,234,0.7);
  text-align: center;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-modes {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(219,225,234,0.7);
}

.tpc-mode-btn {
  background: #4b5563 !important;
  border: none !important;
  padding: 12px 24px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: white !important;
  cursor: pointer !important;
  position: relative !important;
  transition: all 0.2s ease !important;
  margin: 0 5px 10px 5px !important;
  border-radius: 14px !important;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.tpc-mode-btn:hover {
  background: #374151 !important;
  color: white !important;
}

.tpc-mode-btn.active {
  background: #374151 !important;
  color: white !important;
  font-weight: 700 !important;
}

.tpc-panel {
  display: none;
  padding: 24px;
  background: var(--soft, #f8fafc);
  border-radius: 16px;
  border: 1px solid rgba(219,225,234,0.7);
  margin-bottom: 24px;
}

.tpc-panel.active {
  display: block;
}

.tpc-instruction {
  text-align: center;
  margin-bottom: 24px;
}

.tpc-instruction p {
  font-size: 16px;
  margin: 0 0 16px;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-target-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.tpc-target-selector label {
  font-weight: 600;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-target-selector select {
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(219,225,234,0.85);
  background: #fff;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-controls {
  text-align: center;
  margin-bottom: 24px;
}

/* Fixing button styles to match site's grey buttons */
.tpc-container .tpc-btn,
.elementor .tpc-container .tpc-btn {
  padding: 10px 22px !important; /* thinner */
  font-size: 16px !important;
  font-weight: 800 !important; /* closer to site */
  border-radius: 14px !important;
  border: none !important;
  cursor: pointer !important;

  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: 1 !important;
  text-decoration: none !important;

  background: #4b5563 !important;
  color: white !important;

  box-shadow: none !important;
  transition: transform .15s ease, opacity .15s ease !important;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}
.tpc-container .tpc-btn:hover,
.elementor .tpc-container .tpc-btn:hover {
  background: #374151 !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}

.tpc-container .tpc-btn:active,
.elementor .tpc-container .tpc-btn:active {
  transform: translateY(0px) !important;
  opacity: 0.95 !important;
}

.tpc-container .tpc-primary-btn.running {
  opacity: 0.9 !important;
}

.tpc-btn-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.tpc-results, .tpc-prod-results {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(219,225,234,0.7);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.tpc-result-display {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(219,225,234,0.85);
}

.tpc-result-display:last-child {
  border-bottom: none;
}

.tpc-result-label {
  font-weight: 600;
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-feedback {
  margin-top: 16px;
  text-align: center;
  font-weight: 600;
  padding: 12px;
  border-radius: 14px;
  background: #f5f7fa;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-feedback.great {
  background: #e6f6ea;
  color: #2a6745;
}

.tpc-feedback.good {
  background: #fef8e7;
  color: #8a6534;
}

.tpc-feedback.needs-work {
  background: #fce8e8;
  color: #9c2929;
}

.tpc-history {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(219,225,234,0.7);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  padding: 26px;
  margin-top: 24px;
  display: none; /* Hidden by default */
}

.tpc-history.visible {
  display: block;
}

.tpc-history h3 {
  text-align: center;
  font-size: 20px;
  margin: 0 0 16px;
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-history-chart {
  height: 200px;
  margin-bottom: 24px;
  position: relative;
}

.tpc-no-data {
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-style: italic;
  background: #fff;
  border: 1px dashed rgba(219,225,234,0.85);
  border-radius: 14px;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-stat-cards {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
}

.tpc-stat-card {
  text-align: center;
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(219,225,234,0.85);
  border-radius: 14px;
  width: 30%;
}

.tpc-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-stat-label {
  font-size: 14px;
  color: var(--muted);
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-tips {
  background: #fff;
  border-left: 4px solid var(--text);
  padding: 16px;
  border-radius: 0 14px 14px 0;
  margin-bottom: 20px;
}

.tpc-tips h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 16px;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tpc-tips ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted2);
}

.tpc-tips li {
  margin: 8px 0;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .tpc-container {
    padding: 16px;
  }
  
  .tpc-stat-cards {
    flex-direction: column;
    gap: 12px;
  }
  
  .tpc-stat-card {
    width: auto;
  }
  
  .tpc-btn-row {
    flex-direction: column;
    gap: 10px;
  }
}

/* Fix Chart.js font */
.chartjs-size-monitor,
.chartjs-render-monitor {
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.chartjs-tooltip {
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* =========================================
   FIX MODE BUTTONS (NO JUMP, WEIGHT 800)
========================================= */

.tpc-mode-btn {
  font-weight: 800 !important;
  line-height: 1 !important;
  height: 46px !important;              /* lock height */
  padding: 12px 24px !important;        /* same as before */
  box-sizing: border-box !important;    /* prevent growth */
}

/* Ensure active state does NOT change size */
.tpc-mode-btn.active {
  font-weight: 800 !important;
}
