/* ============================================================
   TOOLSPOT — TARGET HEART RATE ZONES STYLESHEET
   ============================================================ */

/* ── METHOD & SEX TABS (Glassmorphic) ── */
.mode-toggle {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  z-index: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.mode-toggle::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.06) 100%);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 8px;
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1), background 0.28s, border-color 0.28s;
  z-index: 0;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* Method Toggle (2 choices) */
#method-toggle.mode-toggle::before {
  width: calc(50% - 6px);
}
#method-toggle.mode-toggle.active-standard::before {
  transform: translateX(0);
}
#method-toggle.mode-toggle.active-karvonen::before {
  transform: translateX(calc(100% + 4px));
}

/* Sex Toggle (2 choices) */
#sex-toggle.mode-toggle::before {
  width: calc(50% - 6px);
}
#sex-toggle.mode-toggle.active-male::before {
  transform: translateX(0);
}
#sex-toggle.mode-toggle.active-female::before {
  transform: translateX(calc(100% + 4px));
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(236, 72, 153, 0.06) 100%);
  border-color: rgba(236, 72, 153, 0.3);
}

.mode-btn {
  position: relative;
  z-index: 2;
  flex: 1;
  background: transparent !important;
  border: none;
  padding: 10px 16px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: none !important;
  transition: color 0.28s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mode-btn:hover {
  color: var(--text);
}

.mode-btn.active {
  color: #ff9f43 !important;
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

#sex-toggle.active-female .mode-btn.active {
  color: #f472b6 !important;
  text-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

.mode-btn:active {
  transform: scale(0.97);
}

/* Light mode overrides for toggles */
body.light .mode-toggle {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

body.light .mode-toggle::before {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.12) 0%, rgba(234, 88, 12, 0.04) 100%);
  border-color: rgba(234, 88, 12, 0.25);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

body.light #sex-toggle.mode-toggle.active-female::before {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(236, 72, 153, 0.04) 100%);
  border-color: rgba(236, 72, 153, 0.25);
}

body.light .mode-btn {
  color: #556b82;
}

body.light .mode-btn:hover {
  color: #0f172a;
}

body.light .mode-btn.active {
  color: #ea580c !important;
  text-shadow: none;
}

body.light #sex-toggle.active-female .mode-btn.active {
  color: #db2777 !important;
}

/* Header Input Box Refinement for Sliders */
.input-header .inp-box {
  width: 110px;
  height: 32px;
  border-radius: 8px;
}
.input-header .inp-box input {
  padding: 6px 10px;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}
.input-header .inp-box .inp-suf {
  padding-right: 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
}

/* Tighter vertical spacing */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── RESULT SUMMARY DISPLAY (HERO CARD) ── */
.result-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.result-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: 0.5px;
}

/* Risk indicator badges */
.risk-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Risk states background styling */
.zone1-badge { background: rgba(148, 163, 184, 0.2); border: 1px solid rgba(148, 163, 184, 0.4); color: #94a3b8; }
.zone2-badge { background: rgba(59, 130, 246, 0.2); border: 1px solid rgba(59, 130, 246, 0.4); color: #60a5fa; }
.zone3-badge { background: rgba(16, 185, 129, 0.2); border: 1px solid rgba(16, 185, 129, 0.4); color: #34d399; }
.zone4-badge { background: rgba(249, 115, 22, 0.2); border: 1px solid rgba(249, 115, 22, 0.4); color: #fb923c; }
.zone5-badge { background: rgba(239, 68, 68, 0.2);  border: 1px solid rgba(239, 68, 68, 0.4);  color: #f87171; }
.zone0-badge { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-3); }

.result-val {
  font-family: 'Outfit', sans-serif;
  font-size: 38px;
  font-weight: 900;
  color: var(--text);
  margin: 6px 0;
  letter-spacing: -1px;
  line-height: 1;
}

.result-val span {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
  margin-left: 4px;
}

.result-subtitle {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

/* Light mode overrides for results card */
body.light .result-hero {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

body.light .result-val {
  color: #0f172a;
}

body.light .zone1-badge { background: rgba(148, 163, 184, 0.1); color: #475569; border-color: rgba(148, 163, 184, 0.2); }
body.light .zone2-badge { background: rgba(59, 130, 246, 0.1); color: #2563eb; border-color: rgba(59, 130, 246, 0.2); }
body.light .zone3-badge { background: rgba(16, 185, 129, 0.1); color: #059669; border-color: rgba(16, 185, 129, 0.2); }
body.light .zone4-badge { background: rgba(249, 115, 22, 0.1); color: #ea580c; border-color: rgba(249, 115, 22, 0.2); }
body.light .zone5-badge { background: rgba(239, 68, 68, 0.1);  color: #dc2626; border-color: rgba(239, 68, 68, 0.2); }

/* ── 2D TRAINING ZONE BAR GAUGE ── */
.zone-map-wrap {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

body.light .zone-map-wrap {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.zone-map-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-align: center;
}

.chart-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.chart-container svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Tested Pointer Indicator Animation */
.tested-pointer {
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.zone-color-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

body.light .zone-color-legend {
  border-color: rgba(0, 0, 0, 0.08);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-2);
}

.legend-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── TRAINING ZONES BREAKDOWN LIST ── */
.zones-details-box {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

body.light .zones-details-box {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.zone-details-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.zones-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zone-list-item {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, background-color 0.2s;
}

.zone-list-item:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.04);
}

body.light .zone-list-item {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.04);
}

body.light .zone-list-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.zone-color-stripe {
  width: 6px;
  flex-shrink: 0;
}

.zone-item-content {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.zone-item-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.zone-item-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

body.light .zone-item-name {
  color: #1e293b;
}

.zone-item-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}

.zone-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.zone-item-range {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #ff9f43;
}

body.light .zone-item-range {
  color: #ea580c;
}

.zone-item-pct {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
}

/* Highlight active zone item */
.zone-list-item.active-zone {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(249, 115, 22, 0.04) !important;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.05);
}

body.light .zone-list-item.active-zone {
  border-color: rgba(234, 88, 12, 0.3);
  background: rgba(234, 88, 12, 0.03) !important;
}

/* ── HISTORY TABLE OVERRIDES & LOG ── */
.history-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.history-average-card {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 4px solid #ff9f43;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--text-2);
}

body.light .history-average-card {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.06);
  border-left-color: #ea580c;
  color: #334155;
}

.history-average-card b {
  color: var(--text);
  font-family: 'Outfit', sans-serif;
}

body.light .history-average-card b {
  color: #0f172a;
}

.pulse-label {
  display: block;
  width: 100%;
  font-size: 9px;
  color: var(--text-3);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cell-val {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.history-stage-badge {
  display: inline-block;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.history-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-2);
  border-bottom: 1px solid var(--glass-border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.history-table td {
  padding: 12px 16px;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
}

.history-table tr:last-child td {
  border-bottom: none;
}

.history-table .actions-cell {
  text-align: center;
}

/* Desktop specific column sizing */
.history-table th:nth-child(1), .history-table td:nth-child(1) {
  min-width: 130px;
  white-space: nowrap;
}
.history-table th:nth-child(2), .history-table td:nth-child(2) {
  min-width: 150px;
}
.history-table th:nth-child(3), .history-table td:nth-child(3) {
  min-width: 130px;
  white-space: nowrap;
}
.history-table th:nth-child(4), .history-table td:nth-child(4) {
  min-width: 145px;
  white-space: nowrap;
}
.history-table th:nth-child(5), .history-table td:nth-child(5) {
  width: 60px;
  text-align: center;
}

/* ── MOBILE CARD COLLAPSE FOR LOG TABLE ── */
@media (max-width: 768px) {
  .table-wrap {
    background: transparent !important;
    border: none !important;
    overflow-x: visible !important;
  }
  
  .history-table, 
  .history-table tbody, 
  .history-table tr, 
  .history-table td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  
  .history-table thead {
    display: none !important;
  }
  
  .history-table tr {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 14px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  body.light .history-table tr {
    background: rgba(0, 0, 0, 0.015) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
  }
  
  .history-table td {
    border: none !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: right !important;
  }
  
  .history-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    margin-right: 12px;
  }
  
  .cell-val {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    text-align: right !important;
    gap: 2px !important;
  }
}

body.light .history-table th {
  background: rgba(0, 0, 0, 0.02);
}

body.light .table-wrap {
  background: #ffffff;
}

.delete-entry-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.delete-entry-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Screen default for print-only header */
.print-only-header {
  display: none !important;
}

/* ════════ MEDIA PRINT (PDF EXPORTS) ════════ */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  /* Hide all non-report site elements */
  .bg-scene, 
  nav, 
  footer, 
  .cookie-banner, 
  .share-pill, 
  #toast-container, 
  .tool-left, 
  .history-actions, 
  .delete-entry-btn,
  #tool-faq,
  .explanatory-content,
  .breadcrumb,
  .tool-header {
    display: none !important;
  }
  
  /* Show print-only header */
  .print-only-header {
    display: block !important;
    margin-bottom: 16px;
  }
  .print-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    border-bottom: 1.5px solid #000000;
    padding-bottom: 4px;
  }
  .print-logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #000000 !important;
  }
  .print-logo-text span {
    color: #f97316 !important;
  }
  .print-report-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: #555555 !important;
    letter-spacing: 0.5px;
  }
  .print-title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #000000 !important;
    margin: 10px 0 8px;
    letter-spacing: -0.5px;
  }
  .print-meta-grid {
    display: flex;
    gap: 20px;
    font-size: 11px;
    color: #222222 !important;
    background: #f8f9fa !important;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin-bottom: 12px;
  }
  .print-divider {
    height: 1px;
    background: #e9ecef;
    margin-bottom: 16px;
  }

  .container {
    max-width: 100% !important;
    padding: 24px !important;
    margin: 0 auto !important;
  }
  .tool-layout {
    display: block !important;
  }
  .tool-right {
    width: 100% !important;
  }
  
  .panel {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 12px !important;
    box-shadow: none !important;
  }

  /* Grid layout for single-page print layout */
  .result-panel {
    display: grid !important;
    grid-template-columns: 1.15fr 1fr !important;
    gap: 16px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }
  .panel-title {
    display: none !important;
  }

  /* Staging Hero Card Print Style - Clean card with colored left indicator bar */
  .result-hero {
    grid-column: 1 / -1 !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-left: 6px solid #cccccc !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }
  .result-hero.stage-zone1 { border-left-color: #94a3b8 !important; }
  .result-hero.stage-zone2 { border-left-color: #3b82f6 !important; }
  .result-hero.stage-zone3 { border-left-color: #10b981 !important; }
  .result-hero.stage-zone4 { border-left-color: #f97316 !important; }
  .result-hero.stage-zone5 { border-left-color: #ef4444 !important; }

  .result-header-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }
  .result-label {
    color: #555555 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }
  
  /* Risk staging badges in print */
  .risk-badge {
    color: #ffffff !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    border: none !important;
    text-shadow: none !important;
  }
  .risk-badge.zone1-badge { background-color: #94a3b8 !important; }
  .risk-badge.zone2-badge { background-color: #3b82f6 !important; }
  .risk-badge.zone3-badge { background-color: #10b981 !important; }
  .risk-badge.zone4-badge { background-color: #f97316 !important; }
  .risk-badge.zone5-badge { background-color: #ef4444 !important; }

  .result-val {
    color: #000000 !important;
    font-size: 30px !important;
    font-weight: 800 !important;
    margin: 4px 0 !important;
    font-family: 'Outfit', sans-serif !important;
  }
  .sys-dia-unit {
    color: #555555 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
  }
  .result-subtitle {
    color: #333333 !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
  }
  
  /* Left column: SVG training zone map */
  .zone-map-wrap {
    grid-column: 1 !important;
    grid-row: span 2 !important;
    border: 1px solid #dee2e6 !important;
    background: #ffffff !important;
    padding: 14px !important;
    margin-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    border-radius: 12px !important;
    page-break-inside: avoid;
  }
  .zone-map-title {
    color: #333333 !important;
    margin-bottom: 6px !important;
  }
  .chart-container {
    max-width: 380px !important;
  }
  .zone-color-legend {
    border-top: 1px solid #e9ecef !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    gap: 6px 10px !important;
  }
  .legend-item {
    color: #333333 !important;
    font-size: 9.5px !important;
  }

  /* Right column: Vertical breakdowns */
  .zones-details-box {
    grid-column: 2 !important;
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    padding: 12px 14px !important;
    page-break-inside: avoid;
  }
  .zone-details-title {
    margin-bottom: 8px !important;
  }
  .zones-vertical-list {
    gap: 6px !important;
  }
  .zone-list-item {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
  }
  .zone-item-content {
    padding: 8px 12px !important;
    gap: 10px !important;
  }
  .zone-item-name {
    font-size: 11px !important;
    color: #333333 !important;
  }
  .zone-item-desc {
    font-size: 9.5px !important;
    line-height: 1.3 !important;
  }
  .zone-item-range {
    font-size: 12px !important;
    color: #dc2626 !important;
  }
  .zone-item-pct {
    font-size: 9px !important;
  }

  /* Bottom: history log table prints right below the grid without page breaks */
  .history-log-panel {
    display: block !important;
    page-break-before: auto !important;
    margin-top: 20px !important;
  }
  .history-average-card {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-left: 4px solid #f97316 !important;
    border-radius: 10px !important;
    color: #222222 !important;
    padding: 8px 14px !important;
  }
  .table-wrap {
    border: 1px solid #cccccc !important;
    background: #ffffff !important;
    border-radius: 10px !important;
  }
  .history-table th {
    background: #f1f3f5 !important;
    color: #333333 !important;
    border-bottom: 2px solid #dee2e6 !important;
    padding: 8px 12px !important;
  }
  .history-table td {
    color: #333333 !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 8px 12px !important;
  }
  .history-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Medical Disclaimer Print Styling */
  #tool-disclaimer {
    display: block !important;
    margin-bottom: 16px !important;
    page-break-inside: avoid !important;
  }
  #tool-disclaimer .sec-banner {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-left: 4px solid #ef4444 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
    color: #333333 !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    box-shadow: none !important;
    animation: none !important;
    text-shadow: none !important;
  }
  #tool-disclaimer .sec-banner svg {
    stroke: #ef4444 !important;
    fill: none !important;
    flex-shrink: 0 !important;
    margin-top: 1px !important;
    width: 14px !important;
    height: 14px !important;
  }
  #tool-disclaimer .sec-banner span {
    color: #333333 !important;
  }
  #tool-disclaimer .sec-banner strong {
    color: #dc2626 !important;
    font-weight: 700 !important;
  }
}

/* Tool Header Spacing Adjustment */
.tool-header {
  max-width: 1050px !important;
}
.tool-summary {
  max-width: 1050px !important;
}

/* ── MOBILE CONTROLS & TABLE ALIGNMENTS ── */
@media (max-width: 768px) {
  .history-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .history-average-card {
    text-align: center;
    width: 100%;
  }
  .history-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: center;
  }
  .history-actions button {
    flex: 1;
    text-align: center;
    justify-content: center;
    white-space: nowrap;
  }
}
