:root {
  --ink: #1a1a1f;
  --muted: #5c5c66;
  --bg: #f6f4f1;
  --card: #ffffff;
  --border: #e2ddd6;
  --accent: #d9480f;
  --accent-hover: #b33a0a;
  --urgent: #c92a2a;
  --link: #1c4e80;
  --link-hover: #0f355a;
  --live: #2b8a3e;
  --ebay: #e53238;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.15rem;
  width: 100%;
}

main.container {
  flex: 1 0 auto;
  padding-top: 1rem;
  padding-bottom: 3rem;
}

a {
  color: var(--link);
}
a:hover {
  color: var(--link-hover);
}

.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  flex-wrap: wrap;
}

.logo a {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo a:hover {
  color: var(--accent);
}

.tagline-mobile {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 22rem;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #efeae4;
  color: var(--ink);
  border: 1px solid var(--border);
}
.pill-live {
  background: #d3f9d8;
  border-color: #8ce99a;
  color: var(--live);
}
#live-status.is-stale {
  background: #fff3bf;
  border-color: #ffd43b;
  color: #5c4800;
}
#live-status.is-error {
  background: #ffe3e3;
  border-color: #ffa8a8;
  color: var(--urgent);
}

.primary-nav {
  border-top: 1px solid var(--border);
  background: #fffaf7;
}
.nav-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  display: flex;
  gap: 0.15rem;
  white-space: nowrap;
}
.primary-nav a {
  display: block;
  padding: 0.45rem 0.65rem;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  border-radius: 6px;
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: #ffe8de;
  color: var(--accent);
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: #bbb;
}
.breadcrumbs a {
  text-decoration: none;
}

.hero,
.category-hero {
  margin: 0.5rem 0 1.5rem;
}
.hero h1,
.category-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero-lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  max-width: 42rem;
}
.hero-note {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
  max-width: 40rem;
}

.section-label {
  font-size: 1.05rem;
  margin: 0;
}

.listing-grid-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.live-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

.listing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.listing-card:hover {
  border-color: #f0b090;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.listing-card.is-urgent {
  border-color: #ffa8a8;
}
.listing-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.listing-card-media {
  aspect-ratio: 4 / 3;
  background: #f0eeea;
  overflow: hidden;
}
.listing-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.listing-card-body {
  padding: 0.55rem 0.65rem 0.7rem;
}
.listing-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.78rem;
}
.listing-card-price {
  font-weight: 800;
  color: var(--accent);
}
.listing-card-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  background: #fff3bf;
  color: #5c4800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.listing-card-time.urgent {
  background: #ffe3e3;
  color: var(--urgent);
}
.listing-card-condition {
  color: var(--muted);
}
.listing-card-opts {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.empty-state {
  padding: 1.25rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
}

.categories-section {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.section-intro {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 40rem;
}

.home-ending-soon {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.categories-section h2 {
  margin: 0 0 0.35rem;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 650;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-height: 5.5rem;
}
.category-card:hover {
  border-color: var(--accent);
  background: #fff8f4;
  color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.category-card h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.25;
}
.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 8px;
  background: #fff1e8;
  border: 1px solid #ffd8c2;
}

.sub-categories {
  margin-bottom: 1.75rem;
}
.subcategory-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.subcategory-list a,
.subcat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.subcategory-list a:hover,
.subcat-chip:hover {
  border-color: var(--accent);
  background: #fff8f4;
  color: var(--accent);
}
.subcat-chip-label {
  line-height: 1.2;
}

.prose {
  margin-top: 2rem;
  max-width: 42rem;
  color: var(--muted);
}
.prose h1,
.prose h2 {
  color: var(--ink);
}
.muted {
  color: var(--muted);
}

.site-footer {
  background: var(--ink);
  color: #c5c5cc;
  padding: 1.75rem 0 2rem;
  margin-top: auto;
  font-size: 0.88rem;
}
.site-footer a {
  color: #fff;
}
.footer-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0;
  margin: 0 0 1rem;
}
.footer-nav a {
  text-decoration: none;
  font-weight: 600;
}
.disclosure-blurb {
  max-width: 40rem;
  line-height: 1.5;
}
.copyright {
  margin: 0.75rem 0 0;
  opacity: 0.75;
}

code {
  font-size: 0.88em;
  background: #efeae4;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

@media (max-width: 560px) {
  .listing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }
  .tagline-mobile {
    display: none;
  }
}
