:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #626866;
  --line: #dce2dc;
  --paper: #f7f8f6;
  --panel: #ffffff;
  --soft: #eef1ee;
  --green: #0f6b57;
  --green-weak: #dcece7;
  --wine: #7d2637;
  --blue: #234d66;
  --gold: #9b7025;
  --danger: #9f3528;
  --shadow: 0 18px 50px rgba(27, 23, 19, 0.08);
  --shadow-soft: 0 10px 28px rgba(27, 23, 19, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 107, 87, 0.1), transparent 280px),
    linear-gradient(180deg, rgba(15, 107, 87, 0.055), transparent 440px),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 42px) 48px;
}

.topbar {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(220, 226, 220, 0.92);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.64)),
    rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.brand-lockup {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(15, 107, 87, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent),
    var(--green);
  color: white;
  font-size: 0.78rem;
  font-weight: 860;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(15, 107, 87, 0.18);
}

.brand-lockup > div > strong,
.brand-lockup > div > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup > div > strong {
  font-size: 1.1rem;
  line-height: 1.05;
}

.brand-lockup > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  max-width: 860px;
  font-size: clamp(1.55rem, 2.8vw, 2.85rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.hero-subtitle {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(0.88rem, 1.2vw, 1rem);
  line-height: 1.42;
}

.brand-disclaimer {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 640;
  line-height: 1.35;
}

.hero-snapshot {
  display: flex;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  justify-content: flex-end;
  padding: 4px;
  border: 1px solid rgba(220, 226, 220, 0.74);
  border-radius: 9px;
  background: rgba(247, 248, 246, 0.68);
}

.hero-snapshot div {
  min-width: 0;
  width: 128px;
  padding: 9px 10px;
  border: 1px solid rgba(220, 226, 220, 0.72);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
}

.hero-snapshot span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 820;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-snapshot strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 1.28rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(90px, 0.42fr);
  gap: 6px;
  width: 100%;
  margin: 0 0 18px;
  padding: 5px;
  border: 1px solid rgba(220, 226, 220, 0.94);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(27, 23, 19, 0.04);
}

.tab-button {
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.05vw, 0.96rem);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.tab-button.active {
  background: var(--ink);
  color: white;
  box-shadow: 0 8px 18px rgba(23, 23, 23, 0.14);
}

.secondary-tab-button {
  color: var(--green);
  font-size: clamp(0.72rem, 0.9vw, 0.84rem);
}

.secondary-tab-button.active {
  background: var(--green-weak);
  color: var(--green);
}

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

.tool-band {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid rgba(220, 226, 220, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
}

.tool-band .filter-field {
  flex: 1 1 138px;
  min-width: 118px;
}

.tool-band .filter-field-sm {
  flex-basis: 108px;
  flex-grow: 0.7;
}

.tool-band .filter-search {
  flex: 2.2 1 310px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.tool-band label {
  gap: 6px;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(220, 226, 220, 0.96);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
  text-transform: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.tool-band select,
.tool-band input {
  min-height: 40px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 0.92rem;
  font-weight: 680;
}

select:focus,
input:focus {
  border-color: rgba(15, 107, 87, 0.4);
  box-shadow: 0 0 0 3px rgba(15, 107, 87, 0.1);
  outline: 0;
}

.tool-band input::placeholder {
  color: #767d79;
  opacity: 0.9;
}

.reset-filters-button {
  flex: 0 0 auto;
  align-self: end;
  min-width: 74px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(220, 226, 220, 0.94);
  border-radius: 7px;
  background: rgba(238, 241, 238, 0.84);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 780;
}

.reset-filters-button:hover {
  border-color: rgba(15, 107, 87, 0.28);
  color: var(--green);
}

.view-panel {
  display: none;
  padding: 22px 0 0;
}

.view-panel.active {
  display: block;
}

[hidden] {
  display: none !important;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.subsection-heading,
.market-heading-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.subsection-heading {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(220, 226, 220, 0.72);
}

.subsection-heading h3 {
  margin-bottom: 0;
  font-size: 1.28rem;
}

.market-heading-tools {
  align-items: center;
  padding: 4px;
  border: 1px solid rgba(220, 226, 220, 0.78);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.58);
}

.market-mode-control {
  grid-template-columns: repeat(3, minmax(86px, 1fr));
}

.market-subpanel {
  display: none;
}

.market-subpanel.active {
  display: block;
}

.plan-layout {
  display: grid;
  gap: 22px;
}

.plan-section {
  min-width: 0;
}

.secondary-heading {
  margin-top: 28px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(220, 226, 220, 0.94);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.live-table {
  min-width: 920px;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: rgba(238, 241, 238, 0.92);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 820;
  text-transform: uppercase;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  text-transform: inherit;
}

.sort-button::after {
  content: "";
  color: var(--green);
  font-size: 0.72rem;
}

.sort-button.active {
  color: var(--ink);
}

.sort-button.active[aria-sort="asc"]::after {
  content: "↑";
}

.sort-button.active[aria-sort="desc"]::after {
  content: "↓";
}

td {
  font-size: 0.94rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.bag-name {
  display: grid;
  gap: 5px;
  min-width: 170px;
}

.listing-config {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.listing-config strong {
  font-size: 0.96rem;
  font-weight: 740;
}

.listing-config span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.listing-cell {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 310px;
}

.listing-thumb {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
}

.listing-thumb.placeholder {
  display: block;
}

.bag-name strong {
  font-size: 1rem;
}

.bag-name span,
.config-line,
.tiny {
  color: var(--muted);
  font-size: 0.83rem;
}

.swatches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.swatch {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
  background: var(--swatch);
}

.swatch.large {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.swatch.image-swatch {
  background: var(--swatch-image) center / cover no-repeat;
}

.hardware-chip,
.value-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 780;
  white-space: nowrap;
}

.hardware-chip {
  border: 1px solid rgba(155, 112, 37, 0.3);
  background: #fff7e7;
  color: var(--gold);
}

.value-chip {
  background: var(--green-weak);
  color: var(--green);
}

.value-chip.watch {
  background: #f9e5e0;
  color: var(--danger);
}

.value-chip.neutral {
  background: var(--soft);
  color: var(--muted);
}

.bar {
  position: relative;
  width: 160px;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--width);
  border-radius: inherit;
  background: var(--green);
}

.value-grid,
.opportunity-grid {
  display: grid;
  gap: 12px;
}

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

.value-card,
.opportunity-card,
.reference-browser,
.discovery-card {
  border: 1px solid rgba(220, 226, 220, 0.94);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.value-card {
  display: grid;
  gap: 14px;
  min-height: 230px;
  padding: 16px;
  overflow: hidden;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.value-card:hover,
.opportunity-card:hover,
.wishlist-card:hover,
.boutique-panel:hover {
  border-color: rgba(15, 107, 87, 0.24);
  box-shadow: var(--shadow);
}

.value-card:hover,
.opportunity-card:hover {
  transform: translateY(-1px);
}

.value-card-image {
  width: calc(100% + 32px);
  height: 178px;
  margin: -16px -16px 0;
  object-fit: cover;
  background: var(--soft);
}

.value-card-image.placeholder {
  display: block;
}

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

.value-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 4px;
}

.value-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.value-stats span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.value-stats strong {
  overflow: hidden;
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.value-bar {
  width: 100%;
  height: 11px;
}

.opportunity-card {
  display: grid;
  grid-template-rows: 186px minmax(0, 1fr);
  overflow: hidden;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.opportunity-card img,
.opportunity-image {
  width: 100%;
  height: 186px;
  object-fit: cover;
  background: var(--soft);
}

.opportunity-copy {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.opportunity-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.opportunity-head span {
  color: var(--green);
  font-weight: 820;
  white-space: nowrap;
}

.opportunity-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.opportunity-stats div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: var(--soft);
}

.opportunity-stats span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.opportunity-stats strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.benchmark-line {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.opportunity-copy p {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.opportunity-card a {
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 760;
  text-decoration: none;
}

.card-link {
  align-self: end;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 760;
  text-decoration: none;
}

.listing-link-stack {
  display: grid;
  gap: 6px;
  align-self: end;
}

.listing-link-stack a {
  overflow: hidden;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 760;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-link-stack.table-links {
  align-self: auto;
  max-height: 148px;
  overflow: auto;
  min-width: 220px;
}

.load-more-row {
  display: grid;
  place-items: center;
  min-height: 70px;
  padding: 18px 0 4px;
}

.load-more-row:empty {
  display: none;
}

.load-more-button {
  min-height: 44px;
  min-width: 180px;
  padding: 0 18px;
  border: 1px solid rgba(15, 107, 87, 0.26);
  border-radius: 6px;
  background: var(--panel);
  color: var(--green);
  font-weight: 820;
}

.load-more-button:hover {
  background: var(--green-weak);
}

.opportunity-card a:hover,
.card-link:hover,
.listing-link-stack a:hover {
  text-decoration: underline;
}

.source-pipeline {
  display: grid;
  gap: 10px;
}

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

.source-overview article,
.pipeline-row {
  border: 1px solid rgba(220, 226, 220, 0.94);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.source-overview article {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.source-overview span,
.pipeline-metrics span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
  text-transform: uppercase;
}

.source-overview strong {
  font-size: 1.8rem;
  line-height: 1;
}

.pipeline-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(120px, auto);
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
}

.pipeline-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.pipeline-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pipeline-main > span,
.pipeline-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.pipeline-main > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-metrics {
  display: grid;
  gap: 8px;
  justify-items: end;
  text-align: right;
}

.pipeline-metrics div {
  display: grid;
  gap: 4px;
}

.pipeline-metrics strong {
  font-size: 1.1rem;
}

.pipeline-metrics a {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 780;
  text-decoration: none;
}

.pipeline-metrics a:hover {
  text-decoration: underline;
}

.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(35, 77, 102, 0.2);
  border-radius: 50%;
  background: #eef5f7;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 820;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 780;
  white-space: nowrap;
}

.status-chip.pending {
  background: #fff3dc;
  color: #805d1f;
}

.status-chip.live {
  background: var(--green-weak);
  color: var(--green);
}

.status-chip.blocked {
  background: #f9e5e0;
  color: var(--danger);
}

.reference-dashboard {
  display: grid;
  gap: 12px;
}

.bag-builder {
  padding: 18px;
  border: 1px solid rgba(220, 226, 220, 0.94);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.bag-builder-head,
.builder-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.bag-builder-head {
  margin-bottom: 12px;
}

.bag-builder-head h3 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.bag-builder-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: stretch;
}

.builder-popular {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.popular-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
  text-transform: uppercase;
}

.builder-preset {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.builder-preset:hover,
.builder-preset.active {
  border-color: rgba(15, 107, 87, 0.28);
  background: var(--green-weak);
}

.builder-preset strong,
.builder-preset em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-preset strong {
  font-size: 0.82rem;
}

.builder-preset em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
}

.builder-preset b {
  color: var(--green);
  font-size: 0.78rem;
}

.builder-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.builder-preview {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1fr);
  gap: 16px;
  min-height: 282px;
  padding: 16px;
  border: 1px solid rgba(220, 226, 220, 0.94);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(247, 248, 246, 0.94), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.builder-visual {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(230px, 100%);
  aspect-ratio: 1.05;
  overflow: visible;
  border: 1px solid rgba(23, 23, 23, 0.16);
  border-radius: 16px 16px 10px 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent 44%),
    var(--bag-image, linear-gradient(135deg, var(--bag-color, #b9853d), rgba(23, 23, 23, 0.08)));
  background-position: center;
  background-size: cover;
  box-shadow: 0 22px 42px rgba(27, 23, 19, 0.12);
}

.builder-visual.live-image {
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
}

.builder-live-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.builder-live-chip {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 24px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 820;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(27, 23, 19, 0.12);
}

.builder-handle {
  position: absolute;
  inset: -38px 22% auto;
  height: 58px;
  border: 10px solid rgba(23, 23, 23, 0.16);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.builder-flap {
  position: absolute;
  inset: 26% 0 auto;
  height: 42%;
  border-top: 1px solid rgba(23, 23, 23, 0.18);
  border-bottom: 1px solid rgba(23, 23, 23, 0.12);
  background: rgba(255, 255, 255, 0.13);
}

.builder-lock {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 28px;
  height: 32px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(23, 23, 23, 0.16);
  border-radius: 5px;
  background: linear-gradient(135deg, #d9b45f, #8e692d);
}

.builder-lock.palladium,
.builder-lock.silver {
  background: linear-gradient(135deg, #dfe3e3, #8f9799);
}

.builder-lock.rose-gold {
  background: linear-gradient(135deg, #e0a183, #9c5746);
}

.builder-lock.black-pvd {
  background: linear-gradient(135deg, #111111, #4a4a4a);
}

.builder-copy {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: center;
}

.builder-title-row strong,
.builder-title-row span {
  display: block;
}

.builder-title-row strong {
  font-size: 1.25rem;
  line-height: 1.05;
}

.builder-title-row span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

.builder-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.builder-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border-radius: 6px;
  background: var(--panel);
}

.builder-stats span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 820;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.builder-stats strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-links {
  max-height: 112px;
  overflow: auto;
}

.wishlist-save-button,
.wishlist-secondary-button,
.icon-text-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(15, 107, 87, 0.24);
  border-radius: 7px;
  background: var(--panel);
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 820;
}

.wishlist-save-button {
  justify-self: start;
}

.wishlist-save-button.saved {
  background: var(--green-weak);
}

.wishlist-secondary-button:hover,
.wishlist-save-button:hover,
.icon-text-button:hover {
  border-color: rgba(15, 107, 87, 0.42);
  background: var(--green-weak);
}

.icon-text-button.danger {
  border-color: rgba(159, 53, 40, 0.22);
  color: var(--danger);
}

.icon-text-button.danger:hover {
  background: rgba(159, 53, 40, 0.08);
}

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

.wishlist-empty,
.wishlist-card {
  border: 1px solid rgba(220, 226, 220, 0.94);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.wishlist-empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 20px;
}

.wishlist-empty strong {
  font-size: 1.05rem;
}

.wishlist-empty span {
  color: var(--muted);
  font-size: 0.92rem;
}

.wishlist-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  overflow: hidden;
  min-height: 280px;
}

.wishlist-media {
  position: relative;
  min-height: 100%;
  background: var(--soft);
}

.wishlist-image {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: grid;
  place-items: center;
  object-fit: cover;
}

.wishlist-image.placeholder .swatch {
  width: 42px;
  height: 42px;
}

.wishlist-status {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 840;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(27, 23, 19, 0.12);
}

.wishlist-status.hit {
  color: var(--green);
}

.wishlist-status.watching {
  color: var(--blue);
}

.wishlist-body {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 16px;
}

.wishlist-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.wishlist-card-head strong,
.wishlist-card-head span {
  display: block;
}

.wishlist-card-head strong {
  font-size: 1.08rem;
}

.wishlist-card-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

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

.wishlist-stats div,
.wishlist-stats label {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border-radius: 6px;
  background: var(--soft);
}

.wishlist-stats span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 820;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.wishlist-stats strong,
.wishlist-stats input {
  overflow: hidden;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 820;
  text-overflow: ellipsis;
}

.wishlist-stats input:focus {
  outline: 1px solid rgba(15, 107, 87, 0.24);
  outline-offset: 3px;
}

.wishlist-target-line {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.wishlist-links {
  max-height: 118px;
  overflow: auto;
}

.boutique-hero,
.boutique-panel {
  border: 1px solid rgba(220, 226, 220, 0.94);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.boutique-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(15, 107, 87, 0.08), transparent 52%),
    var(--panel);
}

.boutique-hero-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.boutique-hero-copy h3 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.05;
}

.boutique-hero-copy p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.boutique-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

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

.boutique-metrics div,
.boutique-target-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-radius: 6px;
  background: var(--soft);
}

.boutique-metrics span,
.boutique-target-stats span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 820;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.boutique-metrics strong,
.boutique-target-stats strong {
  overflow: hidden;
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.boutique-panel {
  min-width: 0;
  padding: 18px;
}

.boutique-targets-panel {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h3 {
  margin-bottom: 0;
  font-size: 1.28rem;
}

.boutique-target-list,
.boutique-log {
  display: grid;
  gap: 10px;
}

.boutique-target-row,
.boutique-log-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 246, 0.72);
}

.boutique-target-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px;
}

.boutique-target-media {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel);
}

.boutique-target-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.boutique-target-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.boutique-target-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.boutique-target-head strong,
.boutique-target-head span {
  display: block;
}

.boutique-target-head strong {
  font-size: 1.04rem;
}

.boutique-target-head span:not(.path-chip) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.32;
}

.boutique-target-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.36;
}

.boutique-target-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.boutique-target-actions {
  display: grid;
  justify-items: end;
}

.path-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  white-space: nowrap;
}

.path-chip.buy {
  background: var(--green-weak);
  color: var(--green);
}

.path-chip.compare {
  background: #fff4de;
  color: #8a611b;
}

.path-chip.wait,
.path-chip.watch {
  background: #eef5f7;
  color: var(--blue);
}

.boutique-links {
  max-height: 80px;
  overflow: auto;
}

.boutique-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.boutique-form .wide-field,
.boutique-form button {
  grid-column: 1 / -1;
}

.boutique-form button {
  justify-self: start;
}

.boutique-log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
}

.boutique-log-row strong,
.boutique-log-row span {
  display: block;
}

.boutique-log-row strong {
  font-size: 0.95rem;
}

.boutique-log-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.boutique-log-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.reference-browser {
  padding: 18px;
}

.reference-browser-head,
.reference-count-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.reference-browser-head {
  margin-bottom: 16px;
}

.reference-browser-head h3 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.segmented-control button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 780;
}

.segmented-control button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(27, 23, 19, 0.08);
}

.reference-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 12px;
  margin-bottom: 12px;
}

.reference-count-line {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.reference-toggle {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(15, 107, 87, 0.22);
  border-radius: 6px;
  background: var(--panel);
  color: var(--green);
  font-weight: 780;
}

.reference-toggle:hover {
  background: var(--green-weak);
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.discovery-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 12px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.discovery-card:hover {
  border-color: rgba(15, 107, 87, 0.24);
  background: var(--green-weak);
}

.discovery-card strong,
.discovery-card span:last-child {
  display: block;
  overflow-wrap: anywhere;
}

.discovery-card strong {
  font-size: 0.88rem;
  line-height: 1.18;
}

.discovery-card span:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.swatch-xl {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.42), transparent 28px),
    var(--swatch);
}

.swatch-xl.image-swatch {
  background: var(--swatch-image) center / cover no-repeat;
}

.material-mark {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0)),
    #9c7a58;
}

.material-mark.exotic {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.32) 0 5px, transparent 5px 12px),
    #5e4a3f;
}

.material-mark.grained {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.32) 1px, transparent 2px) 0 0 / 8px 8px,
    #8f6b4d;
}

.material-mark.structured {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.25) 1px, transparent 1px) 0 0 / 10px 10px,
    #7c5c4c;
}

.material-mark.smooth {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0)),
    #a87962;
}

.material-mark.heritage {
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.5), transparent),
    #b88548;
}

.material-mark.textile-and-suede {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 6px),
    #6c716f;
}

.hardware-mark {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(30, 28, 24, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 18px),
    linear-gradient(135deg, #d9b45f, #8e692d);
}

.hardware-mark.palladium,
.hardware-mark.silver {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 18px),
    linear-gradient(135deg, #dfe3e3, #8f9799);
}

.hardware-mark.permabrass,
.hardware-mark.champagne-gold {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 18px),
    linear-gradient(135deg, #ead28a, #a9833c);
}

.hardware-mark.rose-gold {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 18px),
    linear-gradient(135deg, #e0a183, #9c5746);
}

.hardware-mark.brushed-gold,
.hardware-mark.brushed,
.hardware-mark.electrum {
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.32) 0 2px, rgba(255, 255, 255, 0) 2px 6px),
    linear-gradient(135deg, #d9b45f, #7d6d56);
}

.hardware-mark.black-pvd {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 18px),
    linear-gradient(135deg, #111111, #4a4a4a);
}

.hardware-mark.diamond {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.95) 0 7px, rgba(255, 255, 255, 0) 8px),
    conic-gradient(from 45deg, #e6f3ff, #ffffff, #b8d9e7, #ffffff, #e6f3ff);
}

.material-mark.image-mark {
  background: var(--mark-image) center / cover no-repeat;
}

.empty-state {
  min-height: 78px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 48px;
  width: 100%;
}

@media (max-width: 1000px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 12px;
  }

  .hero-snapshot {
    justify-content: start;
  }

  .source-overview,
  .value-grid,
  .opportunity-grid,
  .wishlist-grid,
  .boutique-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .wishlist-card {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .reference-tools {
    grid-template-columns: 1fr 1fr;
  }

  .tool-band .filter-field,
  .tool-band .filter-field-sm {
    flex: 1 1 calc(25% - 8px);
  }

  .tool-band .filter-search {
    flex-basis: calc(50% - 5px);
  }

  .wide-field,
  .reset-filters-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 12px 12px 34px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
  }

  .subsection-heading,
  .market-heading-tools {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .market-heading-tools,
  .market-mode-control {
    width: 100%;
  }

  .market-heading-tools {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .market-mode-control {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px;
  }

  h1 {
    font-size: clamp(1.55rem, 8vw, 2.1rem);
    line-height: 1.02;
  }

  h2 {
    font-size: 1.28rem;
  }

  .eyebrow {
    margin-bottom: 5px;
    font-size: 0.68rem;
  }

  .hero-snapshot {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .hero-snapshot div {
    width: auto;
    padding: 8px 7px;
  }

  .hero-snapshot span {
    font-size: 0.54rem;
    line-height: 1.05;
    white-space: normal;
  }

  .hero-snapshot strong {
    margin-top: 5px;
    font-size: 1.05rem;
  }

  .view-tabs {
    display: flex;
    gap: 6px;
    margin: 0 -12px 12px;
    padding: 5px 12px 7px;
    overflow-x: auto;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .view-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    flex: 0 0 auto;
    min-width: 108px;
    min-height: 42px;
    padding: 0 13px;
    scroll-snap-align: start;
  }

  .secondary-tab-button {
    min-width: 92px;
  }

  .tool-band {
    gap: 9px;
    margin-bottom: 12px;
    padding: 9px;
  }

  .tool-band .filter-field,
  .tool-band .filter-field-sm {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .tool-band .filter-search {
    flex-basis: 100%;
  }

  label {
    gap: 5px;
    font-size: 0.68rem;
  }

  select,
  input {
    min-height: 42px;
    padding: 0 9px;
    font-size: 0.88rem;
  }

  .tool-band label {
    font-size: 0.62rem;
  }

  .tool-band select,
  .tool-band input {
    min-height: 40px;
    font-size: 0.86rem;
  }

  .wide-field,
  .reset-filters-button {
    grid-column: 1 / -1;
  }

  .reset-filters-button {
    flex-basis: 100%;
    min-height: 42px;
  }

  .value-grid,
  .opportunity-grid,
  .reference-tools {
    grid-template-columns: 1fr;
  }

  .wishlist-grid {
    grid-template-columns: 1fr;
  }

  .boutique-hero,
  .boutique-panel {
    padding: 12px;
  }

  .boutique-layout,
  .boutique-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .boutique-hero-copy h3 {
    font-size: 1.22rem;
  }

  .boutique-target-row {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .boutique-target-media {
    width: 62px;
    height: 62px;
  }

  .boutique-target-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .boutique-target-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .boutique-target-actions {
    grid-column: 2;
    justify-items: start;
  }

  .boutique-form {
    grid-template-columns: 1fr;
  }

  .boutique-log-row {
    grid-template-columns: 1fr;
  }

  .boutique-log-row .icon-text-button {
    justify-self: start;
  }

  .wishlist-card {
    grid-template-columns: 1fr;
  }

  .wishlist-image {
    min-height: 176px;
    height: 176px;
  }

  .wishlist-card-head {
    grid-template-columns: 1fr;
  }

  .wishlist-card-head .icon-text-button {
    justify-self: start;
  }

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

  .view-panel {
    padding-top: 12px;
  }

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

  .pipeline-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .pipeline-main > span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .pipeline-metrics {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }

  .value-grid,
  .opportunity-grid,
  .source-pipeline {
    gap: 10px;
  }

  .value-card {
    gap: 10px;
    min-height: auto;
    padding: 12px;
  }

  .value-card-image {
    width: calc(100% + 24px);
    height: 142px;
    margin: -12px -12px 0;
  }

  .value-card-head {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .swatch.large {
    width: 30px;
    height: 30px;
  }

  .bag-name {
    min-width: 0;
  }

  .listing-config {
    min-width: 0;
  }

  .bag-name strong {
    font-size: 0.95rem;
  }

  .listing-config strong {
    font-size: 0.92rem;
  }

  .listing-config span {
    font-size: 0.78rem;
  }

  .bag-name span,
  .config-line,
  .tiny {
    font-size: 0.76rem;
    line-height: 1.25;
  }

  .hardware-chip,
  .value-chip,
  .status-chip {
    min-height: 24px;
    padding: 0 7px;
    font-size: 0.68rem;
  }

  .value-stats,
  .opportunity-stats {
    gap: 6px;
  }

  .value-stats span,
  .opportunity-stats span {
    font-size: 0.58rem;
  }

  .value-stats strong,
  .opportunity-stats strong {
    font-size: 0.76rem;
  }

  .listing-link-stack {
    gap: 5px;
  }

  .listing-link-stack a {
    font-size: 0.76rem;
    line-height: 1.22;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .reference-browser-head,
  .reference-count-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .segmented-control {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .segmented-control button {
    min-height: 40px;
    padding: 0 6px;
    font-size: 0.82rem;
  }

  .reference-browser {
    padding: 12px;
  }

  .bag-builder {
    padding: 12px;
  }

  .bag-builder-head,
  .builder-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .bag-builder-head h3 {
    font-size: 1.12rem;
  }

  .bag-builder-layout,
  .builder-preview {
    grid-template-columns: 1fr;
  }

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

  .builder-preset {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .builder-preset b {
    grid-column: 2;
  }

  .builder-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .builder-preview {
    min-height: 0;
    padding: 12px;
  }

  .builder-visual {
    width: min(210px, 78vw);
    margin-top: 28px;
  }

  .builder-title-row strong {
    font-size: 1.05rem;
  }

  .builder-title-row span {
    font-size: 0.78rem;
  }

  .builder-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .builder-stats div {
    padding: 8px 6px;
  }

  .builder-stats span {
    font-size: 0.55rem;
  }

  .builder-stats strong {
    font-size: 0.76rem;
  }

  .reference-browser-head h3 {
    font-size: 1.12rem;
  }

  .reference-count-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .reference-tools {
    gap: 8px;
  }

  .discovery-grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 8px;
  }

  .discovery-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
    min-height: 74px;
    padding: 9px;
  }

  .swatch-xl,
  .material-mark,
  .hardware-mark {
    width: 40px;
    height: 40px;
  }

  .discovery-card strong {
    font-size: 0.8rem;
  }

  .discovery-card span:last-child {
    font-size: 0.66rem;
  }

  .opportunity-card {
    grid-template-rows: 150px minmax(0, 1fr);
  }

  .opportunity-card img,
  .opportunity-image {
    height: 150px;
  }

  .opportunity-copy {
    gap: 8px;
    padding: 12px;
  }

  .opportunity-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .opportunity-copy p {
    min-height: auto;
    font-size: 0.78rem;
  }

  .benchmark-line {
    font-size: 0.68rem;
  }

  .rank-badge {
    width: 30px;
    height: 30px;
    font-size: 0.72rem;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  .live-table {
    min-width: 0;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.84rem;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 820;
    text-transform: uppercase;
  }

  td:last-child {
    border-bottom: 0;
  }

  .listing-cell {
    grid-template-columns: 46px minmax(0, 1fr);
    min-width: 0;
    gap: 9px;
  }

  .listing-thumb {
    width: 46px;
    height: 46px;
  }

  .listing-link-stack.table-links {
    max-height: none;
    min-width: 0;
    overflow: visible;
  }

  .load-more-row {
    min-height: 62px;
    padding-top: 14px;
  }

  .load-more-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .view-tabs {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .discovery-grid {
    grid-template-columns: 1fr;
  }

  .builder-popular,
  .builder-controls {
    grid-template-columns: 1fr;
  }

  .value-stats,
  .opportunity-stats {
    grid-template-columns: 1fr 1fr;
  }

  td {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
