.list { padding: 4px 12px 16px; }
.page { display: flow-root; }
.sentinel { height: 1px; }

.card {
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.card.inactive .carousel { filter: grayscale(.8); opacity: .65; }
.card-photo { position: relative; aspect-ratio: 3 / 2; }

.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--fill);
}

.track {
  display: flex;
  touch-action: manipulation;
  height: 100%;
  overflow: auto hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.track::-webkit-scrollbar { display: none; }

.slide {
  position: relative;
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  color: var(--muted);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .2s;
}

.slide.loaded img { opacity: 1; }

.slide.broken .icon,
.no-photo .icon { width: 38px; height: 38px; opacity: .6; }

.no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.counter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.arrow { display: none; }

@media (hover: hover) and (pointer: fine) {
  .arrow {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    opacity: 0;
    transition: opacity .15s;
  }

  .arrow-back { left: 8px; }
  .arrow-next { right: 8px; }
  .carousel:hover .arrow { opacity: 1; }
}

.badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: calc(100% - 70px);
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border-radius: 9px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.badge .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.badge.new { background: #1976d9; }
.badge.drop { background: #178a48; }
.badge.gone { background: rgba(30, 30, 34, .82); }
.badge.over { background: #b96a00; }

.icon-button.on-photo {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 52px;
  height: 52px;
  background: rgba(20, 20, 24, .38);
  color: #fff;
}

.on-photo .icon { width: 30px; height: 30px; }
.on-photo.on { background: rgba(255, 255, 255, .94); color: #f0435c; }

.like-burst {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f0435c;
  pointer-events: none;
  animation: burst .85s ease-out forwards;
}

.like-burst .icon { width: 120px; height: 120px; fill: currentColor; stroke: #fff; stroke-width: .7; }

.since-like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
}

.since-like .icon { width: 12px; height: 12px; fill: currentColor; }
.since-like.fell { background: var(--yes-bg); color: var(--yes); }
.since-like.rose { background: var(--no-bg); color: var(--no); }

.card-body { padding: 12px 14px; cursor: pointer; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-top .dislike { margin: -8px -10px -6px 0; }
.card-top .dislike .icon { width: 21px; height: 21px; }

.price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
}

.price strong { font-size: 23px; font-weight: 750; letter-spacing: -.3px; white-space: nowrap; }
.price s { color: var(--muted); font-size: 14px; white-space: nowrap; }
.price span { color: var(--muted); font-size: 14px; white-space: nowrap; }

.card-summary { margin-top: 5px; font-size: 16px; font-weight: 550; overflow-wrap: anywhere; }
.address { margin-top: 2px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

.card-body > .address {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metro-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  min-width: 0;
  font-size: 14px;
}

.metro-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #d8343f;
  color: #fff;
}

.metro-mark .icon { width: 13px; height: 13px; }
.metro-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metro-time { flex: none; color: var(--muted); }

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

.wish {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  padding: 7px 2px 6px;
  border-radius: 11px;
  text-align: center;
}

.wish-label {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wish-state {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.wish-state .icon { width: 13px; height: 13px; stroke-width: 3; }

.yes { --state: var(--yes); --state-bg: var(--yes-bg); }
.no { --state: var(--no); --state-bg: var(--no-bg); }
.maybe { --state: var(--maybe); --state-bg: var(--maybe-bg); }
.unknown { --state: var(--muted); --state-bg: var(--fill); }

.wish,
.state-icon { background: var(--state-bg); color: var(--state); }

.wish.unknown .wish-label { color: var(--muted); }

@media (max-width: 359px) {
  .wish { padding-left: 1px; padding-right: 1px; }
  .wish-label { font-size: 11px; }
  .wish-state { gap: 1px; font-size: 10px; letter-spacing: -.2px; }
  .wish-state .icon { width: 10px; height: 10px; }
}
.wish.unknown .wish-state { font-weight: 500; }

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.list-end { padding: 10px; color: var(--muted); font-size: 13px; text-align: center; }

.card.skeleton .bone-photo { aspect-ratio: 3 / 2; border-radius: 0; }
.bone-price { width: 42%; height: 26px; }
.bone-line { width: 75%; height: 16px; margin-top: 10px; }
.bone-short { width: 55%; height: 14px; margin-top: 8px; }
.bone-chip { height: 42px; }

/* Filters */

.sheet-header {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 6px 16px;
  cursor: grab;
  touch-action: none;
}

.sheet-header h2 { font-size: 20px; }

.grabber {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 38px;
  height: 5px;
  margin-left: -19px;
  border-radius: 3px;
  background: var(--line);
}

.sheet-body {
  flex: 1;
  min-height: 0;
  padding: 2px 12px 12px;
  overflow: hidden auto;
  overscroll-behavior: contain;
}

.filter-section {
  margin-bottom: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--surface);
}

.filter-section h3 { margin-bottom: 10px; font-size: 16px; }
.section-note { margin-bottom: 8px; color: var(--muted); font-size: 13px; }

.choices { display: flex; flex-wrap: wrap; gap: 7px; }
.choices.even { flex-wrap: nowrap; }
.choices.even .choice { flex: 1 1 auto; min-width: 0; padding-left: 4px; padding-right: 4px; }

.number-pair { display: flex; gap: 8px; }

.number-box {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--fill);
}

.number-box small,
.number-box > span { flex: none; color: var(--muted); font-size: 14px; }

.number-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
}

.number-box input::placeholder { color: var(--muted); font-weight: 400; }
.number-box:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.slider { width: 100%; margin: 14px 0 10px; accent-color: var(--accent); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 6px 0;
  font-size: 15px;
}

.toggle-row + .toggle-row { border-top: 1px solid var(--line); }
.choices + .toggle-row { margin-top: 8px; }
.toggle-row small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }

.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 29px;
  margin: 0;
  border-radius: 15px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background .18s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .18s;
}

.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(19px); }

.picker { margin-top: 10px; border-top: 1px solid var(--line); }

.picker summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  font-size: 15px;
  list-style: none;
  cursor: pointer;
}

.picker summary::-webkit-details-marker { display: none; }

.picker-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker summary .icon { width: 16px; height: 16px; color: var(--muted); transition: transform .18s; }
.picker[open] summary .icon { transform: rotate(90deg); }

.sheet-footer {
  display: flex;
  flex: none;
  gap: 8px;
  padding: 10px 12px calc(var(--safe-bottom) + 10px);
  background: var(--bar);
  border-top: 1px solid var(--line);
}

.sheet-footer .primary { flex: 1; min-width: 0; padding: 0 8px; white-space: nowrap; }
