main.container {
  max-width: none;
  width: 96vw;
}

header .intro {
  max-width: 75ch;
  margin-inline: auto;
  margin-block: 0 2rem;
  text-align: left;
}
header .intro h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

#manufacturer-info {
  max-width: 75ch;
  margin-inline: auto;
  text-align: left;
}

#category-legend {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
#category-legend li {
  margin: 0 0 0.4rem;
  padding: 0;
  list-style: none;
}
#category-legend li::marker {
  content: "";
}

/* The header row lives in its own table/wrapper, separate from
   .table-scroll below, specifically so it has no overflow-having ancestor
   -- that's what lets position:sticky reference the real page viewport
   instead of getting trapped inside a scrolling div (overflow-x:auto
   without overflow-y silently makes the browser treat overflow-y as auto
   too, which would otherwise make the wrapper itself the sticky
   containing block). Its horizontal scroll position is kept in sync with
   .table-scroll via a scroll listener in app.js. Column widths can't come
   from natural auto-layout the way a single combined table would (two
   separate tables each compute their own, from their own content only --
   a numeric-data column can end up narrower than its header label), so
   app.js measures both tables' natural per-column widths and applies
   the max of the two to both, on every render/column-toggle/resize --
   still fully content-driven, no hardcoded sizes anywhere. */
.table-header-scroll, .table-scroll {
  position: relative;
}
/* A fade at the clipped right edge, so there's a visible cue that more
   columns exist instead of the table just abruptly stopping. Only shown
   when #product-table actually has more to scroll to (see
   updateScrollOverflow in app.js) -- otherwise it would lie about there
   being hidden content when the visible columns already fit. */
#product-table.has-overflow .table-header-scroll::after,
#product-table.has-overflow .table-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 24px;
  background: linear-gradient(to right, transparent, var(--pico-background-color));
  pointer-events: none;
}

.table-header-scroll {
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--pico-background-color);
  box-shadow: 0 1px 0 var(--pico-muted-border-color);
}

/* Still scrollable (overflow-x:auto) via touch/trackpad/synced drag, but
   its own native scrollbar is hidden -- .table-bottom-scrollbar below is
   the one single visible/reachable scrollbar control now; showing both
   just doubled up visually whenever .table-scroll's actual bottom edge
   happened to be on screen too. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.table-scroll::-webkit-scrollbar {
  display: none;
}

/* .table-scroll's own scrollbar sits at the bottom of ALL rows -- far
   below the viewport whenever you're looking at the top of a long table.
   This is a second, thin strip pinned to the bottom of the *viewport*
   (sticky, not the table's own bottom edge) instead, so it's reachable
   the whole time any part of #product-table is on screen. It's a plain
   custom-drawn track/thumb (not a real native scrollbar) because OS/
   browser auto-hide overlay scrollbars can't reliably be forced always-
   visible via scrollbar-width/-color alone -- app.js sizes and positions
   #table-bottom-scrollbar-thumb from tableScroll's actual scroll state,
   and dragging it drives tableScroll.scrollLeft directly. */
.table-bottom-scrollbar {
  position: sticky;
  bottom: 0;
  height: 14px;
  background: var(--pico-background-color);
}
#table-bottom-scrollbar-thumb {
  position: absolute;
  top: 2px;
  height: 10px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  cursor: grab;
}
#table-bottom-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
#table-bottom-scrollbar-thumb:active {
  cursor: grabbing;
}

#product-table-header {
  table-layout: fixed;
  margin: 0;
}

.img-tooltip {
  display: none;
  position: fixed;
  z-index: 1000;
  width: 160px;
  height: 160px;
  object-fit: contain;
  background: var(--pico-card-sectioning-background-color);
  border: 1px solid var(--pico-primary);
  border-radius: var(--pico-border-radius);
  pointer-events: none;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.toolbar input[type="search"] {
  flex: 1;
  margin-bottom: 0;
}

.category-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  border: 3px solid transparent;
  transition: filter 0.1s, border-color 0.1s;
}
.category-badge:hover {
  filter: brightness(1.2);
  border-color: rgba(255, 255, 255, 0.9);
}
.category-badge-static {
  cursor: default;
}
.category-badge-static:hover {
  filter: none;
  border-color: transparent;
}

.price-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: #2f9e44;
  white-space: nowrap;
  vertical-align: middle;
  text-decoration: none;
}
.price-badge:hover {
  filter: brightness(1.15);
  text-decoration: none;
}

.category-filter-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--pico-card-sectioning-background-color);
  border: 1px solid var(--pico-primary);
  font-size: 0.85rem;
  white-space: nowrap;
}
.category-filter-chip.hidden {
  display: none;
}
.category-filter-chip button {
  width: auto;
  padding: 0 0.3rem;
  margin: 0;
  line-height: 1;
  font-size: 1rem;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

.columns-menu {
  position: relative;
}
.columns-menu button {
  width: auto;
  padding: 0.3rem 0.6rem;
  margin-bottom: 0;
  font-size: 1.1rem;
  line-height: 1;
}
.columns-panel {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.4rem;
  background: var(--pico-card-sectioning-background-color);
  border: 1px solid var(--pico-primary);
  border-radius: var(--pico-border-radius);
  padding: 0.5rem 0.75rem;
  z-index: 10;
  white-space: nowrap;
}
.columns-panel.hidden {
  display: none;
}
.columns-panel label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
#columns-reset {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
}

#product-table.hide-names .col-names,
#product-table.hide-battery .col-battery,
#product-table.hide-stage1AirflowLMin .col-stage1AirflowLMin,
#product-table.hide-stage2AirflowLMin .col-stage2AirflowLMin,
#product-table.hide-stageSwitchPsi .col-stageSwitchPsi,
#product-table.hide-weightKg .col-weightKg,
#product-table.hide-dimensionsCm .col-dimensionsCm,
#product-table.hide-volumeL .col-volumeL,
#product-table.hide-wholesaleEurAtMoq .col-wholesaleEurAtMoq,
#product-table.hide-priceUs .col-priceUs,
#product-table.hide-priceUk .col-priceUk,
#product-table.hide-priceDe .col-priceDe,
#product-table.hide-earliestTracked .col-earliestTracked,
#product-table.hide-chargeTimeMin .col-chargeTimeMin,
#product-table.hide-cordedCarUse .col-cordedCarUse,
#product-table.hide-speed12 .col-speed12,
#product-table.hide-speed15 .col-speed15,
#product-table.hide-speed18 .col-speed18,
#product-table.hide-speed20 .col-speed20,
#product-table.hide-capacity12 .col-capacity12,
#product-table.hide-capacity15 .col-capacity15,
#product-table.hide-capacity20 .col-capacity20 {
  display: none;
}

.unit {
  font-size: 0.78em;
  font-weight: normal;
  opacity: 0.6;
}

/* Fixed regardless of data/zoom/font-size, unlike every other column --
   skipped by syncHeaderColumnWidths in app.js (index 0) so it isn't run
   through that content-measuring logic at all. */
#product-table th:first-child,
#product-table td:first-child {
  width: 126px;
}

#product-table img.thumb {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-sectioning-background-color);
  cursor: pointer;
}

#product-table tr {
  cursor: pointer;
}

#product-table td, #product-table th {
  vertical-align: middle;
  padding: 0.4rem 0.5rem;
}

/* Headers without a unit line are only 1 line tall; with vertical-align:
   middle (above) they'd center within the row's full height (set by
   whichever sibling column has a 2-line unit label), sitting lower than
   the label text on those. Top-aligning keeps every header's first line
   on the same baseline regardless of whether a unit line follows it. */
#product-table-header th {
  vertical-align: top;
}

dialog article {
  max-width: none;
  width: 96vw;
}

.modal-body-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}

.modal-image {
  width: 100%;
  max-width: 260px;
  display: block;
  border-radius: var(--pico-border-radius);
  cursor: pointer;
}

.modal-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.gallery-thumb {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-sectioning-background-color);
  cursor: pointer;
  border: 2px solid transparent;
}

.gallery-thumb.active {
  border-color: var(--pico-primary);
}

.spec-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.15rem 1rem;
  margin-bottom: 1rem;
}
.spec-grid dt {
  font-weight: 600;
  opacity: 0.75;
  margin: 0;
  line-height: 1.3;
}
.spec-grid dd {
  margin: 0;
  line-height: 1.3;
}

.notes-box {
  background: var(--pico-card-sectioning-background-color);
  border-left: 3px solid var(--pico-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--pico-border-radius);
  font-size: 0.9rem;
}
.notes-box p {
  margin: 0 0 0.6rem;
}
.notes-box p:last-child {
  margin-bottom: 0;
}
.notes-box p.note-warning {
  background: color-mix(in srgb, orange 18%, transparent);
  border: 1px solid orange;
  border-radius: var(--pico-border-radius);
  padding: 0.5rem 0.65rem;
  font-weight: 600;
}

.disclaimer-badge {
  display: inline-block;
  background: color-mix(in srgb, var(--pico-muted-border-color) 40%, transparent);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

mark {
  background: var(--pico-mark-background-color, #ffe58f);
}

.estimated {
  opacity: 0.65;
  font-style: italic;
  cursor: help;
}

/* Shrink all fonts 1px smaller than Pico's responsive default, scaled at
   every breakpoint rather than a flat override. */
html {
  font-size: calc(var(--pico-font-size) - 1px);
}

@media (max-width: 700px) {
  .modal-body-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .modal-image {
    max-width: 200px;
    margin-inline: auto;
  }
}
