.swipe {
  --bg: #f4f4f5;
  --card: #ffffff;
  --text: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --ignore: #dc2626;
  --keep: #16a34a;
  --fav: #d97706;
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
}

@media (prefers-color-scheme: dark) {
  .swipe {
    --bg: #09090b;
    --card: #18181b;
    --text: #fafafa;
    --muted: #a1a1aa;
    --line: #27272a;
  }
}

.swipe a { color: inherit; }

.swipe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  font-size: 14px;
  color: var(--muted);
}

.swipe-header form { flex: 1; }

.swipe-header select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}

.swipe-deck {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.swipe-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease, opacity 0.25s ease;
  user-select: none;
  cursor: grab;
}

.swipe-card:not(.gone) ~ .swipe-card:not(.gone) { transform: scale(0.96) translateY(10px); }
.swipe-card:not(.gone) ~ .swipe-card:not(.gone) ~ .swipe-card:not(.gone) { visibility: hidden; }
.swipe-card.dragging { transition: none; cursor: grabbing; }
.swipe-card.gone { opacity: 0; pointer-events: none; }
.swipe-card.gone.ignored { transform: translateX(-130%) rotate(-12deg); }
.swipe-card.gone.kept { transform: translateX(130%) rotate(12deg); }
.swipe-card.gone.faved { transform: translateY(-130%); }
.swipe-card[data-leaning="faved"] { box-shadow: 0 0 0 4px var(--fav); }
.swipe-card[data-leaning="ignored"] { box-shadow: 0 0 0 4px var(--ignore); }
.swipe-card[data-leaning="kept"] { box-shadow: 0 0 0 4px var(--keep); }

.swipe-card img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  background: #ffffff;
}

.swipe-card-info { padding: 12px 14px 14px; }
.swipe-card-deal { display: flex; align-items: baseline; gap: 8px; }
.swipe-card-deal strong { font-size: 22px; }
.swipe-card-deal s { color: var(--muted); }
.swipe-card-deal span { margin-left: auto; font-weight: 600; color: var(--keep); }
.swipe-card-name { margin-top: 2px; font-weight: 500; }
.swipe-card-meta { margin-top: 4px; font-size: 13px; color: var(--muted); }
.swipe-card-meta a { margin-left: 6px; }

.swipe-empty {
  display: none;
  position: absolute;
  inset: 0;
  margin: 0;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.swipe-deck.empty .swipe-empty { display: grid; }

.swipe-buttons {
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.swipe-buttons button {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.swipe-buttons [data-swipe="ignored"] { color: var(--ignore); }
.swipe-buttons [data-swipe="kept"] { color: var(--keep); }
.swipe-buttons [data-fav] { color: var(--fav); }

.swipe-hotlist-open {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--fav);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.swipe-hotlist {
  width: min(480px, calc(100vw - 32px));
  max-height: 85vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
}

.swipe-hotlist::backdrop { background: rgba(0, 0, 0, 0.6); }

.swipe-hotlist header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.swipe-hotlist button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.swipe-hotlist-note { margin: 8px 14px 0; font-size: 12px; color: var(--muted); }
.swipe-hotlist ul { list-style: none; margin: 0; padding: 4px 14px 14px; }
.swipe-hotlist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.swipe-hotlist li img { width: 48px; height: 72px; object-fit: contain; background: #ffffff; border-radius: 6px; flex: none; }
.swipe-hotlist li div { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.swipe-hotlist li a { display: block; color: var(--text); font-weight: 500; }
.swipe-hotlist-empty { display: none; margin: 14px; color: var(--muted); }
.swipe-hotlist.empty .swipe-hotlist-empty { display: block; }
.swipe-help { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
