:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --panel-2: #f0f2ee;
  --ink: #171a16;
  --muted: #60675e;
  --faint: #8a9187;
  --line: #d8ddd4;
  --line-strong: #b9c0b5;
  --good-bg: #e2f0e7;
  --good: #16613d;
  --warn-bg: #fbecd3;
  --warn: #77520f;
  --bad-bg: #f3dedb;
  --bad: #8e2a20;
  --info-bg: #e1ebef;
  --info: #265c72;
  --accent: #1f4f41;
}

* {
  box-sizing: border-box;
}

html {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.96);
  padding: 18px 28px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
}

.status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.status span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 6px 9px;
}

main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px 22px 42px;
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) 190px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.segments {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 4px;
}

.seg {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 0 11px;
}

.seg.active {
  background: var(--ink);
  color: #fff;
}

.search,
.sorter {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 10px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 79, 65, 0.22);
  outline-offset: 2px;
}

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

.criteria div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.criteria b {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  text-transform: uppercase;
}

.criteria span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.runs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}

.run {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  padding: 5px 8px;
}

.date-heading {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.listings {
  display: grid;
  gap: 9px;
}

.listing {
  display: grid;
  grid-template-columns: 42px 160px minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.star {
  align-self: start;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--faint);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.star.starred {
  border-color: #c49a27;
  background: #fff3c4;
  color: #7c5900;
}

.photo {
  display: block;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  background-position: center;
  background-size: cover;
}

.titleline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.22;
}

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

.price {
  flex: 0 0 auto;
  font-size: 21px;
  font-weight: 900;
  white-space: nowrap;
}

.facts,
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.facts {
  margin-top: 10px;
}

.fact,
.badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 8px;
}

.fact {
  background: var(--panel-2);
  color: #363b34;
}

.issues {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.issues ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.issues strong {
  color: var(--ink);
}

.verdict {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.score {
  color: var(--ink);
  font-weight: 900;
}

.badges {
  justify-content: flex-end;
}

.badge.good {
  background: var(--good-bg);
  color: var(--good);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.badge.info {
  background: var(--info-bg);
  color: var(--info);
}

.open {
  margin-top: auto;
  min-width: 96px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  padding: 8px 12px;
  text-align: center;
  text-decoration: none;
}

.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

@media (max-width: 980px) {
  .topbar,
  .titleline {
    display: block;
  }

  .status {
    justify-content: flex-start;
    margin-top: 10px;
  }

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

  .segments {
    width: 100%;
    overflow-x: auto;
  }

  .listing {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .photo,
  .details,
  .verdict {
    grid-column: 2;
  }

  .verdict,
  .badges {
    align-items: flex-start;
    justify-content: flex-start;
  }
}
