/* Shared and desktop vehicle-list styling (clean v2 path).
   Phone layouts live only in hongyi-vehicle-reference-mobile-v2.css. */
:root {
  --hy-vehicle-ink: #111820;
  --hy-vehicle-line: #d9dee5;
  --hy-vehicle-panel: #fff;
  --hy-vehicle-dark: #181c22;
}

/* Keep inventory and sold vehicle names equally clear on every layout. */
html body #hongyi-mobile-shell .page[data-panel="inventory"] .vehicle-card:not(.shared-vehicle-card) .vehicle-card-title-stack,
html body #hongyi-mobile-shell .page[data-panel="inventory"] .vehicle-card:not(.shared-vehicle-card) .vehicle-card-title-stack h2,
html body #hongyi-mobile-shell .page[data-panel="sold"] .sold-card .sold-card-title-stack,
html body #hongyi-mobile-shell .page[data-panel="sold"] .sold-card .sold-card-title-stack h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.vehicle-card-title-stack,
.sold-card-title-stack {
  min-width: 0;
}

.vehicle-card-brand-row,
.sold-card-brand-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.vehicle-card-brand-row > strong,
.sold-card-brand-row > strong {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-card-brand-row > .vehicle-location-pill,
.sold-card-brand-row > .vehicle-location-pill {
  flex: 0 0 auto;
  min-height: 30px;
  margin: 0;
  padding: 5px 9px;
  font-size: 11px;
}

/* Price edits remain visible for seven days across company and shared inventory. */
.vehicle-new-price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #c52837;
  color: #fff;
  box-shadow: 0 3px 10px rgba(197, 40, 55, .22);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .04em;
  vertical-align: middle;
  white-space: nowrap;
}

html body .shared-source-info h2 .vehicle-new-price-badge,
html body .shared-vehicle-table-model .vehicle-new-price-badge {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  overflow: visible !important;
  color: #fff !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

#hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]):not(.management-detail-open) {
  color: var(--hy-vehicle-ink);
}

#hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]):not(.management-detail-open)
  :is(.inventory-mobile-search-card, .sold-search-card, .sold-filter-grid, .filter-card) {
  border-color: var(--hy-vehicle-line) !important;
  background: var(--hy-vehicle-panel) !important;
  box-shadow: none !important;
}

#hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]):not(.management-detail-open)
  :is(input, select, .title-filter-select) {
  border-color: #cfd6df !important;
  background-color: #fff !important;
  color: #273444 !important;
}

/* Reference-only fields are enabled by the authoritative phone stylesheet. */
.vehicle-reference-details,
.sold-reference-title,
.sold-reference-details {
  display: none;
}

/* Keep the body-panel note visually distinct on every vehicle card. */
.vehicle-reference-body-panel,
.vehicle-reference-body-panel > :is(i, b) {
  color: #c62828 !important;
}

/* Desktop retains every view and action with the reference visual language. */
@media (min-width: 900px) {
  html body.desktop-page #hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]).active:not(.management-detail-open) {
    gap: 14px !important;
    padding: 18px 22px 28px !important;
    background: #f5f6f8 !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-title-strip,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip {
    display: grid !important;
    grid-template-columns: minmax(210px, auto) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 5px 28px !important;
    padding: 18px 20px !important;
    border: 1px solid var(--hy-vehicle-line) !important;
    border-radius: 14px !important;
    background: #fff !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]).active:not(.management-detail-open)
    :is(.inventory-title-strip, .sold-title-strip) > p {
    grid-column: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #8b641c !important;
    font: 800 10px/1.2 system-ui, sans-serif !important;
    letter-spacing: .16em !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]).active:not(.management-detail-open)
    :is(.inventory-title-strip, .sold-title-strip) > h1 {
    grid-column: 1 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--hy-vehicle-ink) !important;
    font: 800 25px/1.25 system-ui, sans-serif !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]).active:not(.management-detail-open)
    :is(.inventory-title-strip, .sold-title-strip) > h1::before,
  html body.desktop-page #hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]).active:not(.management-detail-open)
    :is(.inventory-title-strip, .sold-title-strip) > h1::after {
    display: none !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-title-search,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip .sold-search-card {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  /* Keep the sold title and search in one bounded desktop row. */
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip {
    grid-template-columns: minmax(220px, auto) minmax(360px, 1fr) !important;
    grid-template-rows: auto !important;
    min-height: 82px !important;
    height: auto !important;
    overflow: hidden !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip::before,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip::after {
    display: none !important;
    content: none !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-banner-copy {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: grid !important;
    align-content: center !important;
    gap: 4px !important;
    min-width: 0 !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-banner-copy > h1 {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--hy-vehicle-ink) !important;
    font: 800 22px/1.2 system-ui, sans-serif !important;
    white-space: nowrap !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-banner-copy > h1 > em {
    margin-left: 6px !important;
    color: #8b641c !important;
    font: 800 11px/1 system-ui, sans-serif !important;
    font-style: normal !important;
    letter-spacing: .1em !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-banner-copy > small {
    color: #697789 !important;
    font: 600 12px/1.3 system-ui, sans-serif !important;
    white-space: nowrap !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip .sold-search-card {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip .sold-title-search {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 1px solid #d8dee6 !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: #273444 !important;
    font-size: 13px !important;
    box-shadow: none !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-overview-card,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #252a31 !important;
    border-radius: 12px !important;
    background: var(--hy-vehicle-dark) !important;
    box-shadow: 0 10px 24px rgba(16, 23, 31, .09) !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-overview-card article,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-summary-grid .metric-card {
    display: flex !important;
    min-height: 92px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 12px 10px !important;
    border: 0 !important;
    border-right: 1px solid #3c4148 !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-align: center !important;
    box-shadow: none !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-overview-card article:last-child,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-summary-grid .metric-card:last-child {
    border-right: 0 !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open)
    .inventory-overview-card :is(.inventory-overview-icon, article::before, article::after),
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open)
    .sold-summary-grid .metric-card::before,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open)
    .sold-summary-grid .metric-card::after {
    display: none !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-overview-card span,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-summary-grid .metric-card span {
    color: #d7dce2 !important;
    font: 700 12px/1.3 system-ui, sans-serif !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-overview-card strong,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-summary-grid .metric-card strong {
    color: #fff !important;
    font: 800 25px/1.15 system-ui, sans-serif !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-overview-card small,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-summary-grid .metric-card small {
    display: none !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]).active:not(.management-detail-open)
    :is(.filter-card, .sold-control-row, .sold-view-toolbar) {
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 1px solid var(--hy-vehicle-line) !important;
    border-radius: 12px !important;
    background: #fff !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]).active:not(.management-detail-open)
    :is(.vehicle-list, .sold-list) {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--hy-vehicle-line) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page:is([data-panel="inventory"], [data-panel="sold"]).active:not(.management-detail-open)
    :is(.desktop-table-head, .vehicle-card, .sold-card) {
    border-color: #e4e8ed !important;
  }
}

/* Every publication channel uses the same binary status language. */
@media (min-width: 900px) {
  html body.desktop-page #hongyi-mobile-shell .vehicle-channel-light.is-on > i {
    border-color: #16a34a !important;
    background: #16a34a !important;
    box-shadow: none !important;
  }

  html body.desktop-page #hongyi-mobile-shell .vehicle-channel-light.is-off > i {
    border-color: #dc3b35 !important;
    background: #dc3b35 !important;
    box-shadow: none !important;
  }
}

/* Final desktop title-bar ownership. Runtime moves the sold filters and search
   into .hy-page-actions; explicitly place every resulting child after all
   legacy desktop rules so the columns cannot reverse after hydration. */
@media (min-width: 900px) {
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip {
    grid-template-columns: minmax(190px, 280px) minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    column-gap: 28px !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip > .hy-page-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    margin: 0 !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip > .hy-page-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(520px, 1.45fr) minmax(300px, 1fr) !important;
    align-items: center !important;
    justify-self: stretch !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    gap: 10px !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-title-search > select,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-filters > select {
    font: 500 13px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-title-search > select > option,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-filters > select > option {
    font: 500 13px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif !important;
  }

  html body.desktop-page #hongyi-mobile-shell .page[data-panel="inventory"].active:not(.management-detail-open) .inventory-title-search > input,
  html body.desktop-page #hongyi-mobile-shell .page[data-panel="sold"].active:not(.management-detail-open) .sold-title-strip .sold-title-search {
    font: 500 13px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }
}

