/* Claudeslist v0 — light + blue. */

:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-tint: #eff6ff;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #15803d;
  --success-soft: #dcfce7;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 18px rgba(37, 99, 235, 0.08);
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Top bar */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.nav { display: flex; gap: 6px; }
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
}
.nav-link:hover { background: var(--accent-tint); color: var(--accent); text-decoration: none; }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent-hover); }

/* Main */

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

.page { display: flex; flex-direction: column; gap: 20px; }

/* Browse tabs (All listings / Your listings) */

.browse-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.browse-tab {
  padding: 10px 16px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  margin-bottom: -1px;
}
.browse-tab:hover { color: var(--accent-hover); }
.browse-tab.is-active {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* Callout (e.g. "Matches for your want") */

.callout {
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.callout-title {
  font-weight: 600;
  color: var(--accent-hover);
  margin-bottom: 2px;
}
.callout-meta { color: var(--muted); font-size: 14px; }

/* Filter bar */

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}
.filter-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}
.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-search { flex: 2 1 240px; }
.filter-category { flex: 1 1 140px; }
.filter-price { width: 120px; }
.filter-sort { width: 160px; }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  background: var(--surface);
  color: var(--text);
}
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}
.btn-link {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 9px 8px;
  font-size: 13px;
  text-decoration: underline;
}
.btn-link:hover { color: var(--accent); }

/* Card grid */

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
a.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-soft);
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
}
.card-thumb-link { display: block; color: inherit; }

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}
.card-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-price {
  font-weight: 600;
  color: var(--accent-hover);
  white-space: nowrap;
}
.card-meta { color: var(--muted); font-size: 13px; }
.card-seller { color: var(--muted); font-size: 12px; }
.card-note {
  background: var(--accent-tint);
  border-left: 3px solid var(--accent);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  border-radius: 0 6px 6px 0;
  margin-top: 4px;
}
.card-action-row {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
}

/* "Save for JC?" save toggle — pill on browse cards, primary CTA on detail */

.ask-jc-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: transform 80ms ease, background 120ms ease, color 120ms ease;
}
.ask-jc-btn:hover { transform: scale(1.04); }
.ask-jc-btn:disabled { opacity: 0.6; cursor: progress; }
.ask-jc-btn.is-saved {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ask-jc-btn.is-readonly { cursor: default; }
.ask-jc-btn.is-readonly:hover { transform: none; }
.ask-jc-icon { font-size: 13px; line-height: 1; }
.ask-jc-label-saved { display: none; }
.ask-jc-btn.is-saved .ask-jc-label-default { display: none; }
.ask-jc-btn.is-saved .ask-jc-label-saved { display: inline; }

.ask-jc-btn-detail {
  position: static;
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 15px;
  margin-top: 16px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.ask-jc-btn-detail:hover { transform: none; filter: brightness(1.05); }
.ask-jc-btn-detail.is-saved {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.ask-jc-btn-detail .ask-jc-icon { font-size: 17px; }

/* Passive bubble shown on the listing detail when an inquiry is already
   active in Telegram. Replaces the save pill — no action surface, just a
   reminder so the user doesn't try to re-save. */
.inquiry-bubble {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* Detail page pill action area */
.detail-status-pill {
  margin-top: 16px;
  text-align: center;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 15px;
}
.detail-saved-meta {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.detail-action-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.detail-pill {
  flex: 1;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 120ms ease;
  text-align: center;
}
.detail-pill:hover { filter: brightness(0.95); }
.detail-pill-save {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.detail-pill-save:hover { filter: brightness(1.08); }
.detail-pill-hide {
  background: var(--surface);
  color: var(--text);
}
.detail-pill-unsave {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-soft);
}

/* "Inquired" pill on browse card thumbs */
.inquired-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}
.inquired-pill.is-static { position: static; }

/* Bundle pill — count + optional saved indicator on a multilist bundle card.
   Sits where the save toggle would be on a single-listing card. */
.batch-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.batch-pill.is-saved {
  background: var(--accent);
  color: #fff;
}
.batch-pill-icon { font-size: 13px; line-height: 1; }

/* Batch detail page — shared photo header above a list of per-item rows. */
.batch-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 1fr);
  gap: 24px;
  margin-bottom: 20px;
}
@media (max-width: 720px) {
  .batch-header { grid-template-columns: 1fr; }
}
.batch-hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.batch-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.batch-meta { align-self: center; }
.batch-help {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.batch-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.batch-item-link {
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.batch-item-link:hover .card-title { color: var(--accent); }
.batch-item-body { display: block; }
.batch-item-action { flex: none; }

/* Inline variant of the save toggle for batch rows — strips the absolute
   positioning the grid card uses. */
.ask-jc-btn-inline { position: static; }

.actions-secondary {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

/* Empty states */

.empty {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-small { padding: 24px; font-size: 14px; }

/* Group sections (saved page) */

.group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}
.group + .group {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.group-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.group-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.group-count {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 12px;
  font-weight: 600;
}
.group-hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 8px;
}

/* Prose / legal pages */

.prose-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 0 64px;
}
.prose-page h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
}
.prose-page .prose-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}
.prose-page h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 8px;
}
.prose-page p, .prose-page li {
  color: var(--text);
  line-height: 1.65;
  margin: 0 0 10px;
}
.prose-page ul {
  padding-left: 22px;
  margin: 0 0 10px;
}
.prose-page a { color: var(--accent); }

.consent-box {
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 24px 0;
}
.consent-box p { margin: 0; }

.prose-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

/* Listing detail */

.back {
  display: inline-block;
  color: var(--muted);
  font-size: 14px;
}
.back:hover { color: var(--accent); }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 24px;
}

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

.gallery {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 80vh;
  overflow-y: auto;
}
.gallery img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}
.gallery-empty {
  padding: 64px;
  text-align: center;
  color: var(--muted);
}

.detail-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
  position: sticky;
  top: 80px;
}
.detail-title { margin: 0; font-size: 22px; line-height: 1.3; }
.detail-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-hover);
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}
.detail-meta span:not(:last-child)::after { content: " · "; }
.detail-seller { color: var(--muted); font-size: 14px; }

.status-pill {
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
}
.status-inquire { background: var(--accent-soft); color: var(--accent-hover); }
.status-saved   { background: var(--success-soft); color: var(--success); }
.status-hidden  { background: var(--danger-soft); color: var(--danger); }

/* Per-item status badge on /saved card thumbs (top-left corner) */
.status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.status-badge-saved { background: var(--accent-soft); color: var(--accent-hover); }


.detail-description {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.detail-description h2 {
  margin-top: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detail-description p {
  white-space: pre-wrap;
  margin: 0;
}

/* Landing page */

.landing-hero {
  text-align: center;
  padding: 64px 16px 48px;
  max-width: 600px;
  margin: 0 auto;
}
.landing-headline {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
}
.landing-sub {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 32px;
}
.landing-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.landing-btn { padding: 12px 28px; font-size: 16px; border-radius: 999px; }

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 0 64px;
}
.landing-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.landing-feature-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-radius: 10px;
  font-weight: 700;
  font-size: 20px;
}
.landing-feature h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}
.landing-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.landing-footer {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 480px) {
  .landing-headline { font-size: 28px; }
  .landing-hero { padding: 40px 16px 32px; }
}
