:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-soft: #f3f5f6;
  --text: #1f252b;
  --muted: #6f7780;
  --line: #e6e8eb;
  --brand: #ff6a00;
  --brand-dark: #df5100;
  --gold: #9a6728;
  --gold-soft: #fff4e8;
  --blue: #2f6f79;
  --blue-soft: #eaf5f6;
  --red: #ad5146;
  --shadow: 0 12px 28px rgba(31, 37, 43, 0.08);
  --radius: 8px;
  --product-card-height: 430px;
  --product-grid-gap: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(31, 37, 43, 0.04);
  backdrop-filter: blur(14px);
}

.page-header {
  position: static;
}

.header-top,
.header-search {
  display: grid;
  align-items: center;
  gap: 18px;
  padding: 10px max(22px, calc((100vw - 1480px) / 2));
}

.header-top {
  grid-template-columns: minmax(220px, 280px) minmax(140px, 260px) minmax(0, 1fr) auto;
  min-height: 52px;
  background: #fbfbfc;
}

.header-search {
  grid-template-columns: auto auto minmax(260px, 520px) auto auto minmax(0, 1fr) auto;
  border-top: 1px solid #eef0f2;
  background: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 154px;
  max-width: 100%;
  height: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6a00, #ff9a1f);
  color: #fff;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.buyer-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}

.text-link,
.utility-nav a,
.page-nav-left a {
  border: 0;
  background: transparent;
  color: #34424d;
  text-decoration: none;
  font-weight: 600;
}

.text-link.strong,
.text-link:hover,
.utility-nav a:hover,
.page-nav-left a:hover {
  color: var(--brand-dark);
}

.page-nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: start;
}

.utility-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  grid-column: 4;
  justify-self: end;
}

.is-hidden {
  display: none !important;
}

.searchbar {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: 6px;
  color: var(--muted);
}

.searchbar input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.topnav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 42px;
  padding: 3px;
  border: 1px solid #ffd2ad;
  border-radius: 7px;
  background: #fff8f2;
}

.search-mode-switch button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #87400c;
  font-size: 13px;
  font-weight: 800;
}

.search-mode-switch button.is-active {
  background: var(--brand);
  color: #fff;
}

.image-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #ffd1a8;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: #b94a00;
  font-weight: 700;
}

.image-search-btn:hover {
  background: #f3e2c6;
}

.search-action {
  min-height: 42px;
  padding: 0 28px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.cost-entry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 7;
  justify-self: end;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #b9dde0;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: #1d6872;
  text-decoration: none;
  font-weight: 800;
}

.cost-entry-btn:hover {
  background: #dfeaf0;
}

.search-action:hover {
  background: var(--brand-dark);
}

.camera-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 16px;
  border: 1.8px solid currentColor;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.18));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.camera-icon::before {
  position: absolute;
  top: -5px;
  left: 4px;
  width: 9px;
  height: 4px;
  border: 1.8px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  content: "";
}

.camera-icon::after {
  position: absolute;
  top: 4px;
  left: 7px;
  width: 5px;
  height: 5px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  box-shadow: 6px -3px 0 -2px currentColor;
  content: "";
}

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

.nav-btn,
.primary-btn,
.ghost-btn,
.icon-btn,
.chip,
.type-btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 36px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: transparent;
  color: #3c444c;
  font-weight: 700;
  text-decoration: none;
}

.nav-btn.is-active,
.nav-btn:hover {
  color: #fff;
  background: var(--brand);
}

.workspace {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 32px;
}

.main {
  width: 100%;
}

.sidebar,
.details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel,
.detail-card,
.section-head,
.metrics,
.application-form,
.admin-card,
.product-card,
.supplier-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel,
.detail-card {
  padding: 12px;
}

.panel h2,
.detail-card h2 {
  margin: 0 0 10px;
  font-size: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.segmented {
  display: grid;
  gap: 4px;
}

.segmented.nature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #edf0f2;
  border-radius: 6px;
  background: #f7f8fa;
  color: var(--text);
  text-align: left;
  font-size: 12px;
}

.segmented button.is-active {
  background: #fff4e8;
  border-color: #ffd2ad;
  color: var(--brand-dark);
  font-weight: 700;
}

.catalog-filter-card .segmented button:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.segmented small {
  color: var(--muted);
}

.filter-all-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #ffd2ad;
  border-radius: 6px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.filter-all-btn.is-active,
.filter-all-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.type-list,
.tag-cloud {
  display: grid;
  gap: 6px;
}

.type-list {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-content: start;
  overflow: auto;
}

.tag-cloud {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.type-btn,
.chip {
  padding: 6px 9px;
  background: #f7f8fa;
  border-color: #edf0f2;
  color: #34424d;
  font-size: 12px;
  text-align: center;
}

.catalog-filter-card .segmented button,
.catalog-filter-card .type-btn {
  min-height: 28px;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-btn.is-active,
.chip.is-active {
  background: #242a31;
  border-color: #242a31;
  color: #fff;
}

.type-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.type-btn.is-short {
  grid-column: span 2;
}

.type-btn.is-long {
  grid-column: span 3;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  padding: 0;
  background: #f5f7f8;
  border-color: var(--line);
  color: #46535d;
  font-size: 18px;
  line-height: 1;
}

.icon-btn:hover {
  background: #e8eef1;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 12px 14px;
}

.product-board-head {
  justify-content: flex-start;
  gap: 28px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.product-board-head .actions {
  flex: none;
  margin-left: 28px;
}

.product-heading {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.section-head h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.product-board-head h1 {
  margin: 0;
  min-width: 56px;
  font-size: 20px;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

select,
input,
textarea {
  border: 1px solid #d7e0e4;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}

select {
  height: 38px;
  padding: 0 10px;
}

.primary-btn,
.ghost-btn {
  padding: 0 14px;
  font-weight: 700;
}

.primary-btn {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.ghost-btn {
  background: #fff;
  border-color: var(--line);
  color: #34424d;
}

.ghost-btn:hover {
  background: #f0f4f5;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.product-board-head .metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  align-items: center;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  width: min(520px, 42vw);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.metric {
  padding: 10px 12px;
  background: #fff;
}

.product-board-head .metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 10px;
  background: #fff;
  white-space: nowrap;
}

.metric strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.product-board-head .metric strong {
  display: inline;
  color: var(--brand-dark);
  font-size: 14px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.product-board-head .metric span {
  font-size: 12px;
}

.filter-line {
  min-height: 32px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.market-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #ffe0c6;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #fff6ed, #fff);
}

.market-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.market-main strong {
  color: #b84900;
  font-size: 18px;
  white-space: nowrap;
}

.market-main span {
  overflow: hidden;
  color: #5f646b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.market-tags button {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #ffd8b8;
  border-radius: 6px;
  background: #fff;
  color: #b84900;
  font-size: 12px;
  font-weight: 700;
}

.market-tags button:hover {
  background: #fff1e5;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--product-grid-gap);
  grid-auto-flow: dense;
  align-items: stretch;
}

.catalog-filter-card {
  grid-row: span 2;
  min-width: 0;
  overflow: hidden;
  gap: var(--product-grid-gap);
}

.catalog-filter-card .panel {
  padding: 10px;
}

.catalog-filter-card .panel + .panel {
  margin-top: 0;
}

.catalog-filter-card .panel-head {
  min-height: 30px;
  margin-bottom: 4px;
}

.catalog-filter-card .filter-all-btn {
  min-height: 26px;
  padding: 0 9px;
  line-height: 1;
}

.type-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.type-panel .type-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  padding-right: 3px;
  padding-bottom: 16px;
  scroll-padding-bottom: 16px;
}

.product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.product-card:hover,
.supplier-click-card:hover,
.related-card:hover {
  border-color: #ffc491;
  box-shadow: 0 10px 22px rgba(31, 37, 43, 0.07);
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: contain;
  display: block;
  padding: 8px;
  background: #f7f8fa;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 8px 9px 9px;
}

.product-card h3,
.supplier-card h3 {
  margin: 0;
  line-height: 1.35;
}

.supplier-card h3 {
  font-size: 16px;
}

.product-card h3 {
  display: -webkit-box;
  min-height: 0;
  overflow: hidden;
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.product-category {
  flex: 0 0 auto;
  margin-right: 2.5em;
  overflow: hidden;
  color: #555d66;
  font-weight: 800;
  text-overflow: ellipsis;
}

.product-nature {
  margin-right: 8px;
  color: #91571a;
  font-weight: 700;
}

.product-supplier-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #2f363d;
  font-weight: 700;
  text-overflow: ellipsis;
}

.product-card-line span:not(.product-category):not(.product-supplier-name) {
  flex: none;
}

.product-summary,
.detail-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.product-summary {
  display: -webkit-box;
  min-height: 18px;
  margin: 3px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.product-shop {
  overflow: hidden;
  margin-top: auto;
  color: #2f363d;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: #edf2f5;
  color: #46535d;
  font-size: 12px;
  white-space: nowrap;
}

.badge.cert {
  background: #ecf5ef;
  color: var(--brand-dark);
}

.badge.warn {
  background: #fff4df;
  color: #8b5b10;
}

.product-meta,
.supplier-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.spec-list {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.product-card .spec-list {
  min-height: 36px;
  margin-top: 4px;
  margin-bottom: 0;
  gap: 3px;
  font-size: 12px;
}

.product-card .spec-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.card-actions button {
  flex: 1;
}

.supplier-list,
.admin-board {
  display: grid;
  gap: 12px;
}

.supplier-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.supplier-card,
.admin-card {
  padding: 14px;
}

a.supplier-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.supplier-click-card {
  cursor: pointer;
}

.supplier-board-head,
.map-board-head {
  align-items: center;
}

.supplier-heading-block {
  flex: 1 1 auto;
  min-width: 0;
}

.supplier-title-row,
.map-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.supplier-title-row h1,
.map-title-row h1 {
  margin-right: 34px;
}

.supplier-filter-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.supplier-filter-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #edf0f2;
  border-radius: 6px;
  background: #fff;
  color: #34424d;
  font-size: 12px;
  font-weight: 700;
}

.supplier-filter-btn.is-active,
.supplier-filter-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.map-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.map-selects .filter-all-btn {
  margin-right: 14px;
}

.map-selects select {
  width: 112px;
  height: 34px;
}

.supplier-result-card {
  position: relative;
  min-height: 224px;
  cursor: pointer;
}

.supplier-result-card .supplier-layout {
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: start;
  padding-right: 96px;
}

.supplier-result-card .supplier-visual {
  width: 124px;
  height: 124px;
}

.supplier-info {
  min-width: 0;
}

.supplier-location {
  margin-top: 3px;
  color: #8a632c;
  font-size: 13px;
  font-weight: 700;
}

.supplier-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 7px;
}

.supplier-contact-btn,
.supplier-follow-btn {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #ffd2ad;
  border-radius: 6px;
  background: #fff7f0;
  color: #b94a00;
  font-size: 12px;
  font-weight: 800;
}

.supplier-follow-btn {
  border-color: #d8e6ea;
  background: #eef7f8;
  color: #286b75;
}

.supplier-contact-btn:hover,
.supplier-follow-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.supplier-result-card .score {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 64px;
  height: 30px;
  white-space: nowrap;
}

.supplier-result-card .score span {
  display: inline;
  font-size: 12px;
}

.supplier-spec-list {
  margin: 8px 0 0;
  padding-right: 4px;
  gap: 4px;
}

.supplier-spec-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-layout {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.supplier-visual {
  width: 116px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: #eef3f1;
}

.supplier-visual-link {
  display: block;
  width: 116px;
  color: inherit;
  text-decoration: none;
}

.card-title-link {
  color: inherit;
  text-decoration: none;
}

.card-title-link:hover {
  color: var(--brand-dark);
}

.score {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #f6f0e4;
  color: #7a4e11;
  font-weight: 700;
}

.score span {
  font-size: 12px;
  color: #9a6b24;
  font-weight: 400;
}

.detail-card {
  box-shadow: none;
}

.detail-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.detail-title h2 {
  margin: 0;
}

.detail-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 12px 0;
  background: #eef3f1;
}

.kv {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 7px 10px;
  margin: 12px 0;
  font-size: 13px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
}

.match-list {
  display: grid;
  gap: 9px;
}

.right-rail-product {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.supplier-map-card {
  position: sticky;
  top: 122px;
}

.map-region-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding-right: 4px;
}

.map-region-item {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
}

.map-region-item h3 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 16px;
}

.map-region-item div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.map-region-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.match-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.match-item strong {
  display: block;
  margin-bottom: 5px;
}

.match-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.quick-form {
  display: grid;
  gap: 9px;
}

.quick-form input,
.quick-form textarea {
  width: 100%;
  padding: 10px;
}

.quick-form textarea {
  min-height: 92px;
  resize: vertical;
}

.application-form {
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: #34424d;
  font-size: 13px;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 10px;
  font-weight: 400;
}

.form-grid textarea {
  min-height: 88px;
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.admin-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.admin-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.danger-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #ead1ce;
  border-radius: var(--radius);
  background: #fff7f6;
  color: var(--red);
  font-weight: 700;
}

.modal,
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal.is-open,
.auth-modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 28, 0.42);
}

.modal-card {
  position: relative;
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  margin: 84px auto 0;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card h2,
.portal-card h2 {
  margin: 0 44px 14px 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #34424d;
  font-weight: 700;
}

.auth-tabs button.is-active {
  background: #e8f2ed;
  border-color: #b7d6c7;
  color: var(--brand-dark);
}

.auth-panel {
  display: none;
  gap: 12px;
}

.auth-panel.is-visible {
  display: grid;
}

.auth-panel label {
  display: grid;
  gap: 7px;
  color: #34424d;
  font-size: 13px;
  font-weight: 700;
}

.auth-panel input {
  width: 100%;
  padding: 10px;
  font-weight: 400;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.modal-content {
  padding: 20px;
}

.modal-content h2 {
  margin: 0 44px 12px 0;
}

.modal-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}

.modal-grid img {
  width: 100%;
  border-radius: var(--radius);
  background: #eef3f1;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  transform: translateY(20px);
  opacity: 0;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #18212b;
  color: #fff;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.portal-page,
.product-page {
  background: #f5f7f8;
}

.portal-layout,
.product-detail-page {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 430px);
  gap: 18px;
  width: min(980px, calc(100vw - 32px));
  margin: 42px auto 48px;
  align-items: start;
}

.personal-layout {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  width: min(1480px, calc(100vw - 24px));
  margin: 20px auto 48px;
  align-items: start;
}

.personal-side,
.personal-main,
.personal-panel,
.favorite-source,
.sticky-calculator {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.personal-side {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.personal-side h2 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.3;
}

.personal-nav {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #34424d;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.personal-nav.is-active,
.personal-nav:hover {
  background: #e8f2ed;
  color: var(--brand-dark);
}

.personal-main {
  padding: 14px;
}

.personal-panel {
  display: none;
  border: 0;
  background: transparent;
}

.personal-panel.is-visible {
  display: block;
}

.personal-panel h1 {
  margin: 0 0 16px;
}

.cost-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 360px);
  gap: 14px;
  align-items: start;
}

.favorite-source,
.sticky-calculator {
  padding: 12px;
}

.personal-panel-head h1 {
  margin-bottom: 0;
}

.favorite-company-list,
.cost-favorite-list {
  display: grid;
  gap: 12px;
}

.favorite-company-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.favorite-company-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  background: #f7faf8;
  border-bottom: 1px solid var(--line);
}

.favorite-company-head a:first-child {
  color: #1f252b;
  text-decoration: none;
  font-size: 17px;
  font-weight: 800;
}

.favorite-company-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.favorite-product-list {
  display: grid;
}

.favorite-product-row {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr) minmax(360px, 0.48fr);
  gap: 14px;
  align-items: center;
  min-height: 126px;
  padding: 14px;
  border-bottom: 1px solid #eef0f2;
}

.favorite-product-row:last-child {
  border-bottom: 0;
}

.favorite-product-image,
.cost-source-image {
  display: grid;
  place-items: center;
  border: 1px solid #edf0f2;
  border-radius: 7px;
  background: #fbfcfd;
}

.favorite-product-image img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.favorite-product-title,
.source-title,
.source-supplier {
  color: #1f252b;
  text-decoration: none;
  font-weight: 800;
}

.favorite-product-title:hover,
.source-title:hover,
.source-supplier:hover,
.favorite-company-head a:first-child:hover {
  color: var(--brand-dark);
}

.favorite-product-specs,
.source-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.favorite-product-specs span,
.source-specs span,
.favorite-product-meta span,
.source-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f3f5f6;
  color: #52606c;
  font-size: 12px;
}

.favorite-product-specs .sku-chip,
.source-specs .sku-chip {
  border: 1px solid rgba(255, 106, 0, 0.24);
  background: #fff4e8;
  color: var(--brand-dark);
  font-weight: 800;
}

.sku-summary {
  margin-top: 6px;
  color: #2f6f79;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.favorite-product-meta,
.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.favorite-price-block {
  display: grid;
  grid-template-columns: 86px minmax(230px, 1fr);
  gap: 10px;
  align-items: center;
}

.display-price,
.private-price {
  min-height: 42px;
  padding: 8px;
  border: 1px solid #edf0f2;
  border-radius: 7px;
  background: #fffdfa;
}

.display-price span,
.private-price > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.display-price strong {
  display: block;
  margin-top: 3px;
  color: #9a6728;
  font-size: 15px;
}

.private-price {
  display: grid;
  grid-template-columns: auto minmax(92px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  background: #fbfcfd;
}

.private-price input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 6px 8px;
  border: 1px solid #dce3e8;
  border-radius: 6px;
  text-align: right;
}

.mini-save-btn,
.mini-clear-btn {
  height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.mini-save-btn {
  border: 1px solid rgba(255, 106, 0, 0.36);
  background: #fff4e8;
  color: var(--brand-dark);
}

.mini-clear-btn {
  border: 1px solid #dce3e8;
  background: #fff;
  color: #52606c;
}

.cost-source-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 178px 88px;
  gap: 12px;
  align-items: center;
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.cost-source-image img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.source-supplier {
  display: block;
  margin-bottom: 6px;
  color: #52606c;
  font-size: 13px;
}

.source-title {
  display: block;
  line-height: 1.35;
}

.compact-private-price {
  grid-template-columns: 74px minmax(190px, 1fr);
}

.cost-price-lines {
  display: grid;
  gap: 8px;
}

.cost-price-lines span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #edf0f2;
  border-radius: 7px;
  background: #fbfcfd;
  color: #52606c;
  font-size: 13px;
}

.cost-price-lines strong {
  color: #9a6728;
  white-space: nowrap;
}

.cost-price-lines strong.is-empty {
  color: var(--muted);
}

.cost-row-actions {
  display: grid;
  gap: 8px;
}

.add-cost-btn {
  min-width: 88px;
  white-space: nowrap;
}

.cancel-favorite-btn {
  min-width: 88px;
  white-space: nowrap;
}

.favorite-scroll {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 4px;
}

.source-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
}

.source-item img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface-soft);
}

.source-item strong,
.source-item span,
.source-item small {
  display: block;
}

.source-item span,
.source-item small {
  color: var(--muted);
  font-size: 12px;
}

.source-item em {
  color: #9a6728;
  font-style: normal;
  font-weight: 800;
}

.sticky-calculator {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 96px);
  overflow: auto;
}

.portal-page.is-cost-tab .cost-workbench {
  display: block;
  padding-right: 374px;
}

.portal-page.is-cost-tab .favorite-source {
  width: 100%;
}

.portal-page.is-cost-tab .sticky-calculator {
  position: fixed;
  top: 96px;
  right: max(12px, calc((100vw - 1480px) / 2));
  z-index: 18;
  width: 360px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  box-shadow: var(--shadow);
}

.calc-quantity {
  display: flex;
  justify-content: space-between;
  min-height: 36px;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.calc-quantity input {
  width: 86px;
  height: 30px;
  padding: 5px 8px;
}

.calc-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.calc-column {
  min-height: 92px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.calc-column h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.calc-drop {
  display: grid;
  gap: 7px;
}

.calc-drop p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.calc-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px auto;
  gap: 7px;
  align-items: center;
  padding: 6px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #eee7dc;
}

.calc-item strong,
.calc-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-item strong {
  color: #9a6728;
  font-size: 13px;
}

.calc-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.calc-item input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 5px 8px;
  text-align: right;
}

.calc-item button {
  width: 24px;
  height: 24px;
  border: 1px solid #ead1ce;
  border-radius: 6px;
  background: #fff7f6;
  color: var(--red);
}

.unfollow-btn {
  white-space: nowrap;
}

.compact-extra {
  gap: 6px;
  margin-top: 10px;
}

.compact-extra h3 {
  margin-bottom: 0;
  font-size: 14px;
}

.compact-extra .extra-row {
  min-height: 36px;
  padding: 6px 8px;
  grid-template-columns: minmax(0, 1fr) 86px;
}

.compact-extra .extra-row input {
  height: 30px;
  padding: 5px 8px;
}

.compact-form {
  max-width: 760px;
}

.login-intro,
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.login-intro h1 {
  margin: 8px 0 10px;
  font-size: 32px;
  line-height: 1.2;
}

.login-intro p {
  color: var(--muted);
  line-height: 1.8;
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.portal-intro,
.portal-card,
.product-hero,
.detail-band,
.detail-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.portal-intro,
.portal-card,
.detail-band,
.detail-section {
  padding: 18px;
}

.portal-intro h1 {
  margin: 6px 0 10px;
  font-size: 30px;
  line-height: 1.2;
}

.portal-intro p {
  color: var(--muted);
  line-height: 1.7;
}

.merchant-console {
  grid-column: 2;
}

.console-head,
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.console-head h2 {
  margin: 0;
}

.status-card {
  align-items: flex-start;
  flex-direction: column;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dbe8df;
  border-radius: var(--radius);
  background: #f3faf6;
}

.status-card span {
  color: var(--muted);
  font-size: 13px;
}

.merchant-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.merchant-dashboard article {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
}

.merchant-dashboard span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.merchant-action-row {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.product-hero {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
}

.commerce-detail {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.commerce-gallery {
  display: grid;
  gap: 12px;
}

.commerce-gallery > img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.thumb-row button {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.thumb-row button.is-active {
  border-color: var(--brand);
}

.thumb-row img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  background: var(--surface-soft);
  border-radius: 6px;
}

.commerce-info h1 {
  margin: 6px 0 10px;
  font-size: 30px;
  line-height: 1.2;
}

.commerce-summary {
  color: var(--muted);
  line-height: 1.7;
}

.commerce-price {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff4ed;
}

.commerce-price span {
  color: #9b5a2a;
  font-size: 13px;
  font-weight: 700;
}

.commerce-price strong {
  color: #c44c1c;
  font-size: 28px;
}

.sku-selector {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.sku-selector h2 {
  margin: 0;
  font-size: 15px;
}

.sku-group {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.sku-group > span {
  padding-top: 7px;
  color: #52606c;
  font-size: 13px;
  font-weight: 700;
}

.sku-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sku-option-btn {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #dce3e8;
  border-radius: 7px;
  background: #fff;
  color: #34424d;
  font-weight: 700;
}

.sku-option-btn.is-active,
.sku-option-btn:hover {
  border-color: rgba(255, 106, 0, 0.5);
  background: #fff4e8;
  color: var(--brand-dark);
}

.sku-current {
  min-height: 32px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #eef6f2;
  color: #34424d;
  font-size: 13px;
}

.sku-current strong {
  color: var(--brand-dark);
}

.commerce-supplier {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.commerce-supplier h2 {
  margin: 12px 0;
  font-size: 18px;
}

.supplier-detail-hero {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 120px;
  gap: 20px;
  align-items: center;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.supplier-detail-logo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.supplier-detail-hero h1 {
  margin: 6px 0 10px;
  font-size: 30px;
  line-height: 1.2;
}

.supplier-score.compact {
  width: 100%;
  height: 72px;
}

.detail-tabs {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
}

.detail-tabs a {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: var(--radius);
  color: #34424d;
  text-decoration: none;
  font-weight: 700;
}

.detail-tabs a:hover {
  background: #e8f2ed;
  color: var(--brand-dark);
}

.section-head.inline {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #34424d;
  font-weight: 700;
}

.quantity-control input {
  width: 96px;
  padding: 8px 10px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
}

.component-list,
.extra-list {
  display: grid;
  gap: 10px;
}

.component-list h3,
.extra-list h3 {
  margin: 0 0 4px;
}

.component-row,
.extra-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.component-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.component-row input {
  width: 18px;
  height: 18px;
}

.component-row strong,
.component-row small {
  display: block;
}

.component-row small {
  margin-top: 3px;
  color: var(--muted);
}

.component-row em {
  color: #c44c1c;
  font-style: normal;
  font-weight: 700;
}

.extra-row {
  grid-template-columns: minmax(0, 1fr) 110px;
}

.extra-row input {
  padding: 8px 10px;
}

.cost-summary {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 12px;
  border-radius: var(--radius);
  background: #18212b;
  color: #fff;
}

.cost-summary span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cost-summary strong {
  color: #b9f0d1;
}

.region-grid,
.map-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.region-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.region-card h3 {
  margin: 0;
  font-size: 18px;
}

.region-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.region-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.product-gallery {
  display: grid;
  place-items: center;
  min-height: 360px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.product-gallery img {
  width: min(86%, 360px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.product-info h1 {
  margin: 6px 0 10px;
  font-size: 32px;
  line-height: 1.2;
}

.product-info p {
  color: var(--muted);
  line-height: 1.7;
}

.detail-kv {
  grid-template-columns: 96px 1fr;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #34424d;
  text-decoration: none;
  font-weight: 700;
}

.detail-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 14px;
}

.detail-band h2,
.detail-section h2 {
  margin: 4px 0 12px;
}

.supplier-score {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  background: #f6f0e4;
  color: #7a4e11;
}

.supplier-score strong {
  font-size: 32px;
}

.supplier-score span {
  color: #9a6b24;
  font-size: 12px;
}

.detail-section {
  margin-top: 14px;
}

.description-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  color: var(--muted);
  line-height: 1.8;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.related-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.related-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.related-card span {
  color: var(--muted);
  font-size: 12px;
}

.component-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.component-preview {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
}

.component-preview span {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 26px;
  border: 1px dashed #cad5da;
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.product-grid .empty-state {
  grid-column: span 5;
}

.supplier-list .empty-state {
  grid-column: 1 / -1;
}

.search-results-page {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 36px;
}

.search-result-head,
.horizontal-filter-card,
.search-sort-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-result-head {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(420px, 0.9fr);
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
}

.search-result-head h1 {
  margin: 2px 0 0;
  font-size: 24px;
}

.search-result-head .metrics {
  margin: 0;
}

.horizontal-filter-card {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  padding: 14px 18px;
}

.horizontal-filter-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-height: 42px;
}

.horizontal-filter-row strong {
  padding-top: 7px;
  color: #1f252b;
  font-size: 15px;
}

.horizontal-filter-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}

.region-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 14px;
}

.region-selects select {
  width: 112px;
  height: 34px;
}

.filter-pill {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #34424d;
  font-size: 14px;
  font-weight: 700;
}

.filter-pill.is-active,
.filter-pill:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.search-sort-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 18px;
}

.search-sort-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.search-sort-tabs button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #34424d;
  font-size: 15px;
  font-weight: 800;
}

.search-sort-tabs button.is-active {
  color: var(--brand-dark);
}

.search-sort-card .filter-line {
  min-height: auto;
  margin: 0;
}

.search-product-grid {
  margin-top: 12px;
}

.search-supplier-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.search-supplier-list .supplier-result-card {
  min-height: 224px;
}

.search-supplier-list .supplier-result-card .supplier-layout {
  grid-template-columns: 132px minmax(0, 1fr);
}

.search-supplier-list .supplier-result-card .supplier-visual {
  width: 132px;
  height: 132px;
}

.search-supplier-list .supplier-card-actions {
  top: 16px;
  right: 16px;
}

.filter-level-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dfe6ea;
  border-radius: 6px;
  background: #f8fafb;
  color: #51606b;
  font-size: 13px;
  font-weight: 800;
}

.filter-level-btn.is-active,
.filter-level-btn:hover {
  background: #242a31;
  border-color: #242a31;
  color: #fff;
}

@media (max-width: 1220px) {
  .workspace {
    width: calc(100vw - 28px);
  }

  .map-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .details {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .header-top,
  .header-search {
    grid-template-columns: 1fr;
  }

  .topnav,
  .utility-nav,
  .page-nav-left,
  .buyer-entry {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .utility-nav,
  .cost-entry-btn {
    grid-column: auto;
    justify-self: start;
  }

  .workspace {
    grid-template-columns: 1fr;
    width: calc(100vw - 24px);
    padding: 12px 0 28px;
  }

  .sidebar,
  .details {
    grid-column: auto;
    display: flex;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-filter-card {
    grid-row: auto;
    height: auto !important;
  }

  .product-board-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .product-board-head .actions {
    margin-left: 0;
  }

  .product-board-head .metrics {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics,
  .form-grid,
  .details,
  .map-board,
  .search-result-head,
  .horizontal-filter-row,
  .search-supplier-list .supplier-result-card .supplier-layout {
    grid-template-columns: 1fr;
  }

  .section-head,
  .supplier-layout,
  .admin-card,
  .modal-grid,
  .portal-layout,
  .login-layout,
  .personal-layout,
  .cost-workbench,
  .calc-columns,
  .component-preview-grid,
  .merchant-dashboard,
  .commerce-detail,
  .calculator-grid,
  .region-grid,
  .product-hero,
  .detail-band,
  .description-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .supplier-detail-hero {
    grid-template-columns: 1fr;
  }

  .supplier-detail-logo {
    width: min(220px, 100%);
  }

  .source-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .source-item img {
    width: 64px;
    height: 64px;
  }

  .source-item em,
  .source-item button {
    justify-self: start;
  }

  .favorite-company-head,
  .private-price {
    align-items: stretch;
  }

  .favorite-company-head {
    flex-direction: column;
  }

  .favorite-product-row,
  .cost-source-row,
  .favorite-price-block,
  .compact-private-price {
    grid-template-columns: 1fr;
  }

  .favorite-product-image,
  .cost-source-image {
    width: 100%;
  }

  .favorite-product-image img,
  .cost-source-image img {
    width: min(120px, 100%);
    height: 120px;
  }

  .private-price {
    grid-template-columns: 1fr;
  }

  .add-cost-btn {
    width: 100%;
  }

  .merchant-console {
    grid-column: auto;
  }

  .section-head,
  .actions {
    align-items: stretch;
  }

  .market-main {
    display: grid;
    gap: 4px;
  }

  .market-main span {
    white-space: normal;
  }

  .section-head,
  .actions,
  .admin-actions {
    flex-direction: column;
  }

  .supplier-visual {
    width: 100%;
    aspect-ratio: 16 / 8;
  }

  .supplier-visual-link {
    width: 100%;
  }

  .product-card {
    height: auto;
    min-height: auto;
  }

  .product-image {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .supplier-list,
  .supplier-result-card .supplier-layout {
    grid-template-columns: 1fr;
  }

  .supplier-result-card .supplier-layout {
    padding-right: 0;
  }

  .supplier-card-actions,
  .supplier-result-card .score {
    position: static;
    margin-top: 10px;
  }

  .search-results-page {
    width: calc(100vw - 24px);
  }

  .search-result-head .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-supplier-list .supplier-result-card .supplier-visual {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 8;
  }

  .product-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-tabs {
    position: static;
    overflow-x: auto;
  }

  .personal-side,
  .sticky-calculator,
  .supplier-map-card {
    position: static;
  }

  .portal-page.is-cost-tab .cost-workbench {
    padding-right: 0;
  }

  .portal-page.is-cost-tab .sticky-calculator {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }
}

@media (max-width: 520px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-grid .empty-state {
    grid-column: auto;
  }
}
