:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2522;
  --muted: #8a7f78;
  --line: #ebe4da;
  --accent: #b5654a;
  --chip: #f1ebe2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1816;
    --card: #25211e;
    --ink: #f1ebe4;
    --muted: #a39890;
    --line: #3a332e;
    --accent: #e08d6f;
    --chip: #2f2925;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 24px 16px 64px;
  max-width: 1200px;
  margin-inline: auto;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 Inter, system-ui, sans-serif;
}
.muted { color: var(--muted); }

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}
h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-size: 34px;
  margin: 0;
}
.title p { margin: 2px 0 0; }
.people {
  display: inline-flex;
  gap: 2px;
  margin-top: 8px;
  padding: 3px;
  border-radius: 999px;
  background: var(--chip);
}
.people button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.people button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.people[hidden] { display: none; }
#search {
  flex: 1 1 260px;
  max-width: 360px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chips button {
  flex: none;
  border: 0;
  background: var(--chip);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-transform: capitalize;
}
.chips button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.chips .n { opacity: .65; margin-left: 4px; }

.toolbar {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 14px 0 20px;
  color: var(--muted);
  font-size: 14px;
}
.toolbar select {
  margin-left: 6px;
  font: inherit;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.check { display: flex; gap: 6px; align-items: center; cursor: pointer; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgb(0 0 0 / .08); }
.open {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .9);
  color: #5a4f49;
  box-shadow: 0 1px 4px rgb(0 0 0 / .15);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s;
}
.card:hover .delete, .delete:focus-visible { opacity: 1; }
.delete:hover { color: #c0392b; }
.delete:disabled { opacity: .5; cursor: default; }
@media (hover: none) { .delete { opacity: 1; } }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 6px 18px rgb(0 0 0 / .2);
  z-index: 10;
}
.card.returned { opacity: .45; }
.thumb {
  aspect-ratio: 3 / 4;
  background: var(--chip);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta { padding: 10px 12px 12px; }
.brand { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.name { font-weight: 500; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.empty { text-align: center; color: var(--muted); margin-top: 48px; }
.outfit { grid-template-columns: repeat(auto-fit, minmax(200px, 260px)); }
.outfit .card { display: block; color: inherit; text-decoration: none; }

dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(760px, calc(100vw - 32px));
  background: var(--card);
  color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / .45); }
.close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: var(--chip);
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}
.detail { display: grid; grid-template-columns: 1fr 1fr; }
.detail .thumb { aspect-ratio: auto; min-height: 320px; }
.detail .info { padding: 28px 24px; }
.detail h2 { font-family: Fraunces, Georgia, serif; font-weight: 500; margin: 4px 0 16px; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 20px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
}
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-quiet {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.btn-quiet:hover { color: #c0392b; border-color: #c0392b; }
.btn-quiet:disabled { opacity: .5; cursor: default; }
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .detail { grid-template-columns: 1fr; }
  .detail .thumb { min-height: 260px; }
}
