:root {
  --bg: #f4f1ea;
  --ink: #1d251f;
  --panel: #fffef9;
  --primary: #02583a;
  --accent: #f4b000;
  --danger: #9c1f1f;
  --muted: #56655d;
  --border: #dbd5c9;
  --shadow: 0 12px 30px rgba(11, 36, 19, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  line-height: 1.45;
  background: radial-gradient(circle at 20% 0%, #fff9de 0%, var(--bg) 50%);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  padding: 28px;
  background: linear-gradient(125deg, #114334 0%, #0f2f4d 55%, #9d5f00 100%);
  color: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.heroBrand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ebayLogo {
  width: 84px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  opacity: 0.9;
}

h1 {
  margin: 10px 0 8px;
  font-family: "Rockwell", "Courier New", serif;
  letter-spacing: 0.02em;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
}

.subtitle {
  margin: 0;
  max-width: 680px;
  color: #f4f7ef;
}

.viewSwitch {
  margin-top: 12px;
  display: inline-flex;
  background: #f0e6cc;
  border: 1px solid #cdbf9b;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.viewBtn {
  border: 0;
  background: transparent;
  color: #294034;
  padding: 8px 14px;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
}

.viewBtn.active {
  background: #193f30;
  color: #fff;
}

.controls {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 12px;
}

label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input,
select,
button {
  border-radius: 10px;
  border: 1px solid #b9b09d;
  background: #fff;
  font: inherit;
  padding: 10px 12px;
}

button {
  align-self: end;
  background: var(--primary);
  color: #fff;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.controlActions {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 8px;
}

.secondaryBtn {
  background: #f6f3ea;
  color: #1a3556;
  border: 1px solid #8ea2bc;
}

.secondaryBtn:hover {
  box-shadow: 0 8px 18px rgba(28, 58, 95, 0.18);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(2, 88, 58, 0.25);
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 23px;
}

.stats {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.quickLook {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.quickLook .statCard {
  border-color: #c7ad6a;
  background: linear-gradient(130deg, #fff9ea 0%, #f8ebbf 100%);
  padding: 9px 10px;
}

.quickLook .statLabel {
  font-size: 0.68rem;
}

.quickLook .statValue {
  font-size: 1.15rem;
}

.statCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.statLabel {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.statValue {
  margin: 6px 0 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.metaChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metaChip {
  background: #f3ecdd;
  border: 1px solid #dacdaf;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #394d42;
}

.metaBest {
  margin: 10px 0 0;
  color: #25332c;
  line-height: 1.35;
  font-size: 0.92rem;
  font-weight: 600;
}

.grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.hidden {
  display: none;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: fadeIn 320ms ease both;
}

.card.tier-elite {
  border-color: #d39900;
  box-shadow: 0 14px 28px rgba(156, 115, 7, 0.25);
}

.card.tier-strong {
  border-color: #2f7e50;
}

.imageWrap {
  position: relative;
  min-height: 190px;
  background: linear-gradient(140deg, #ddd5c7, #efeadb);
}

.imageWrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.dealBadge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #fef3cf;
  color: #684700;
}

.dealBadge.elite {
  background: #ffd669;
  color: #4f3400;
}

.dealBadge.strong {
  background: #d6f6dd;
  color: #104126;
}

.dealBadge.watch {
  background: #d9ecff;
  color: #153a62;
}

.dealBadge.pass {
  background: #f6d6d6;
  color: #611313;
}

.content {
  padding: 12px 14px 14px;
}

.title {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.35;
}

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

.metric {
  margin: 0;
  font-size: 0.77rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 7px;
  line-height: 1.2;
  background: #f2ead8;
  color: #33473d;
}

.seller,
.trust,
.signal,
.description,
.pricing,
.perStamp,
.arbitrage,
.metaLine {
  margin: 0 0 7px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.seller,
.trust,
.description,
.perStamp,
.metaLine {
  color: var(--muted);
}

.description {
  min-height: 36px;
}

.signal {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.signal.elite {
  color: #8a5b00;
}

.signal.strong {
  color: #13502f;
}

.signal.watch {
  color: #204972;
}

.signal.pass {
  color: #7a1d1d;
}

.cta {
  display: inline-flex;
  margin-top: 8px;
  text-decoration: none;
  color: #fff;
  background: #1f3659;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
}

.good {
  color: var(--primary);
}

.bad {
  color: var(--danger);
}

.empty {
  background: var(--panel);
  border: 1px dashed #b8ad95;
  border-radius: 14px;
  padding: 22px;
  color: var(--muted);
}

.barBoard {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.barRow {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.barHeader,
.barFooter {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.barTitle {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.barMetrics {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.barTrack {
  height: 14px;
  border-radius: 999px;
  background: #ece5d8;
  overflow: hidden;
}

.barFill {
  height: 100%;
  border-radius: 999px;
}

.barFill.elite {
  background: linear-gradient(90deg, #ffd462 0%, #ffb000 100%);
}

.barFill.strong {
  background: linear-gradient(90deg, #67d08f 0%, #2f8c55 100%);
}

.barFill.watch {
  background: linear-gradient(90deg, #78baf8 0%, #2e70b4 100%);
}

.barFill.pass {
  background: linear-gradient(90deg, #f4a6a6 0%, #be5b5b 100%);
}

.barFooter {
  color: var(--muted);
  font-size: 0.86rem;
}

.barKeyMetrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.barMetricChip {
  font-size: 0.78rem;
  font-weight: 700;
  background: #efe6d4;
  color: #32473c;
  border-radius: 999px;
  padding: 5px 10px;
}

.barCta {
  justify-self: start;
  display: inline-flex;
  text-decoration: none;
  color: #fff;
  background: #1f3659;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
}

.listView {
  margin-top: 16px;
}

.listShell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
}

.listTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
  table-layout: auto;
}

.listTable th,
.listTable td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5ddd0;
  font-size: 0.88rem;
  text-align: left;
  color: #2a3b32;
  vertical-align: top;
}

.listTable th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4eee1;
}

.listTable td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listTable tbody tr:hover {
  background: #f8f2e6;
}

.colTitle {
  max-width: none;
  min-width: 340px;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.32;
}

.listSortBtn {
  border: 0;
  background: transparent;
  color: #2f4338;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.listSortBtn.active {
  color: #1d5f42;
}

.tableLink {
  color: #20579f;
  text-decoration: none;
  font-weight: 700;
}

.colTitleWidth {
  width: 38%;
}

.colNumeric {
  width: 6%;
}

.colSeller {
  width: 8%;
}

.colCondition {
  width: 7%;
}

.colSignal {
  width: 7%;
}

.colLink {
  width: 4%;
}

@keyframes fadeIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 14px;
  }
  .viewSwitch {
    width: 100%;
    justify-content: space-between;
  }
  .viewBtn {
    flex: 1;
    text-align: center;
  }
  .controls {
    grid-template-columns: 1fr;
  }
  .itemTopStats {
    grid-template-columns: 1fr;
  }
  .checkbox {
    margin-top: 0;
  }
}
