/* Local content preview, 2026-10-20.
   Targeted table and mobile discovery corrections. Existing data and behavior
   remain in their original HTML/JS; these rules do not style comparison panels. */

/* Keep the row identity beside horizontally scrolled source-grade values.
   The typography layer otherwise gives checkbox cells position: relative. */
html:root body#top#top #grade-data .source-technical-table tbody tr > td:first-child {
  position: sticky !important;
  left: 0 !important;
  z-index: 2 !important;
  background: #fff !important;
  box-shadow: 2px 0 0 #c4d8e5;
}

html:root body#top#top #grade-data .source-technical-table thead tr > th:first-child {
  z-index: 4 !important;
}

html:root body#top#top #grade-data .source-technical-table tbody tr:nth-child(even) > td:first-child {
  background: #f3f6f8 !important;
}

@media (max-width: 600px) {
  /* At 320px, a 120px row label and a 156px data column fit together.
     The first column retains the existing 44px checkbox hit area. */
  html:root body#top#top #grade-data .source-technical-table {
    width: 900px !important;
    min-width: 900px !important;
    table-layout: fixed !important;
  }

  html:root body#top#top #grade-data .source-technical-table :is(th, td) {
    width: 156px !important;
    min-width: 0 !important;
    max-width: 156px !important;
    padding: 12px 10px !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
  }

  html:root body#top#top #grade-data .source-technical-table :is(th, td):first-child {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
  }

  html:root body#top#top #grade-data .source-technical-table tbody td:first-child {
    padding-left: 52px !important;
    padding-right: 6px !important;
    white-space: nowrap !important;
  }

  html:root body#top#top #grade-data .source-technical-table :is(th, td):last-child,
  html:root body#top#top #grade-data .source-technical-table td:last-child a {
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  /* Material comparison keeps its first column, with each explanatory column
     narrow enough to be completely revealed beside it. */
  html:root body.page-materials#top#top #material-comparison .corporate-material-table {
    width: 440px !important;
    min-width: 440px !important;
    table-layout: fixed !important;
  }

  html:root body.page-materials#top#top #material-comparison .corporate-material-table :is(th, td) {
    min-width: 0 !important;
    max-width: none !important;
    padding: 12px 10px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  html:root body.page-materials#top#top #material-comparison .corporate-material-table :is(th, td):first-child {
    width: 100px !important;
  }

  html:root body.page-materials#top#top #material-comparison .corporate-material-table :is(th, td):nth-child(2),
  html:root body.page-materials#top#top #material-comparison .corporate-material-table :is(th, td):nth-child(3) {
    width: 170px !important;
  }

  /* Reach a selectable grade without spending a full screen on controls.
     Search, family selection, status, reset and unit notes remain present. */
  html:root body#top#top #grade-data > summary {
    padding: 12px 14px !important;
    gap: 4px 12px !important;
    min-height: 0 !important;
    font-size: 18px !important;
    line-height: 1.35 !important;
  }

  html:root body#top#top #grade-data > summary .emh-reference-count {
    font-size: 14px !important;
    line-height: 1.4 !important;
  }

  html:root body#top#top #grade-data .product-table-tools {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 8px 10px !important;
    padding: 12px 14px !important;
    align-items: center !important;
  }

  html:root body#top#top #grade-data .product-table-tools > label {
    grid-column: 1 / -1;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
  }

  html:root body#top#top #grade-data .product-table-tools :is(input, select, button) {
    min-height: 44px !important;
    padding: 8px 10px !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
  }

  html:root body#top#top #grade-data .product-table-tools .product-filter-reset {
    justify-self: start;
  }

  html:root body#top#top #grade-data .product-table-count {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    text-align: right;
  }

  html:root body#top#top #grade-data .grade-comparison {
    padding: 12px 14px !important;
  }

  html:root body#top#top #grade-data .compare-toolbar {
    gap: 10px !important;
    align-items: flex-start !important;
  }

  html:root body#top#top #grade-data .compare-toolbar p {
    max-width: none !important;
    min-width: 0;
    flex: 1;
    font-size: 14px !important;
    line-height: 1.4 !important;
  }

  html:root body#top#top #grade-data .compare-toolbar p strong {
    font-size: 16px !important;
    line-height: 1.4 !important;
  }

  html:root body#top#top #grade-data .compare-toolbar button {
    min-height: 44px !important;
    flex: 0 0 92px;
    padding: 8px !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
  }

  html:root body#top#top #grade-data .em-review-units {
    margin: 10px 14px !important;
  }

  html:root body#top#top #grade-data .em-review-units > summary {
    padding: 10px 0 !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    min-height: 44px !important;
  }

  html:root body#top#top #grade-data > .review-table-hint {
    margin: 8px 0 !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  /* Compact the catalog introduction and filters while preserving every
     product, image, label and filter action. */
  html:root body.page-products#top#top .emh-page-intro {
    padding: 24px 20px 20px !important;
    min-height: 0 !important;
  }

  html:root body.page-products#top#top .emh-page-intro .breadcrumbs {
    margin-bottom: 12px !important;
  }

  html:root body.page-products#top#top .emh-page-intro .eyebrow {
    margin: 0 0 8px !important;
  }

  html:root body.page-products#top#top .emh-page-intro h1 {
    margin: 0 0 12px !important;
  }

  html:root body.page-products#top#top .emh-page-intro .page-lede {
    margin: 0 !important;
  }

  html:root body.page-products#top#top #product-catalog {
    padding-top: 24px !important;
  }

  html:root body.page-products#top#top #product-catalog .catalog-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
    align-items: center !important;
    margin-bottom: 12px !important;
  }

  html:root body.page-products#top#top #product-catalog .filter-buttons {
    grid-column: 1 / -1;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  html:root body.page-products#top#top #product-catalog .filter-buttons button {
    min-height: 44px !important;
    padding: 8px 10px !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
  }

  html:root body.page-products#top#top #product-catalog .catalog-search {
    width: 100% !important;
    min-width: 0 !important;
  }

  html:root body.page-products#top#top #product-catalog :is(.catalog-search input, .clear-catalog) {
    min-height: 44px !important;
    padding: 8px 10px !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
  }

  html:root body.page-products#top#top #product-catalog .catalog-result-count {
    margin: 10px 0 14px !important;
    font-size: 16px !important;
  }
}
