/* Portable Solution Comparison Tool — desktop-focused layout */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --header-tint: #edf2f7;
  --text: #1a1a18;
  --text-muted: #5c5c56;
  --border: #e4e4df;
  --accent: #6b7280;
  --accent-soft: #e8e9ec;
  --pill-bg: #e8e9ec;
  --filter-bar-height: 0px;
  --col-head-sticky-top: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-width: 960px;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

.page-header {
  padding: 1rem 2rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--header-tint);
}

.page-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.page-title {
  grid-column: 2;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.header-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-trigger,
.build-list-trigger {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
}

.help-trigger:hover,
.build-list-trigger:hover {
  background: #dde0e5;
}

.help-trigger:focus-visible,
.build-list-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.build-list-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.build-list-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.build-list-badge.is-pulsing {
  animation: build-list-badge-pulse 0.65s ease-out;
}

@keyframes build-list-badge-pulse {
  0% {
    transform: scale(1);
    background-color: var(--text);
    box-shadow: 0 0 0 0 rgba(107, 114, 128, 0);
  }
  38% {
    transform: scale(1.55);
    background-color: var(--accent);
    box-shadow: 0 0 0 0.3rem rgba(107, 114, 128, 0.3);
  }
  100% {
    transform: scale(1);
    background-color: var(--text);
    box-shadow: 0 0 0 0 rgba(107, 114, 128, 0);
  }
}

.build-list-trigger[aria-disabled="true"] {
  cursor: default;
  opacity: 0.85;
}

.build-list-trigger[aria-disabled="true"]:hover {
  background: var(--accent-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.main {
  padding: 1.25rem 0.75rem 3rem;
  max-width: none;
  margin: 0 auto;
}

.view-panel[hidden] {
  display: none !important;
}

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 11;
  margin: 0 0.5rem 0.5rem;
  padding: 0.75rem 0.65rem;
  background: var(--header-tint);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-end;
  justify-content: center;
}

.filter-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 0 1 auto;
}

.filter-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}

.filter-input {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.875rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  width: 10rem;
}

.filter-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.table-panel {
  margin-left: auto;
  margin-right: auto;
  padding: 1.25rem 0.5rem 1.5rem;
}

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.corner-cell {
  width: 18%;
  min-width: 168px;
  vertical-align: top;
  padding: 0.75rem 0.65rem 1.05rem 0;
  position: sticky;
  top: var(--col-head-sticky-top);
  z-index: 10;
  background: var(--header-tint);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.col-head {
  width: 16.4%;
  vertical-align: top;
  text-align: center;
  font-weight: 400;
  padding: 0.75rem 0.65rem 1.05rem 0.65rem;
  position: sticky;
  top: var(--col-head-sticky-top);
  z-index: 10;
  background: var(--header-tint);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.col-head-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.select-floater-host {
  width: 100%;
  text-align: center;
}

.logo-trigger-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 10px;
  width: 100%;
}

.vendor-logo {
  display: block;
  width: 8rem;
  height: 2.5rem;
  object-fit: contain;
  object-position: center;
}

.vendor-logo[hidden] {
  display: none;
}

.select-anchor {
  display: inline-block;
  text-align: left;
  max-width: 100%;
}

.product-select {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  padding: 0.45rem 2rem 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--bg);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 0.85rem, calc(100% - 9px) 0.85rem;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.product-select option {
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 400;
  font-style: normal;
  color: var(--text);
  font-size: 0.875rem;
}

.product-select option:disabled {
  color: var(--text-muted);
}

.col-head.is-filter-nonconforming,
td.value-cell.is-filter-nonconforming {
  background-color: var(--accent-soft);
  color: var(--text-muted);
  opacity: 0.65;
}

.product-select:hover {
  border-color: #c9cac4;
}

.product-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.product-select.has-selection {
  font-weight: 700;
}

.info-trigger,
.build-list-quick-add {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.info-trigger[hidden],
.build-list-quick-add[hidden] {
  display: none;
}

.info-trigger:hover,
.build-list-quick-add:hover {
  background: #dde0e5;
}

.info-trigger:focus-visible,
.build-list-quick-add:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.build-list-quick-add.is-qty-flash {
  font-size: 0.7rem;
  font-weight: 700;
}

.build-list-quick-add.is-pulsing {
  animation: build-list-quick-add-pulse 0.6s ease-out;
}

@keyframes build-list-quick-add-pulse {
  0% {
    transform: scale(1);
    background-color: var(--accent-soft);
    color: var(--accent);
    box-shadow: 0 0 0 0 rgba(107, 114, 128, 0);
  }
  38% {
    transform: scale(1.4);
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(107, 114, 128, 0.3);
  }
  100% {
    transform: scale(1);
    background-color: var(--accent-soft);
    color: var(--accent);
    box-shadow: 0 0 0 0 rgba(107, 114, 128, 0);
  }
}

.spec-label-cell {
  padding: 0.71875rem 0.65rem 0.71875rem 0;
  text-align: left;
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #3a3a36;
  vertical-align: top;
  width: 18%;
}

.spec-label-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.spec-label-text {
  flex: 1;
  min-width: 0;
}

.pin-trigger {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pin-trigger svg {
  display: block;
}

.pin-trigger svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.pin-trigger.is-pinned {
  background: var(--accent);
  color: var(--surface);
}

.pin-trigger.is-pinned svg path {
  fill: currentColor;
  stroke: currentColor;
}

.pin-trigger:hover {
  background: #dde0e5;
}

.pin-trigger.is-pinned:hover {
  background: #5a6270;
}

.pin-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.value-cell {
  padding: 0.71875rem 0.65rem;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.6;
  vertical-align: top;
  border-left: 1px solid var(--border);
  color: var(--text);
  word-wrap: break-word;
}

.value-text {
  display: block;
}

.cell-na {
  color: var(--text-muted);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}

.tbd-pill {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "DM Mono", ui-monospace, monospace;
}

.popover {
  position: fixed;
  z-index: 1000;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(26, 26, 24, 0.12);
}

.popover-body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.5;
}

.untested-banner-row[hidden] {
  display: none;
}

.untested-banner-cell {
  position: sticky;
  top: var(--filter-bar-height);
  z-index: 11;
  padding: 0.85rem 1rem;
  text-align: center;
  font-weight: 400;
  background: var(--header-tint);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid var(--border);
}

.untested-banner {
  margin: 0 auto;
  max-width: 52rem;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  text-align: center;
}

/* —— Help overlay (isolated; do not share with .popover / table controls) —— */

#vpc-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

#vpc-help-overlay[hidden] {
  display: none;
}

.help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 24, 0.45);
}

.help-panel {
  position: relative;
  z-index: 1;
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  overflow: auto;
  padding: 1.25rem 1.35rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(26, 26, 24, 0.18);
}

.help-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.help-panel-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.help-close {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.help-close:hover {
  background: #dde0e5;
}

.help-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.help-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.help-line {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.help-graphic {
  display: flex;
  justify-content: flex-start;
}

.help-footnote {
  margin: 0.25rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.help-illus-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0 0.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  line-height: 1;
}

/* Static illustrations — help-only classes */

.help-illus-dropdown {
  width: 14rem;
}

.help-illus-dropdown-face {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.help-illus-dropdown-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.help-illus-chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
}

.help-illus-dropdown-menu {
  margin-top: 0.35rem;
  padding: 0.45rem 0;
  min-height: 4.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.help-illus-option {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.help-illus-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
}

.help-illus-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.help-illus-field-box {
  display: block;
  box-sizing: border-box;
  width: 6.5rem;
  min-height: 1.85rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.help-illus-pin-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.help-illus-pin {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.help-illus-pin svg {
  display: block;
}

.help-illus-row-bar {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #3a3a36;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  background: var(--bg);
}

.help-illus-build-sequence {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.help-illus-quick-add-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.build-list-quick-add.help-illus-quick-add {
  pointer-events: none;
  cursor: default;
  background: var(--accent-soft);
}

.help-illus-build-list {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 500;
}

.help-illus-build-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}

/* —— Build List view —— */

.build-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0.5rem 1rem;
}

.build-list-back,
.build-list-print,
.build-list-add-btn {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
}

.build-list-back:hover,
.build-list-print:hover,
.build-list-add-btn:hover {
  background: #dde0e5;
}

.build-list-back:focus-visible,
.build-list-print:focus-visible,
.build-list-add-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.build-list-add-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 0 0.5rem 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--header-tint);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.build-list-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.build-list-field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.build-list-product-select {
  min-width: 16rem;
  max-width: 28rem;
}

.build-list-field-qty {
  width: 5.5rem;
}

.build-list-qty-input,
.build-list-line-qty {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.875rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

.build-list-line-qty {
  width: 4.5rem;
}

.build-list-empty {
  margin: 2rem 0.5rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.build-list-table-wrap {
  margin: 0 0.5rem 1.25rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.build-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.build-list-table th,
.build-list-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.build-list-table th {
  font-weight: 600;
  background: var(--header-tint);
  color: var(--text);
}

.build-list-table tbody tr:last-child td {
  border-bottom: none;
}

.build-list-product-cell {
  font-weight: 500;
}

.build-list-product-untested {
  color: var(--text-muted);
  font-weight: 400;
}

.build-list-remove {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.8125rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.build-list-remove:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.build-list-totals {
  margin: 0 0.5rem 2rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  max-width: 28rem;
}

.build-list-total-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}

.build-list-total-row + .build-list-total-row {
  border-top: 1px solid var(--border);
}

.build-list-total-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.build-list-total-value {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  font-weight: 500;
}

.build-list-print-region {
  display: none;
}

@media print {
  body {
    min-width: 0;
    background: #fff;
    color: #000;
  }

  .page-header,
  .popover,
  #vpc-help-overlay,
  [data-view="compare"],
  .build-list-toolbar,
  .build-list-add-strip,
  .build-list-empty,
  .build-list-table-wrap,
  .build-list-totals {
    display: none !important;
  }

  body[data-active-view="build-list"] .build-list-print-region {
    display: block !important;
  }

  .build-list-print-title {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
  }

  .build-list-print-stamp {
    margin: 0 0 1rem;
    color: #444;
    font-size: 0.9rem;
  }

  .build-list-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .build-list-print-table th,
  .build-list-print-table td {
    border: 1px solid #ccc;
    padding: 0.4rem 0.5rem;
    text-align: left;
  }

  .build-list-print-totals {
    font-size: 0.95rem;
    font-weight: bold;
    border-top: 1px solid #333;
    padding-top: 0.75rem;
  }

  .build-list-print-totals p {
    margin: 0.25rem 0;
    font-weight: bold;
  }
}

