.product-page {
  display: grid;
  gap: 20px;
}
.product-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.product-overview .metric strong {
  font-size: 32px;
}
.product-overview .metric small {
  margin-top: 8px;
}
.product-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  scroll-margin-top: calc(var(--app-header-height, 86px) + 12px);
}
.product-list-heading h2 {
  font-size: 21px;
  letter-spacing: -0.4px;
  margin: 5px 0 0;
}
.product-list-heading .eyebrow {
  color: #7b8da5;
  font-size: 10px;
  letter-spacing: 1.8px;
}
.product-page .toolbar {
  margin: 0;
}
.product-list {
  padding: 0;
  overflow: hidden;
}
.product-list table {
  min-width: 1000px;
}
.product-list td {
  vertical-align: top;
}
.product-list td:first-child {
  min-width: 190px;
}
.product-list td strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.product-list td:last-child {
  white-space: nowrap;
}
.product-list td .row-link {
  text-align: left;
  white-space: normal;
}
.product-price-unit {
  color: #74839a;
  font-size: 11px;
  margin-left: 5px;
  white-space: nowrap;
}
.product-change.up {
  color: #b34b31;
}
.product-change.down {
  color: #237461;
}
.product-change.flat,
.product-muted {
  color: #7a889b;
}
.product-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #74839a;
  font-size: 12px;
  gap: 12px;
}
.product-pagination > div {
  display: flex;
  align-items: center;
  gap: 14px;
}
.product-pagination .quiet {
  min-height: 34px;
  padding: 7px 14px;
}
.product-detail-pagination {
  padding: 12px 16px;
  border-top: 1px solid #e9eef5;
}
.product-page .footnote {
  margin-top: 0;
}
.product-identity {
  padding-bottom: 22px;
  border-bottom: 1px solid #e8edf4;
}
.product-identity p {
  font-size: 12px;
  color: #74839a;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.product-identity > strong {
  font-size: 14px;
  font-weight: 500;
  color: #405776;
}
.product-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 0;
}
.product-detail-metrics small {
  display: block;
  color: #7a889b;
  margin-bottom: 9px;
  font-size: 12px;
}
.product-detail-metrics strong {
  color: #243e61;
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.product-price-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.product-price-panels.single {
  grid-template-columns: minmax(0, 1fr);
}
.product-price-panel {
  padding: 16px;
  min-width: 0;
  box-shadow: none;
  background: linear-gradient(145deg, #f6faff, #fff);
  border: 1px solid #e3edf8;
}
.product-price-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.product-current-price > strong {
  color: #274d82;
  font-size: 26px;
  letter-spacing: -0.5px;
  font-weight: 600;
}
.product-current-price > small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #74839a;
}
.product-price-panel p,
.product-price-panel > small {
  margin: 2px 0;
  color: #74839a;
  font-size: 11px;
  line-height: 1.4;
}
.product-price-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 4px;
  overflow: visible;
}
.product-price-chart text {
  fill: #7b8da5;
  font-size: 11px;
}
.product-price-chart .product-gridline {
  stroke: #e6edf6;
  stroke-dasharray: 3 4;
  fill: none;
}
.product-price-line {
  stroke: #5b8bc5;
  stroke-width: 2;
  fill: none;
  stroke-linejoin: round;
}
.product-price-chart circle {
  fill: #4e7fb9;
  stroke: #fff;
  stroke-width: 1;
}
.product-price-range {
  stroke: #87a9d0;
  stroke-width: 4;
}
.product-chart-empty {
  display: grid;
  place-items: center;
  min-height: 108px;
  color: #8593a7;
  font-size: 13px;
}
.product-data-note {
  border-left: 2px solid #a6bddb;
  padding: 10px 14px;
  color: #637b99;
  font-size: 12px;
  line-height: 1.8;
  background: #f4f8fd;
}
.product-detail .footnote {
  line-height: 1.8;
}
@media (max-width: 1000px) {
  .product-list .table-scroll {
    overflow: visible;
  }
  .product-list table,
  .product-list tbody {
    display: block;
    min-width: 0;
  }
  .product-list thead {
    display: none;
  }
  .product-list tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
    padding: 22px;
    border-bottom: 1px solid #e9eef5;
  }
  .product-list tr:last-child {
    border-bottom: none;
  }
  .product-list td {
    display: block;
    padding: 0;
    min-width: 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .product-list td:first-child {
    min-width: 0;
    grid-column: 1 / -1;
  }
  .product-list td:nth-child(2) {
    grid-column: 1 / -1;
  }
  .product-list td:last-child {
    grid-column: 1 / -1;
    text-align: right;
  }
  .product-list td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #8995a7;
    margin-bottom: 7px;
  }
  .product-list td:first-child::before {
    display: none;
  }
  .product-list td:nth-child(2) {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
  }
  .product-list td:nth-child(2)::before {
    display: none;
  }
  .product-list td:nth-child(2) small {
    margin-top: 0;
  }
  .product-price-panels {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .product-page {
    gap: 18px;
  }
  .product-overview {
    gap: 8px;
  }
  .product-overview .metric {
    padding: 16px 10px;
  }
  .product-overview .metric strong {
    font-size: 25px;
  }
  .product-overview .metric strong em {
    font-size: 11px;
    margin-left: 3px;
  }
  .product-overview .metric-label {
    font-size: 11px;
  }
  .product-overview .metric small {
    display: none;
  }
  .product-list-heading {
    flex-wrap: wrap;
    gap: 16px;
  }
  .product-list-heading h2 {
    font-size: 20px;
  }
  .product-list-heading .chart-select {
    width: 100%;
  }
  .product-list-heading .chart-select button {
    flex: 1;
  }
  .product-page .toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .product-page .toolbar .search-field {
    width: 100%;
    flex: auto;
  }
  .product-list tr {
    padding: 20px 17px;
  }
  .product-pagination {
    font-size: 11px;
    gap: 8px;
  }
  .product-pagination > div {
    gap: 8px;
  }
  .product-pagination .quiet {
    padding: 7px 10px;
  }
  .product-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 12px;
  }
  .product-price-panel {
    padding: 14px;
  }
}

.product-price-panel > .product-average-coverage {
  display: block;
  margin: 4px 0 0;
  color: #74839a;
  font-size: 11px;
}

/* Selected single-product workspace; shared navigation remains untouched. */
.product-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 30%);
  gap: 18px;
  align-items: start;
}
.product-table-pane {
  min-width: 0;
  display: grid;
  gap: 16px;
}
.product-workspace .product-list-heading {
  gap: 14px;
  min-height: 46px;
}
.product-workspace .toolbar {
  flex: 1;
  min-width: 0;
}
.product-workspace .toolbar .search-field {
  min-width: 180px;
  max-width: 480px;
  flex: 1;
}
.product-workspace .chart-select {
  flex-shrink: 0;
}
.product-workspace .product-list {
  border: 1px solid #e1eaf2;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 30px #36567d07;
}
.product-workspace .product-list .table-scroll {
  max-height: calc(100dvh - 230px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #b7cadd transparent;
}
.product-workspace .product-list table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}
.product-workspace .product-list th {
  padding: 19px 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f6faf5;
  font-size: 12px;
  font-weight: 500;
  white-space: normal;
}
.product-workspace .product-list th:first-child {
  width: 27%;
}
.product-workspace .product-list th:nth-child(2) {
  width: 17%;
}
.product-workspace .product-list th:last-child {
  width: 5%;
}
.product-workspace .product-list td {
  padding: 24px 12px;
  vertical-align: middle;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.product-workspace .product-list td:first-child {
  min-width: 0;
}
.product-workspace .product-list td strong {
  color: #284563;
  font-size: 15px;
}
.product-workspace .product-list td small {
  display: block;
  color: #8a99a8;
  font-size: 10px;
  line-height: 1.6;
  margin-top: 5px;
}
.product-workspace .product-list .product-change {
  font-size: 10px;
}
.product-workspace .product-list .product-price-unit {
  display: block;
  font-size: 10px;
  margin: 3px 0 0;
}
.product-workspace .product-list tr {
  cursor: pointer;
  transition: background 0.15s;
}
.product-workspace .product-list tr[aria-selected='true'] {
  background:
    radial-gradient(ellipse 58% 155% at 12% 8%, #5fa5ee29, transparent 70%),
    radial-gradient(ellipse 46% 170% at 70% 110%, #4591dc1f, transparent 73%),
    radial-gradient(ellipse 32% 115% at 98% 12%, #b6d6fb2e, transparent 75%), #eaf4ff;
  box-shadow: inset 3px 0 #5c9bda;
}
.product-workspace .product-list tr:not([aria-selected='true']):hover {
  background: #f0f7fd;
}
.product-workspace .product-list tr:focus-visible {
  outline: 2px solid #5f9fd8;
  outline-offset: -2px;
}
.product-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.product-name-cell > div {
  min-width: 0;
}
.product-workspace .row-link {
  font-size: 14px;
  font-weight: 500;
  color: #284563;
  line-height: 1.55;
}
.product-workspace td:last-child button {
  font-size: 0;
  min-width: 24px;
  padding: 4px;
  background: none;
  box-shadow: none;
  border: 0;
  color: #7d9cba;
}
.product-workspace td:last-child button::after {
  content: '›';
  font-size: 24px;
}
.product-photo {
  width: 58px;
  height: 66px;
  flex: 0 0 58px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f0f5f9;
  overflow: hidden;
}
.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-photo small {
  display: none !important;
}
.product-photo.missing img {
  width: 30px;
  height: 30px;
  opacity: 0.42;
  transform: translateY(-6px);
}
.product-photo.missing small {
  display: block !important;
  position: absolute;
  bottom: 4px;
  margin: 0 !important;
  font-size: 9px !important;
  color: #91a2b2;
}
.product-photo.large {
  width: 82px;
  height: 90px;
  flex-basis: 82px;
}
.product-insight {
  position: sticky;
  top: calc(var(--app-header-height, 86px) + 16px);
  min-width: 0;
  padding: 0;
  background: linear-gradient(135deg, #ffffffec, #f8fcffdb);
  border: 1px solid #e0eaf3;
  box-shadow: 0 10px 34px #36567d09;
  overflow: hidden;
  border-radius: 20px;
}
.product-insight-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 24px;
}
.product-insight-header > div {
  min-width: 0;
}
.product-insight-header h2 {
  font-size: 20px;
  line-height: 1.5;
  margin: 5px 0 6px;
  overflow-wrap: anywhere;
  color: #2c4968;
  font-weight: 500;
}
.product-insight-header p,
.product-insight-header small {
  color: #8396a7;
  font-size: 11px;
  margin: 3px 0;
  overflow-wrap: anywhere;
}
.product-insight-header .eyebrow {
  font-size: 10px;
  color: #82a1bb;
  letter-spacing: 2px;
}
.product-insight-section {
  padding: 20px 24px;
  border-top: 1px solid #e8eff5;
}
.product-insight-section h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 14px;
  color: #39546e;
}
.product-insight-section h3 small {
  font-size: 10px;
  float: right;
  color: #8c9dab;
  font-weight: 400;
}
.product-insight-section > .product-muted {
  font-size: 10px;
}
.product-quantity-chart {
  height: 122px;
  width: 100%;
}
.product-insight-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.product-insight-prices > div {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.product-insight-prices > div + div {
  border-left: 1px solid #e2ebf4;
  padding-left: 20px;
}
.product-insight-prices span {
  font-size: 12px;
  color: #7e92a5;
}
.product-insight-prices strong {
  font-size: 30px;
  font-weight: 500;
  color: #377cbe;
  font-variant-numeric: tabular-nums;
}
.product-insight-prices small {
  font-size: 10px;
  color: #93a2b1;
}
.product-trend-section {
  min-height: 178px;
}
.product-insight .product-chart-empty {
  min-height: 105px;
  background: linear-gradient(#f4f9fd88, #fff0);
  border-radius: 8px;
}
.product-insight footer {
  display: block;
  padding: 6px 24px 20px;
  background: transparent;
  border: 0;
}
.product-insight footer button {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(110deg, #4b96dc, #3684cf);
  border: 1px solid #438bd0;
  border-radius: 8px;
  color: white;
  box-shadow: 0 4px 12px #3885cf20;
  font-size: 14px;
  line-height: 21px;
}
.product-insight-empty {
  padding: 80px 24px;
  text-align: center;
  color: #8a9caf;
}
@media (max-width: 1200px) and (min-width: 1001px) {
  .product-workspace {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
  }
  .product-workspace .product-list td,
  .product-workspace .product-list th {
    padding-left: 8px;
    padding-right: 8px;
  }
  .product-name-cell {
    gap: 8px;
  }
  .product-photo {
    width: 42px;
    flex-basis: 42px;
    height: 54px;
  }
  .product-workspace .product-list td {
    font-size: 12px;
  }
  .product-workspace .row-link {
    font-size: 12px;
  }
  .product-workspace .product-list td strong {
    font-size: 13px;
  }
  .product-workspace .product-list-heading {
    flex-wrap: wrap;
  }
}
@media (max-width: 1000px) {
  .product-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .product-insight {
    position: static;
    grid-row: 2;
  }
  .product-workspace .product-list .table-scroll {
    max-height: 560px;
  }
  .product-workspace .product-list table {
    display: block;
    table-layout: auto;
  }
  .product-workspace .product-list td {
    padding: 0;
  }
  .product-workspace .product-list td:last-child button {
    font-size: 12px;
  }
  .product-workspace .product-list td:last-child button::after {
    display: none;
  }
  .product-insight-header {
    padding: 22px;
  }
  .product-workspace .product-list-heading {
    flex-wrap: wrap;
  }
  .product-insight-section {
    padding: 20px 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .product-workspace .product-list tr {
    transition: none;
  }
}
.product-workspace .product-list th:last-child {
  width: 8%;
}
.product-workspace .product-list .product-change {
  display: none;
}
.product-row-change {
  font-size: 11px;
  color: #8497a9;
}
.product-workspace .product-list td:last-child {
  white-space: normal;
}
.product-workspace .product-list td:nth-child(2),
.product-workspace .product-list td:nth-child(2) > span {
  white-space: normal;
  overflow-wrap: anywhere;
}
.product-insight .product-price-chart text {
  font-size: 14px;
  font-weight: 400;
}
.product-workspace .product-list {
  border-radius: 20px;
}
.product-trend-chart {
  width: 100%;
  height: 146px;
}

/* All three views use the same shell, toolbar and bounded master/detail grid.
   Data, table columns and detail content remain owned by their feature. */
.product-workspace {
  height: calc(100dvh - var(--app-header-height, 86px) - var(--content-top-gap, 20px) - 48px);
  max-height: 1100px;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.product-workspace-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 30%);
  gap: 18px;
  min-height: 0;
  align-items: stretch;
}
.product-workspace .product-table-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  min-height: 0;
}
.product-workspace .product-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.product-workspace .product-list .table-scroll {
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow: auto;
}
.product-workspace .product-pagination,
.product-workspace .footnote {
  flex: 0 0 auto;
  margin: 0;
}
.product-workspace .product-list > .product-pagination {
  padding: 10px 16px;
  border-top: 1px solid #e9eef5;
}
.product-workspace .product-list > .footnote {
  padding: 0 16px 12px;
}
.inventory-embedded .inventory-table-frame {
  border-radius: 20px;
}
.product-workspace .product-insight {
  position: static;
  grid-row: auto;
  height: 100%;
  min-height: 0;
  overflow: auto;
}
.product-workspace-toolbar {
  min-width: 0;
}
.product-workspace .product-workspace-toolbar > .toolbar,
.product-workspace .product-workspace-toolbar > .inventory-toolbar {
  flex: 1;
  min-width: 0;
  position: relative;
  margin: 0;
  gap: 12px;
}
.product-workspace .product-workspace-toolbar .search-field {
  height: 46px;
  min-width: 0;
  max-width: 480px;
  flex: 1;
}
.product-workspace .product-workspace-toolbar .search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid #d8e3ef;
  border-radius: 11px;
  background: #ffffffb8;
}
.product-workspace .product-workspace-toolbar .search-field input {
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  font-size: 14px;
}
.product-workspace .product-workspace-toolbar .search-field:focus-within {
  outline: 2px solid #4b8cde;
  outline-offset: 2px;
}
.product-workspace .product-workspace-toolbar .search-field > svg {
  position: static;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}
.product-workspace .product-view-tabs {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  height: 44px;
  padding: 3px;
  gap: 4px;
}
.product-workspace .product-view-tabs button {
  flex: 1;
  font-weight: 500;
  font-family: inherit;
  font-size: 12px;
  line-height: 20px;
  padding: 8px 12px;
  height: 36px;
  white-space: nowrap;
}
.inventory-workspace.inventory-embedded {
  display: block;
  height: auto;
  min-height: 0;
  max-height: none;
}
.inventory-embedded .inventory-body {
  flex: none;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 30%);
}
.inventory-embedded .inventory-evidence {
  height: 100%;
  border: 1px solid #e0eaf3;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffffee, #f8fcffdc);
  box-shadow: 0 10px 34px #36567d09;
}
.inventory-embedded .inventory-toolbar > select {
  flex: 0 1 152px;
  width: 152px;
}
.inventory-embedded .inventory-method summary {
  padding: 8px 4px;
}
.inventory-embedded .inventory-method > div {
  left: 0;
  width: min(480px, 100%);
  top: calc(100% + 8px);
}
.inventory-evidence-empty p {
  color: #71849b;
}
.product-workspace .product-insight,
.product-workspace .product-list .table-scroll {
  scrollbar-width: none;
}
.product-workspace .product-insight::-webkit-scrollbar,
.product-workspace .product-list .table-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}
@media (min-width: 1001px) and (max-width: 1200px) {
  .product-workspace-body,
  .inventory-embedded .inventory-body {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
  }
}
@media (max-width: 1000px) {
  .product-workspace {
    height: auto;
    max-height: none;
  }
  .product-workspace-body,
  .inventory-embedded .inventory-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .product-workspace .product-table-pane,
  .product-workspace .product-insight,
  .inventory-embedded .inventory-evidence {
    height: calc(min(780px, 90dvh) - 24px);
    min-height: 0;
  }
  .inventory-embedded .inventory-table-scroll {
    max-height: none;
  }
  .product-workspace .product-workspace-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .product-workspace .product-workspace-toolbar > .toolbar,
  .product-workspace .product-workspace-toolbar > .inventory-toolbar {
    width: 100%;
    flex-wrap: nowrap;
  }
  .product-workspace .product-view-tabs {
    width: 100%;
  }
  .product-workspace .product-workspace-toolbar .search-field {
    max-width: none;
  }
  .inventory-embedded .inventory-toolbar > select {
    flex: 0 1 112px;
    width: 112px;
    min-width: 112px;
    white-space: nowrap;
  }
  .inventory-embedded .inventory-toolbar > select > button {
    white-space: nowrap;
  }
  .inventory-embedded .inventory-table-frame {
    flex: 1;
    min-height: 0;
  }
  .inventory-embedded .inventory-table-scroll,
  .inventory-embedded .inventory-evidence-scroll {
    flex: 1;
    min-height: 0;
    height: auto;
  }
  .inventory-embedded .inventory-evidence > header {
    position: static;
  }
}

/* One comparison unit; optional calculation detail stays behind a native control. */
.product-price-comparison .product-insight-prices strong {
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.product-price-comparison .product-compare-unit {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
  font-weight: 400;
  color: #6f8599;
  white-space: nowrap;
}
.product-price-info {
  margin-top: 12px;
}
.product-price-info summary {
  display: flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 32px;
  padding: 5px 2px;
  color: #66829b;
  font-size: 11px;
  cursor: pointer;
  list-style: none;
}
.product-price-info summary::-webkit-details-marker {
  display: none;
}
.product-price-info summary:focus-visible {
  outline: 2px solid #7ca7d0;
  outline-offset: 3px;
  border-radius: 4px;
}
.product-price-info[open] summary {
  color: #357db8;
}
.product-price-info > div {
  padding: 10px 12px;
  background: #edf5fb;
  border-radius: 8px;
  color: #536e86;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.product-price-info p {
  margin: 0;
}
.product-price-info p + p {
  margin-top: 8px;
}
.product-price-not-comparable {
  font-size: 13px;
  color: #70869a;
  margin: 16px 0;
}
