/* =========================================
   1. GLOBAL VARIABLES & UTILITIES
   ========================================= */
:root {
  --mrp-heading: #1C0D0A;
  --mrp-body: #353535;
  --mrp-accent: #FF6210;
  --mrp-border-color: #e0e0e0;
  --mrp-bg-light: #f9f9f9;
  --mrp-font-heading: 'Outfit', sans-serif;
  --mrp-font-body: 'DM Sans', sans-serif;
}

/* Utility Classes */
.text-center { text-align: center !important; }
.my-5 { margin: 10px 0 !important; }
.p-2 { padding: 5px 10px !important; }
.m-0 { margin: 0 !important; text-align: center !important; }

/* 1200px Container Override (Force Astra & Global) */
@media (min-width: 922px) {
  body.post-type-archive-tool .site-content > .ast-container,
  body.tax-tool_category .site-content > .ast-container,
  .mtp-single-wrapper,
  .mtp-page-header,
  .mtp-filter-form,
  .mtp-archive-grid,
  .mtp-pagination-wrapper {
    max-width: 1200px !important;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
}

/* =========================================
   2. MAIN LAYOUT & TYPOGRAPHY
   ========================================= */
.mtp-tool-wrapper,
.responsive-table-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mtp-tool-wrapper {
  background: #fff;
  border: 1px solid var(--mrp-border-color);
  border-radius: 8px;
  padding: 25px;
  margin: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.mtp-single-wrapper {
  padding: 0 20px;
}

/* Headers */
.mtp-tool-title,
.mtp-page-title,
.mtp-result-title,
.mtp-result-protein-title {
  font-family: var(--mrp-font-heading);
  color: var(--mrp-heading);
}

.mtp-tool-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  text-align: center;
}

.mtp-page-title {
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center !important;
  margin: 0;
}

.mtp-page-header {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--mrp-border-color);
  padding-bottom: 20px;
}

.mtp-page-excerpt {
  font-family: var(--mrp-font-body);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--mrp-body);
  margin: 10px auto 0;
}

/* Layout Columns */
.mtp-tool-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap-reverse;
  gap: 30px;
}

.mtp-tool-layout__main {
  flex: 3;
  min-width: 0;
}

.mtp-tool-layout__sidebar {
  flex: 2;
  min-width: 280px;
}

.mtp-sidebar-sticky-wrapper {
  position: sticky;
  top: 30px;
}

/* Page Content */
.mtp-page-content {
  font-family: var(--mrp-font-body);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--mrp-body);
}

.mtp-page-content p,
.mtp-page-content ul,
.mtp-page-content ol {
  margin-bottom: 1.5em;
}

.mtp-page-content h2,
.mtp-page-content h3 {
  font-family: var(--mrp-font-heading);
  color: var(--mrp-heading);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.mtp-page-content h2 { font-size: 1.8rem; font-weight: 700; }
.mtp-page-content h3 { font-size: 1.5rem; font-weight: 600; }

.mtp-page-content li p,
.mtp-faq-answer li p {
  margin-top: 0;
  margin-bottom: 0;
}

/* =========================================
   3. FORMS & INPUTS
   ========================================= */
.mtp-input-group { margin-bottom: 15px; }

.mtp-input-group label {
  font-family: var(--mrp-font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--mrp-body);
  display: block;
  margin-bottom: 8px;
}

.mtp-input-group input[type="number"],
.mtp-input-group input[type="text"],
.mtp-input-group select.mtp-select,
.mtp-filter-form__select,
.mtp-textarea {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  font-family: var(--mrp-font-body);
}

.mtp-textarea {
  font-family: monospace;
}

/* Custom Select Dropdown Styling */
.mtp-input-group select.mtp-select,
.mtp-filter-form__select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  background-color: #fff;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.mtp-input-row { display: flex; gap: 10px; }
.mtp-input-desc { font-size: 0.85rem; font-style: italic; color: #777; margin: 5px 0 0; }

/* Buttons */
.mtp-button {
  font-family: var(--mrp-font-body);
  background: var(--mrp-accent);
  color: #000000;
  font-weight: 700;
  border-radius: 5px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--mrp-accent);
  font-size: 1rem;
  width: 100%;
}

.mtp-button:hover { background: #e0560e; border-color: #e0560e; }

.mtp-button--secondary {
  background: #f0f0f0;
  border-color: #ccc;
  color: #444;
}

.mtp-button--secondary:hover { background: #e0e0e0; border-color: #bbb; }

/* =========================================
   4. RESULTS & FEEDBACK
   ========================================= */
.mtp-result {
  margin-top: 20px;
  border-radius: 5px;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.5;
}

.mtp-result-label {
  font-weight: 600;
  color: var(--mrp-body);
  display: block;
}

/* Merged Result Value Styles */
.mtp-result-value {
  font-size: 2.5rem;
  font-weight: 700;
  display: block;
  margin: 5px 0;
  color: #333;
  /* Specific to disabled result inputs */
  background-color: #f0f0f0;
  cursor: not-allowed;
}

.mtp-result-category { font-style: italic; font-weight: 600; }
.mtp-success { color: #28a745; }
.mtp-warn { color: #ffc107; }
.mtp-error { color: #dc3545; }
.mtp-info { color: #007bff; }

.mtp-result-note {
  font-size: 0.9rem;
  color: #555;
  margin-top: 15px;
  margin-bottom: 0;
  line-height: 1.4;
  text-align: left;
}
.mtp-result-note.mtp-error { font-weight: 600; }

/* Result Text Box (e.g. Scaler) */
.mtp-result-text {
  background-color: #fff;
  border: 1px solid var(--mrp-border-color);
  border-radius: 5px;
  padding: 15px;
  min-height: 100px;
  line-height: 1.6;
  font-family: monospace;
  font-size: 1rem;
  color: #000;
}

/* =========================================
   5. SPECIFIC TOOLS CSS
   ========================================= */

/* Temperature & Converters */
.mtp-temp-row,
.mtp-converter-row {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  margin-bottom: 20px;
}

.mtp-temp-row .mtp-input-group,
.mtp-converter-row .mtp-input-group {
  flex: 1;
  margin-bottom: 0;
}

.mtp-temp-equals {
  font-size: 2rem;
  font-weight: 700;
  color: var(--mrp-body);
  padding-bottom: 10px;
}

/* TDEE Result Layout */
.mtp-result-tdee { display: flex; flex-direction: column; gap: 20px; }
.mtp-result-tdee__group,
.mtp-result-hydration__group {
  background: #fff;
  border: 1px solid var(--mrp-border-color);
  padding: 15px;
  border-radius: 5px;
}

.mtp-result-tdee .mtp-result-label,
.mtp-result-hydration .mtp-result-label { font-size: 1rem; font-weight: 600; }
.mtp-result-tdee .mtp-result-value { font-size: 2rem; margin: 0; }
.mtp-result-tdee .mtp-result-category,
.mtp-result-hydration .mtp-result-category { font-size: 0.9rem; font-style: italic; color: #555; }

/* Hydration Layout */
.mtp-result-hydration { display: flex; flex-wrap: wrap; gap: 20px; }
.mtp-result-hydration__group { flex: 1; min-width: 150px; }
.mtp-result-hydration .mtp-result-value { font-size: 2.2rem; margin: 5px 0 0 0; }

/* Calorie Target */
.mtp-result-target { margin-top: 15px; padding-top: 15px; border-top: 1px dashed var(--mrp-border-color); }

/* Macro Calculator Tabs */
.mtp-tab-buttons {
  display: flex;
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--mrp-accent);
}
.mtp-tab-btn {
  flex: 1;
  padding: 10px 5px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mrp-font-body);
  border: none;
  background: #fff;
  color: var(--mrp-accent);
  cursor: pointer;
  transition: all 0.2s ease;
}
.mtp-tab-btn:first-child { border-right: 1px solid var(--mrp-accent); }
.mtp-tab-btn.mtp-tab-btn--active { background: var(--mrp-accent); color: #000; }
.mtp-tab-content {
  border: 1px dashed var(--mrp-border-color);
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 5px;
}
.mtp-divider { border: none; border-top: 1px solid var(--mrp-border-color); margin: 10px 0 20px; }

/* Nutrition Logger Status */
#mtp-nutrition-status {
  padding: 15px;
  background: #fff;
  border: 1px solid var(--mrp-border-color);
  border-radius: 5px;
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
}
#mtp-nutrition-status h4 { margin: 0 0 10px; font-family: var(--mrp-font-heading); }
#mtp-nutrition-status ul { margin: 0; padding-left: 20px; font-family: monospace; }
#mtp-nutrition-status li { margin-bottom: 5px; }

/* Protein Calculator */
.mtp-result-protein-title { margin: 0 0 15px; text-align: center; font-size: 1.2rem; font-weight: 600; }
.mtp-result-protein-groups { display: flex; flex-wrap: wrap; gap: 20px; }
.mtp-result-protein-groups .mtp-result-tdee__group { flex: 1; min-width: 150px; }

/* Nutrition Facts Label */
.mtp-nutrition-label {
  font-family: 'DM Sans', sans-serif;
  border: 3px solid #000;
  padding: 10px;
  border-radius: 5px;
  margin-top: 20px;
  background: #fff;
  color: #000;
}
.mtp-nutrition-label header { border-bottom: 10px solid #000; padding-bottom: 5px; }
.mtp-nutrition-title { font-family: 'Outfit', sans-serif; font-size: 2.5rem; font-weight: 800; margin: 0; color: #000; text-align: left; }
.mtp-nutrition-servings { display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: 600; border-top: 1px solid #000; padding-top: 5px; }
.mtp-nutrition-table { width: 100%; border-collapse: collapse; }
.mtp-nutrition-table th, .mtp-nutrition-table td { padding: 3px 0; font-weight: 700; text-align: right; }
.mtp-nutrition-table thead th { font-size: 1.1rem; padding-top: 5px; border-bottom: 5px solid #000; }
.mtp-nutrition-table thead th:last-child { font-size: 2.2rem; }
.mtp-nutrition-table tbody tr { border-bottom: 1px solid #000; }
.mtp-nutrition-table .mtp-nutrition-indent { padding-left: 15px; font-weight: 400; }
.mtp-nutrition-footer { border-top: 5px solid #000; padding-top: 5px; margin-top: 5px; }
.mtp-nutrition-footer p { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.mtp-nutrition-footer span { font-weight: 700; }

/* Substitution Finder */
.mtp-sub-filter-group { display: flex; flex-wrap: wrap; gap: 10px; background: #fff; padding: 10px; border-radius: 5px; border: 1px solid var(--mrp-border-color); }
.mtp-filter-placeholder { color: #999; font-style: italic; }
.mtp-sub-filter-item { display: flex; align-items: center; }
.mtp-sub-filter-item label { margin: 0 0 0 5px; font-weight: 500; cursor: pointer; }
.mtp-sub-results-list { display: flex; flex-direction: column; gap: 15px; }
.mtp-sub-result-item { background: #fff; border: 1px solid var(--mrp-border-color); padding: 15px; border-radius: 5px; }
.mtp-sub-result-item h3 { font-family: var(--mrp-font-heading); font-size: 1.3rem; font-weight: 600; margin: 0 0 5px; }
.mtp-sub-result-item h3 a { text-decoration: none; color: var(--mrp-accent); }
.mtp-sub-result-item h3 a:hover { text-decoration: underline; }
.mtp-sub-result-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mtp-sub-tag { font-size: 0.8rem; font-weight: 600; background: #f0f0f0; color: #555; padding: 3px 8px; border-radius: 3px; text-transform: uppercase; }

/* =========================================
   6. ARCHIVES, FILTERS & FAQ
   ========================================= */
.mtp-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.mtp-tool-card {
  display: flex; flex-direction: column;
  text-decoration: none;
  border: 1px solid var(--mrp-border-color);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: all 0.2s ease-in-out;
}
.mtp-tool-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-3px); border-color: var(--mrp-accent); }
.mtp-tool-card__image { aspect-ratio: 4 / 3; width: 100%; overflow: hidden; background: #f9f9f9; }
.mtp-tool-card__image img { width: 100%; height: 100%; object-fit: cover; }
.mtp-tool-card__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 4rem; color: #e0e0e0; background: #fafafa; }
.mtp-tool-card__content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.mtp-tool-card__title { font-family: var(--mrp-font-heading); font-size: 1.3rem; font-weight: 600; color: var(--mrp-heading); margin: 0 0 10px; }
.mtp-tool-card__excerpt { font-family: var(--mrp-font-body); font-size: 0.9rem; color: var(--mrp-body); line-height: 1.5; margin: 0; flex-grow: 1; }

/* Filters */
.mtp-filter-form {
  padding: 20px 20px 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
  background: var(--mrp-bg-light);
  border: 1px solid var(--mrp-border-color);
  border-radius: 8px;
}
.mtp-filter-form__group { display: flex; align-items: center; gap: 10px; flex-grow: 1; margin-bottom: 15px; }
.mtp-filter-form__label { font-family: var(--mrp-font-body); font-weight: 600; font-size: 1rem; color: var(--mrp-heading); }
.mtp-filter-form__select-wrapper { position: relative; flex-grow: 1; }
.mtp-filter-form__select-wrapper::after {
  content: ''; position: absolute; top: 50%; right: 15px; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid var(--mrp-body);
  transform: translateY(-50%); pointer-events: none;
}
.mrp-filter-form__actions { flex-basis: 100%; text-align: right; margin-top: -10px; padding-bottom: 10px; }
.mrp-filter-form__reset { font-family: var(--mrp-font-body); font-size: 0.9rem; font-weight: 600; color: var(--mrp-accent); text-decoration: none; border-radius: 5px; padding: 5px 0; }

/* Pagination */
.mtp-pagination-wrapper { text-align: center; margin-top: 30px; }
.mtp-pagination-wrapper .pagination, .mtp-pagination-wrapper .page-numbers { display: inline-block; }
.mtp-pagination-wrapper .page-numbers {
  padding: 8px 15px; margin: 0 3px; border: 1px solid var(--mrp-border-color);
  border-radius: 5px; font-family: var(--mrp-font-body); font-weight: 600; color: var(--mrp-body);
  text-decoration: none; transition: all 0.2s ease;
}
.mtp-pagination-wrapper .page-numbers:hover { background: var(--mrp-bg-light); color: var(--mrp-accent); border-color: var(--mrp-accent); }
.mtp-pagination-wrapper .page-numbers.current { background: var(--mrp-accent); border-color: var(--mrp-accent); color: #fff; }

/* FAQ & Bio */
.mtp-faq-item { border-bottom: 1px dashed #ccc; padding: 15px 0; }
.mtp-faq-item:first-of-type { padding-top: 0; }
.mtp-faq-item:last-of-type { border-bottom: none; padding-bottom: 0; }
.mtp-faq-question { font-family: var(--mrp-font-heading); font-size: 1.2rem; font-weight: 600; color: var(--mrp-heading); margin: 0 0 10px 0; }
.mtp-faq-answer p:last-child { margin-bottom: 0; }

.mtp-author-bio { display: flex; align-items: center; gap: 20px; }
.mtp-author-bio__avatar img { border-radius: 50%; border: 2px solid #e0e0e0; }
.mtp-author-bio__name { font-family: var(--mrp-font-heading); font-size: 1.3rem; margin: 0 0 5px 0; }
.mtp-author-bio__description { font-size: 0.95rem; margin: 0; color: #555; }

/* Related Section */
.mtp-related-section { padding: 20px 0; margin-top: 30px; border-top: 1px solid #e0e0e0; }
.mtp-related-section h2 { font-family: var(--mrp-font-heading); font-size: 1.8rem; font-weight: 700; color: var(--mrp-heading); margin-top: 0; margin-bottom: 20px; }

/* SEO Section */
.mtp-seo-section { padding: 25px; margin-top: 30px; background: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 8px; }
.mtp-tool-anchor { margin-bottom: 30px; }
.mtp-interpretation { padding: 0; background: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.mtp-seo-section h2 { font-family: var(--mrp-font-heading); font-size: 1.8rem; font-weight: 700; color: var(--mrp-heading); margin-top: 0; margin-bottom: 20px; }
.mtp-seo-section p, .mtp-seo-section li, .mtp-interpretation { font-family: var(--mrp-font-body); font-size: 1rem; line-height: 1.7; color: var(--mrp-body); }
section.mtp-seo-section.mtp-interpretation table { margin-bottom: 0 !important; }

/* =========================================
   7. TABLE STYLES (New & Legacy)
   ========================================= */

/* A. NEW Standard Responsive Table (mh-responsive-table) */
.mh-responsive-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  padding: 0;
  background-color: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}
.mh-responsive-table caption {
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-weight: bold;
  color: #333;
  text-align: center;
}
.mh-responsive-table thead tr {
  background-color: var(--mrp-accent);
  color: #ffffff;
  text-align: left;
}
.mh-responsive-table th,
.mh-responsive-table td { padding: 12px 15px; border: 1px solid #dddddd; }
.mh-responsive-table tbody tr { border-bottom: 1px solid #dddddd; }
.mh-responsive-table tbody tr:nth-of-type(even) { background-color: #f3f3f3; }
.mh-responsive-table tbody tr:last-of-type { border-bottom: 2px solid var(--mrp-accent); }
.mtp-author-bio__avatar{width: 100%}
/* B. Legacy Tables (Consolidated common styles) */
.volume-table, .temp-table, .weight-table {
  width: 100%;
  border-collapse: collapse;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin-bottom: 1.5rem;
}
.volume-table caption, .temp-table caption, .weight-table caption {
  caption-side: top; text-align: center; font-weight: 700; margin-bottom: 0.5rem;
}
.volume-table th, .volume-table td,
.temp-table th, .temp-table td,
.weight-table th, .weight-table td {
  padding: 0.6rem 0.75rem; border: 1px solid #e5e7eb; text-align: left;
}
.volume-table th, .temp-table th, .weight-table th { background-color: #fafafa; font-weight: 600; }
.volume-table tbody tr:nth-child(odd),
.temp-table tbody tr:nth-child(odd),
.weight-table tbody tr:nth-child(odd) { background: #fff; }
.volume-table tbody tr:nth-child(even),
.temp-table tbody tr:nth-child(even),
.weight-table tbody tr:nth-child(even) { background: #fbfbfb; }

/* C. Old Result Tables */
.mtp-results-table { width: 100%; border-collapse: collapse; margin: 0; }
.mtp-results-table thead { background-color: #fff; }
.mtp-results-table th {
  font-family: var(--mrp-font-heading); font-weight: 600; padding: 12px 15px; text-align: left;
  font-size: 1.1rem; color: var(--mrp-heading); border-bottom: 2px solid var(--mrp-border-color);
}
.mtp-results-table td { padding: 12px 15px; border-bottom: 1px solid var(--mrp-border-color); color: var(--mrp-body); }
.mtp-results-table tbody tr:nth-child(2) { background-color: #fff; font-weight: 600; }
.mtp-results-table.mtp-macro-table tr th,
.mtp-results-table.mtp-macro-table tr td { padding: 8px; border: 1px solid #ddd; }
.mtp-macro-table { margin-top: 15px; }
.mtp-macro-table td:last-child { font-size: 1.1rem; }

/* =========================================
   8. MEDIA QUERIES (Mobile & Responsive)
   ========================================= */

/* General Mobile Layout Adjustments */
@media (max-width: 768px) {
  .mtp-tool-layout { /* flex-direction: column-reverse; */ }
  .mtp-sidebar-sticky-wrapper { position: static; }
  .mtp-interpretation { background: #fff; border: 0px solid #e0e0e0; }
  .mtp-page-title.tools-title { font-size: 1.5rem !important; text-align: left !important; }
  
  /* Bio adjustments */
  .mtp-author-bio { flex-direction: column; gap: 20px; }
  .mtp-author-bio__avatar img {
    border-radius: 50%; border: 2px solid #e0e0e0; margin: auto; display: block;
    width: 80% !important; /* Preserved specifically */
  }

  /* Basic Responsive Wrapper */
  .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-responsive table { width: 100%; border-collapse: collapse; }
  .table-responsive th, .table-responsive td { padding: 10px; border: 1px solid #ccc; text-align: left; }

  /* New MH Table Mobile Styles */
  .mh-responsive-table { border: 0; box-shadow: none; }
  .mh-responsive-table caption { font-size: 1.1rem; margin-bottom: 15px; text-align: center; }
  .mh-responsive-table thead {
    border: none; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;
  }
  .mh-responsive-table tr {
    border-bottom: 3px solid #ddd; display: block; margin-bottom: 1.5rem; background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden;
  }
  .mh-responsive-table td {
    border-bottom: 1px solid #eee; display: block; font-size: 0.95rem; text-align: right;
    padding-left: 50%; position: relative;
  }
  .mh-responsive-table td::before {
    content: attr(data-label); position: absolute; left: 15px; width: 45%; padding-right: 10px;
    white-space: nowrap; text-align: left; font-weight: bold; color: var(--mrp-accent);
  }
  .mh-responsive-table td:last-child { border-bottom: 0; }
}

/* Specific Mobile Card-View for Legacy Tables (Volume, Temp, Weight, Results) */
@media (max-width: 700px) {
  /* Legacy Group */
  .volume-table, .volume-table thead, .volume-table tbody, .volume-table tr, .volume-table td, .volume-table th,
  .temp-table, .temp-table thead, .temp-table tbody, .temp-table tr, .temp-table td, .temp-table th,
  .weight-table, .weight-table thead, .weight-table tbody, .weight-table tr, .weight-table td, .weight-table th {
    display: block; width: 100%;
  }
  .volume-table caption, .temp-table caption, .weight-table caption {
    text-align: center; font-size: 14px; display: block;
  }
  .volume-table thead, .temp-table thead, .weight-table thead {
    position: absolute; top: -9999px; left: -9999px;
  }
  .volume-table tbody tr, .temp-table tbody tr, .weight-table tbody tr {
    margin-bottom: 1rem; border: 1px solid #e5e7eb; border-radius: 8px; padding: 0.5rem; background: #fff;
  }
  .volume-table td, .temp-table td, .weight-table td {
    border: none; padding: 0.4rem 0; position: relative; text-align: left;
  }
  .volume-table td::before, .temp-table td::before, .weight-table td::before {
    content: attr(data-label); font-weight: 700; display: inline-block; width: 130px; color: #333; margin-right: 0.5rem;
  }
  .temp-table td.value { color: #0b5cff; font-weight: 600; }

  /* Old Results Table Mobile */
  .mtp-results-table thead { display: none; }
  .mtp-results-table tr {
    display: block; border: 1px solid var(--mrp-border-color); margin-bottom: 10px; border-radius: 4px; overflow: hidden;
  }
  .mtp-results-table td {
    display: block; text-align: right; position: relative; padding-left: 50%; border-bottom: 1px solid var(--mrp-border-color);
  }
  .mtp-results-table td:last-child { border-bottom: none; }
  .mtp-results-table td::before {
    content: attr(data-label); position: absolute; left: 15px; width: 45%; padding-right: 10px;
    white-space: nowrap; text-align: left; font-weight: 600; color: var(--mrp-heading);
  }
}