/* WearPair — navy, camel and cream from the logo; Outfit for type.
   The outfit board is the hero: pieces laid out like a flat-lay on light paper. */

:root {
  --bg: #faf7f2;
  --paper: #ffffff;
  --field: #f3eee7;
  --board: #fdfbf8;
  --ink: #12202e;
  --ink-2: #56606c;
  --ink-3: #8c939c;
  --line: #e7e0d6;
  --camel: #8a5d2e;
  --camel-2: #c4996a;
  --camel-tint: #f2e7d9;
  --danger: #b23a2e;
  --btn-bg: var(--ink);
  --btn-fg: #faf7f2;
  --focus: var(--camel);
  --overlay: rgba(14, 24, 36, 0.42);
  --shadow-photo: 0 1px 2px rgba(18, 32, 46, 0.08), 0 6px 16px rgba(18, 32, 46, 0.1);

  --font: 'Outfit', 'Avenir Next', system-ui, -apple-system, sans-serif;
  --gutter: 16px;
  --max: 560px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: 62px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1824;
    --paper: #16222f;
    --field: #1d2b3a;
    --board: #f4efe8;
    --ink: #f3eee6;
    --ink-2: #b5bbc3;
    --ink-3: #7e8792;
    --line: #283646;
    --camel: #d6a874;
    --camel-2: #c99a66;
    --camel-tint: #33281d;
    --danger: #ec7d70;
    --btn-bg: #f3eee6;
    --btn-fg: #12202e;
    --overlay: rgba(3, 7, 12, 0.62);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
html.sheet-lock,
html.sheet-lock body {
  overflow: hidden;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
}
img {
  display: block;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- type ---------- */

.page-title {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.section-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.muted {
  color: var(--ink-2);
}
.small {
  font-size: 14px;
}

/* ---------- layout ---------- */

.view {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--safe-top) + 14px) var(--gutter) calc(var(--tabbar) + var(--safe-bottom) + 40px);
}
.page-head {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.page-head.with-action {
  grid-template-columns: 1fr auto;
  align-items: start;
}
.page-head .muted {
  margin-top: 4px;
}
.stack {
  display: grid;
  gap: 16px;
}
.stack-sm {
  display: grid;
  gap: 10px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px calc(var(--safe-bottom) + 6px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  flex: 0 1 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 50px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
}
.tab.on {
  color: var(--ink);
}
.tab.on::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--camel);
}
.icon {
  display: inline-flex;
  line-height: 0;
}
.icon.sm svg {
  width: 18px;
  height: 18px;
}
.icon.xl svg {
  width: 44px;
  height: 44px;
}

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  transition: transform 0.12s ease;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn.primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.btn.secondary {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn.ghost {
  padding: 0 10px;
}
.btn.danger {
  color: var(--danger);
}
.btn.danger:not(.ghost) {
  background: var(--danger);
  color: #fff;
}
.btn.small {
  min-height: 38px;
  padding: 0 13px;
  font-size: 14px;
  border-radius: 11px;
}
.btn.full {
  width: 100%;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  padding: 6px 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--camel);
  text-decoration: none;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink-2);
  flex: none;
}
.icon-btn:active {
  background: var(--field);
}

.chips {
  display: flex;
  gap: 8px;
}
.chips.wrap {
  flex-wrap: wrap;
}
.chips.scroll {
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter);
}
.chips.scroll::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.chip.small {
  height: 34px;
  padding: 0 12px;
  font-size: 14px;
}
.chip.on {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
.chip.static {
  cursor: default;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
textarea.input {
  resize: vertical;
  line-height: 1.45;
}
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238c939c' stroke-width='1.8'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.sheet .input {
  background-color: var(--field);
  border-color: transparent;
}
.input::placeholder {
  color: var(--ink-3);
}
.field {
  display: grid;
  gap: 7px;
}
.field-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.field-label strong {
  color: var(--ink);
  font-weight: 600;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.seg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.seg.auto {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}
.seg button {
  min-height: 42px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--field);
  font-weight: 500;
  font-size: 14.5px;
}
.seg button.on {
  background: var(--ink);
  color: var(--bg);
}
.toggle-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.toggle-label {
  display: block;
  font-weight: 500;
}
.toggle-row small {
  display: block;
  color: var(--ink-2);
  font-size: 13.5px;
}
.switch {
  position: relative;
  width: 50px;
  height: 30px;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.knob {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  background: var(--line);
  transition: background 0.2s ease;
  pointer-events: none;
}
.knob::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.switch input:checked + .knob {
  background: var(--camel);
}
.switch input:checked + .knob::after {
  transform: translateX(20px);
}
.switch input:focus-visible + .knob {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(18, 32, 46, 0.18);
}
.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.color-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 7px;
  border-radius: 999px;
  background: var(--field);
  font-size: 14px;
}
.color-pick summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--camel);
  padding: 4px 0;
}
.color-pick .chips {
  margin-top: 8px;
}
.notice {
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--camel-tint);
  color: var(--ink);
  font-size: 14px;
}

/* ---------- today ---------- */

.today-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wordmark {
  height: 30px;
  width: auto;
}
.date-line {
  font-size: 15px;
  color: var(--ink-2);
}
.wx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  font-weight: 500;
}
.wx-temp {
  font-size: 18px;
  font-weight: 600;
}
.wx-range {
  color: var(--ink-2);
}
.ask {
  display: grid;
  gap: 10px;
}
.input.note {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 16px;
}
.ask-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ask .link-btn {
  justify-self: center;
}

.results {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}
.results-head {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
}
.results-note {
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
}
.day-note {
  font-size: 15px;
}
.empty-hint {
  margin-top: 28px;
  color: var(--ink-2);
  max-width: 36ch;
}

.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter) 6px;
  overscroll-behavior-x: contain;
}
.carousel::-webkit-scrollbar {
  display: none;
}
.slide {
  flex: 0 0 calc(100% - 36px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--paper);
  border-radius: 26px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.slide.reveal {
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 80ms);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}
.slide-meta {
  display: grid;
  gap: 10px;
  padding: 12px 6px 4px;
}
.look-name {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.look-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vote {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
}
.vote.on {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
.vote.up.on {
  background: var(--camel);
  color: #fff;
}
.btn.wear {
  margin-left: auto;
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.btn.wear.on {
  background: var(--camel);
  color: #fff;
}
.reasons {
  display: grid;
  gap: 8px;
}
.reasons p {
  font-size: 14px;
  color: var(--ink-2);
}
details.why summary {
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--camel);
}
details.why summary::-webkit-details-marker {
  display: none;
}
details.why summary::after {
  content: ' +';
}
details.why[open] summary::after {
  content: ' −';
}
details.why p {
  margin-top: 8px;
  font-size: 15px;
}
details.why .tip {
  color: var(--ink-2);
  padding-left: 11px;
  border-left: 3px solid var(--camel-2);
}
.dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}
.dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.2s ease, transform 0.2s ease;
}
.dots span.on {
  background: var(--ink);
  transform: scale(1.15);
}

.wearing {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.wearing h2 {
  font-size: 17px;
  font-weight: 600;
}
.wearing .link-btn {
  padding-bottom: 0;
}

/* ---------- the outfit board ---------- */

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, 1fr);
  gap: 6px;
  aspect-ratio: 4 / 5;
  padding: 12px;
  border-radius: 18px;
  background: var(--board);
  overflow: hidden;
}
.piece {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 2px;
}
.piece img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.piece.clean img {
  mix-blend-mode: multiply;
}
.piece.photo img {
  border-radius: 10px;
  box-shadow: var(--shadow-photo);
}
button.piece:active img {
  transform: scale(0.97);
}
.board-add {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #12202e;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(18, 32, 46, 0.15);
}
.board.mini {
  gap: 2px;
  padding: 5px;
  border-radius: 12px;
}
.board.mini .piece {
  padding: 0;
}
.board.mini .piece.photo img {
  border-radius: 3px;
  box-shadow: none;
}
.board.skeleton {
  animation: pulse 1.4s ease-in-out infinite;
  background: var(--field);
}
@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}

/* ---------- setup ---------- */

.setup {
  margin-top: 26px;
  display: grid;
  gap: 16px;
}
.setup-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
  counter-reset: step;
}
.setup-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  counter-increment: step;
}
.setup-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 600;
}
.setup-mark:empty::before {
  content: counter(step);
}
.setup-list li.done .setup-mark {
  background: var(--camel);
  color: #fff;
  box-shadow: none;
}
.setup-list li.done h3 {
  color: var(--ink-2);
}
.setup-list h3 {
  font-size: 17px;
  font-weight: 600;
  padding-top: 5px;
}
.setup-list p {
  font-size: 14.5px;
  margin: 3px 0 10px;
}
.setup-list li.done p {
  margin-bottom: 0;
}

/* ---------- closet ---------- */

.meter {
  display: grid;
  gap: 6px;
}
.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--field);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: var(--camel-2);
  transition: width 0.3s ease;
}
.group {
  margin-top: 20px;
}
.group-head {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}
.group-head .count {
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 7px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--board);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile.clean img {
  object-fit: contain;
  padding: 8%;
  mix-blend-mode: multiply;
}
.tile.away img {
  opacity: 0.4;
}
.tile.picked {
  box-shadow: inset 0 0 0 3px var(--camel);
}
.tile-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(18, 32, 46, 0.82);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
}
.tile-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--camel);
  color: #fff;
}
.tile-check svg {
  width: 16px;
  height: 16px;
}
.tile-flag {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--camel-2);
  box-shadow: 0 0 0 2px var(--board);
}
.pick-group {
  display: grid;
  gap: 2px;
}
.grid.looks {
  grid-template-columns: repeat(4, 1fr);
}
.look-thumb {
  position: relative;
}
.grid.looks .tile {
  aspect-ratio: 3 / 4;
}
.fav {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
.fav svg {
  width: 19px;
  height: 19px;
}
.fav.on {
  color: var(--camel-2);
}
.empty {
  margin-top: 20px;
  padding: 22px 18px;
  border-radius: 22px;
  background: var(--paper);
  display: grid;
  gap: 12px;
  justify-items: start;
}
.fab {
  position: fixed;
  z-index: 15;
  right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  bottom: calc(var(--tabbar) + var(--safe-bottom) + 18px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 54px;
  padding: 0 20px 0 15px;
  border-radius: 27px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(18, 32, 46, 0.28);
}
.queue {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: var(--paper);
  display: grid;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}
.queue .small {
  font-weight: 400;
}

/* ---------- style ---------- */

.profile {
  padding: 20px 18px;
  border-radius: 24px;
  background: var(--paper);
  display: grid;
  gap: 12px;
}
.palette {
  display: flex;
  padding-left: 6px;
}
.palette-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-left: -6px;
  box-shadow: 0 0 0 3px var(--paper), inset 0 0 0 1px rgba(18, 32, 46, 0.12);
}
.palette.avoid .palette-dot {
  width: 26px;
  height: 26px;
  opacity: 0.85;
}
.profile-headline {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
}
.profile-sig {
  font-size: 15.5px;
  padding-left: 11px;
  border-left: 3px solid var(--camel-2);
}
.profile-bullets {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  font-size: 15px;
}
.profile .why .field {
  margin-top: 10px;
}
.profile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.empty-profile {
  justify-items: start;
}
.block {
  margin-top: 26px;
  display: grid;
  gap: 10px;
}
.block > .btn,
.block > .row-actions .btn {
  justify-self: start;
}
.block-head {
  font-size: 18px;
  font-weight: 600;
}
.block-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stat {
  color: var(--ink-2);
  font-size: 14px;
}
.stat strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
}
.strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter);
}
.strip::-webkit-scrollbar {
  display: none;
}
.strip-item {
  flex: 0 0 92px;
  display: grid;
  gap: 5px;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-2);
}
.strip-item img {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--board);
}
.strip-item.clean img {
  object-fit: contain;
  padding: 8px;
  mix-blend-mode: multiply;
}
.gaps-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
}
.gaps-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--camel-tint);
  color: var(--camel);
}
.gaps-text {
  display: grid;
  gap: 2px;
}
.gaps-text strong {
  font-weight: 600;
}
.gaps-text small {
  color: var(--ink-2);
  font-size: 13.5px;
}
.gaps-swatches {
  display: flex;
}
.gaps-swatches span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-left: -5px;
  box-shadow: 0 0 0 2px var(--paper);
}
.pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pair {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.mini-tile {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--board);
}
.mini-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-tile.clean img {
  object-fit: contain;
  padding: 4px;
  mix-blend-mode: multiply;
}
.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 15px;
}
.facts dt {
  color: var(--ink-2);
  font-size: 14px;
}
.facts dd {
  margin: 0;
}

/* ---------- wardrobe gaps ---------- */

.gap-hero,
.scan-hero {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--camel-tint);
  color: var(--camel);
}
.gap-summary {
  font-size: 17px;
  font-weight: 500;
}
.gap {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  padding: 12px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.sheet .gap {
  background: var(--bg);
  box-shadow: none;
}
.gap-visual {
  width: 104px;
  height: 130px;
  border-radius: 14px;
  overflow: hidden;
}
.gap-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}
.gap-body {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}
.gap-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.gap-head h3 {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.2;
}
.unlock {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--camel-tint);
  color: var(--camel);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.gap-pairs {
  display: flex;
  gap: 4px;
}
.gap-pairs .mini-tile {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}
.picks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.picks a {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--paper);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
.pick-name {
  font-weight: 600;
  font-size: 14.5px;
}
.pick-meta {
  font-size: 13px;
  color: var(--camel);
}
.pick-note {
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- scanning ---------- */

.cand-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.cand {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.cand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cand.on {
  box-shadow: inset 0 0 0 3px var(--camel);
}
.cand-src {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(18, 32, 46, 0.75);
  color: #fff;
  font-size: 11px;
}
.busy {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 50px 10px;
  text-align: center;
  color: var(--ink-2);
}
.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--camel);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- sheets ---------- */

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--overlay);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.sheet-overlay.open {
  opacity: 1;
}
.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100%, var(--max));
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  transform: translate(-50%, 100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet.tall {
  height: 90dvh;
}
.sheet-overlay.open .sheet {
  transform: translate(-50%, 0);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 8px 6px 18px;
}
.sheet-head h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 18px calc(var(--safe-bottom) + 24px);
}
.add-options {
  display: grid;
  gap: 8px;
}
.add-opt {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--field);
  text-align: left;
  font-weight: 500;
}
.add-opt small {
  grid-column: 2;
  color: var(--ink-2);
  font-size: 13.5px;
}
.swap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.swap-opt {
  display: grid;
  gap: 5px;
  align-content: start;
  text-align: left;
}
.swap-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--board);
}
.swap-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.swap-img.clean img {
  object-fit: contain;
  padding: 8%;
  mix-blend-mode: multiply;
}
.swap-img.none {
  padding: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.swap-opt.current .swap-img {
  box-shadow: 0 0 0 3px var(--camel);
}
.swap-opt.rested .swap-img img {
  opacity: 0.4;
}
.swap-name {
  font-size: 13px;
  line-height: 1.25;
}
.swap-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.swap-tag.good {
  color: var(--camel);
}
.item-photo {
  border-radius: 18px;
  background: var(--board);
  overflow: hidden;
}
.item-photo img {
  width: 100%;
  max-height: 42dvh;
  object-fit: contain;
}
.item-photo.clean img {
  mix-blend-mode: multiply;
  padding: 12px;
}
.item-photo.tall img {
  max-height: 55dvh;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.list-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--field);
}
.settings .block {
  margin-top: 6px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.settings .block:last-child {
  border-bottom: 0;
}

/* ---------- quiz ---------- */

.quiz {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
}
.quiz-inner {
  max-width: var(--max);
  min-height: 100%;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 10px) var(--gutter) calc(var(--safe-bottom) + 18px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.quiz-top {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-left: -10px;
}
.quiz-progress {
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.quiz-progress span {
  display: block;
  height: 100%;
  background: var(--camel-2);
  transition: width 0.25s ease;
}
.quiz-count {
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 500;
}
.quiz-q {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 14px;
}
.quiz-options {
  display: grid;
  gap: 8px;
}
.quiz-options.swatches {
  grid-template-columns: 1fr 1fr;
}
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  font-size: 16px;
  font-weight: 500;
}
.quiz-opt .swatch {
  width: 22px;
  height: 22px;
}
.quiz-opt.on {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
.quiz-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
}
.quiz-foot .btn.primary {
  min-width: 130px;
}

/* ---------- sign in & boot ---------- */

.auth,
.boot {
  min-height: 100dvh;
  max-width: 380px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 24px) 24px calc(var(--safe-bottom) + 24px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.auth-mark {
  width: 140px;
  height: auto;
}
.auth-wordmark {
  width: 220px;
  height: auto;
}
.tagline {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 26ch;
}
.auth-note {
  color: var(--camel);
  font-weight: 500;
}
.auth-form {
  width: 100%;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  text-align: left;
}
.form-error {
  color: var(--danger);
  font-size: 14.5px;
  min-height: 1.4em;
}
.boot-mark {
  width: 110px;
  animation: pulse 1.4s ease-in-out infinite;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--tabbar) + var(--safe-bottom) + 18px);
  max-width: min(92vw, 480px);
  padding: 12px 16px;
  border-radius: 14px;
  background: #12202e;
  color: #faf7f2;
  font-size: 14.5px;
  box-shadow: 0 8px 26px rgba(10, 16, 24, 0.3);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error {
  background: var(--danger);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .toast:not(.error) {
    background: #f3eee6;
    color: #12202e;
  }
}
body.has-fab .toast {
  bottom: calc(var(--tabbar) + var(--safe-bottom) + 86px);
}
body.auth-mode .toast {
  bottom: calc(var(--safe-bottom) + 24px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 360px) {
  .ask-actions {
    grid-template-columns: 1fr;
  }
}

.results > .link-btn {
  justify-self: center;
}
@media (prefers-color-scheme: dark) {
  .palette-dot,
  .gaps-swatches span {
    box-shadow: 0 0 0 3px var(--paper), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  }
}
