:root {
  color-scheme: light;
  --background: #f5f5f7;
  --surface: #ffffff;
  --ink: #0b0b0d;
  --muted: #6e6e73;
  --line: #e6e6ea;
  --accent: #0b0b0d;
  --accent-hover: #2c2c30;
  --on-accent: #ffffff;
  --soft-green: #ececf0;
  --danger: #9b4038;
  --brand: #344d3c;
  /* Display type: the system's own bold grotesk (SF Pro on Apple devices). The name is historical. */
  --serif: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Inter, sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
label.photo-upload:has(input:focus-visible) {
  outline: 3px solid #aeaeb0;
  outline-offset: 3px;
}

.site-header {
  height: 88px;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 246, 248, 0.92);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--soft-green);
  border-radius: 12px;
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.button {
  min-height: 44px;
  padding: 0 19px;
  border: 0;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button svg {
  width: 19px;
  height: 19px;
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.button-secondary {
  background: var(--soft-green);
  color: var(--accent);
}

.button-secondary:hover {
  background: #e2e2e4;
}

.button-plain {
  background: transparent;
  color: var(--muted);
}

.button-plain:hover {
  background: #f1f1f3;
}

.main-content {
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
  padding: 58px 0 80px;
}

.wardrobe-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #7f7f81;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 1.8px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4vw, 50px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.item-count {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 14px;
}

.wardrobe-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.search-box {
  flex: 0 0 278px;
  height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
}

.search-box:focus-within {
  border-color: #aeaeb0;
  box-shadow: 0 0 0 3px rgba(174, 174, 176, 0.16);
}

.search-box svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #949496;
}

.category-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.filter-button {
  min-height: 38px;
  padding: 0 13px;
  flex: none;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.filter-button:hover {
  background: #efeff1;
  color: var(--ink);
}

.filter-button.active {
  background: var(--soft-green);
  color: var(--accent);
  font-weight: 650;
}

.site-tabs {
  margin: 0 auto 0 34px;
  display: flex;
  gap: 4px;
}

.site-tab {
  min-height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.site-tab:hover {
  background: #efeff1;
  color: var(--ink);
}

.site-tab.active {
  background: var(--soft-green);
  color: var(--accent);
}

.stat-tiles {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 16px;
}

.stat-tile,
.panel {
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.stat-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.stat-value {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.stat-note {
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-hero {
  border-color: transparent;
  background: radial-gradient(120% 140% at 0% 0%, #5b5b5d, #2e2e30);
  color: #fff;
}

.stat-hero .stat-label,
.stat-hero .stat-note {
  color: #ceced0;
}

.stat-hero .stat-value {
  font-size: 46px;
}

.panel-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel-grid + .panel,
.panel + .panel,
.stat-tiles + .panel {
  margin-top: 16px;
}

.panel-grid > .panel {
  margin-top: 0;
}

.panel-title {
  margin: 0 0 18px;
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 21px;
  font-weight: 700;
}

.panel-note,
.finances-empty p {
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.bars {
  display: grid;
  gap: 4px;
}

.bar-row {
  margin: 0 -8px;
  padding: 8px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 14px;
  border-radius: 9px;
}

.bar-row:hover {
  background: #f5f5f7;
}

.bar-label,
.bar-value {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
}

.bar-label strong,
.bar-value strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 10px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.money-row {
  width: calc(100% + 16px);
  margin: 0 -8px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.money-row:hover {
  background: #f5f5f7;
}

.money-thumbnail {
  width: 50px;
  height: 50px;
  flex: none;
  overflow: hidden;
  border-radius: 10px;
  background: #eaeaec;
}

.money-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.money-thumbnail .image-placeholder svg {
  width: 30px;
  height: 30px;
}

.money-text {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.money-text strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-trailing {
  flex: none;
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .stat-tiles {
    grid-template-columns: 1fr 1fr;
  }

  .stat-hero {
    grid-column: 1 / -1;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-tabs {
    margin-left: 10px;
    gap: 0;
  }

  .site-tab {
    padding: 0 9px;
    font-size: 13px;
  }

  .brand > span:last-child {
    display: none;
  }

  .bar-row {
    grid-template-columns: 108px minmax(0, 1fr) 78px;
    gap: 10px;
  }
}

.heading-side {
  display: flex;
  align-items: center;
  gap: 18px;
}

.heading-side .item-count {
  margin: 0;
}

.design-switch {
  padding: 4px;
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.design-option {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.design-option:hover {
  color: var(--ink);
}

.design-option.active {
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.stage {
  position: relative;
  min-height: 600px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 28px;
  background: linear-gradient(#fafafa, #e8e8ea);
  box-shadow: inset 0 0 0 1px rgba(59, 59, 61, 0.06);
}

.card3d {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #f4f4f6;
  box-shadow: 0 22px 34px -18px rgba(27, 27, 29, 0.55);
}

.stage .empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(390px, calc(100% - 40px));
  margin: 0;
  padding: 32px 28px;
  transform: translate(-50%, -50%);
  border-radius: 22px;
  background: #f8f8fa;
  color: var(--ink);
  box-shadow: 0 24px 50px -22px rgba(27, 27, 29, 0.45);
}

.stage-caption {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: min(560px, calc(100% - 150px));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.stage-caption .eyebrow {
  margin-bottom: 8px;
}

.stage-caption h2 {
  margin: 0 0 5px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-meta {
  min-height: 19px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-arrow {
  position: absolute;
  top: 40%;
  z-index: 3;
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 8px 20px -8px rgba(27, 27, 29, 0.5);
  cursor: pointer;
  transition: transform 160ms ease;
}

.stage-arrow:hover {
  transform: scale(1.07);
}

.stage-arrow svg {
  width: 22px;
  height: 22px;
}

.stage-arrow-prev {
  left: 22px;
}

.stage-arrow-next {
  right: 22px;
}

.stage-arrow-next svg {
  transform: scaleX(-1);
}

/* Orbit */
.stage:is([data-design="orbit"], [data-design="wheel"]) {
  background: radial-gradient(85% 70% at 50% 36%, #5b5b5d 0%, #2e2e30 52%, #171719 100%);
  color: #fff;
  box-shadow: none;
}

.stage:is([data-design="orbit"], [data-design="wheel"]) .eyebrow {
  color: #bababc;
}

.stage:is([data-design="orbit"], [data-design="wheel"]) .stage-meta {
  color: #c3c3c5;
}

.orbit-view {
  position: absolute;
  inset: 0;
  perspective: 1500px;
  perspective-origin: 50% 40%;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.orbit-view:active {
  cursor: grabbing;
}

.orbit-floor {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 60%;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(216, 216, 218, 0.2), rgba(216, 216, 218, 0));
}

.orbit-ring {
  position: absolute;
  top: 39%;
  left: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--r) * -1)) rotateX(-4deg) rotateY(var(--angle, 0deg));
}

.orbit-slot {
  position: absolute;
  top: -128px;
  left: -95px;
  width: 190px;
  height: 256px;
  backface-visibility: hidden;
  transition: opacity 300ms ease;
}

.orbit-slot .card3d {
  width: 100%;
  height: 100%;
  transform: scale(0.9);
  filter: brightness(0.72);
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 500ms ease, box-shadow 500ms ease;
  -webkit-box-reflect: below 12px linear-gradient(transparent 70%, rgba(255, 255, 255, 0.16));
}

.orbit-slot.is-front .card3d {
  transform: scale(1.08);
  filter: none;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.orbit-slot img {
  pointer-events: none;
}

/* Flow */
.flow-track {
  --flow-w: 232px;
  height: 480px;
  padding: 58px calc(50% - var(--flow-w) / 2) 0;
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  perspective: 1300px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  outline-offset: -4px;
}

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

.flow-track .card3d {
  flex: none;
  width: var(--flow-w);
  height: 300px;
  scroll-snap-align: center;
  filter: brightness(0.9);
  transition: filter 300ms ease, box-shadow 300ms ease;
  -webkit-box-reflect: below 10px linear-gradient(transparent 68%, rgba(255, 255, 255, 0.3));
}

.flow-track .card3d.is-front {
  filter: none;
  box-shadow: 0 34px 50px -22px rgba(27, 27, 29, 0.6);
}

.stage[data-design="flow"] .stage-arrow {
  top: 34%;
}

/* Stacks */
.decks {
  padding: 46px 40px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 26px 18px;
}

.deck {
  padding: 8px 8px 18px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 300ms ease;
}

.deck:hover,
.deck:focus-visible {
  background: rgba(255, 255, 255, 0.7);
}

.deck-pile {
  position: relative;
  height: 300px;
  display: block;
  perspective: 1000px;
}

.deck-card {
  position: absolute;
  top: 42px;
  left: calc(50% - 86px);
  width: 172px;
  height: 224px;
  overflow: hidden;
  border-radius: 18px;
  background: #f4f4f6;
  box-shadow: 0 20px 28px -16px rgba(27, 27, 29, 0.5), 0 0 0 1px rgba(59, 59, 61, 0.07);
  transform:
    translate3d(calc((var(--k) - var(--mid)) * 17px), calc(var(--k) * -9px), calc(var(--k) * -36px))
    rotate(calc((var(--k) - var(--mid)) * 4.5deg));
  transition: transform 560ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.deck-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.deck:hover .deck-card,
.deck:focus-visible .deck-card {
  transform:
    translate3d(calc((var(--k) - var(--mid)) * 52px), calc((var(--k) - var(--mid)) * (var(--k) - var(--mid)) * 6px - 12px), 30px)
    rotate(calc((var(--k) - var(--mid)) * 8deg));
}

.deck-open {
  padding: 30px 40px 46px;
}

.deck-open-header {
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.deck-open-header .wall-back {
  margin: 0;
}

.deck-open-title h2 {
  margin: 0 0 3px;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.deck-open-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.wall-back {
  min-height: 38px;
  padding: 0 14px 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--soft-green);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.wall-back svg {
  width: 19px;
  height: 19px;
}

.stage-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.stage-meta strong {
  flex: none;
  font-weight: 650;
  color: var(--ink);
}

.stage-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage:is([data-design="orbit"], [data-design="wheel"]) .stage-meta strong {
  color: #fff;
}

.deck-label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

.deck-label strong {
  color: var(--ink);
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 21px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .wardrobe-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-side {
    width: 100%;
    justify-content: space-between;
  }

  .stage {
    min-height: 540px;
    border-radius: 22px;
  }

  .stage-arrow {
    display: none;
  }

  .stage-caption {
    width: calc(100% - 40px);
  }

  .orbit-slot {
    top: -108px;
    left: -80px;
    width: 160px;
    height: 216px;
  }

  .flow-track {
    --flow-w: 190px;
    height: 430px;
  }

  .flow-track .card3d {
    height: 250px;
  }

  .decks {
    padding: 26px 16px 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deck-card {
    left: calc(50% - 60px);
    width: 120px;
    height: 158px;
  }

  .deck-pile {
    height: 214px;
  }

}

.item-view {
  width: 100%;
  height: 100%;
  padding: 0;
  display: block;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.item-view > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease;
}

.item-view:hover > img {
  transform: scale(1.02);
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #a8a8aa;
}

.image-placeholder svg {
  width: 64px;
  height: 64px;
}

.delete-item {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 35px;
  height: 35px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #69696b;
  box-shadow: 0 2px 10px rgba(33, 33, 35, 0.08);
  opacity: 0;
  cursor: pointer;
  transition: opacity 160ms ease, color 160ms ease;
}

.delete-item:focus-visible {
  opacity: 1;
}

.delete-item:hover {
  color: var(--danger);
}

.delete-item svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  max-width: 430px;
  margin: 54px auto 0;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-illustration {
  width: 112px;
  height: 112px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #848486;
  background: var(--soft-green);
}

.empty-illustration svg {
  width: 76px;
  height: 76px;
}

.empty-state h2 {
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.empty-state p {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.item-dialog {
  width: min(540px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow-y: auto;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(31, 31, 33, 0.2);
}

.item-dialog::backdrop {
  background: rgba(33, 33, 35, 0.45);
  backdrop-filter: blur(3px);
}

.item-dialog[open] {
  animation: dialog-in 180ms ease both;
}

.dialog-header {
  padding: 26px 28px 21px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.dialog-header .eyebrow {
  margin-bottom: 7px;
}

.dialog-header h2 {
  margin-bottom: 0;
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 29px;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  background: #f2f2f4;
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.form-content {
  padding: 24px 28px 28px;
  display: grid;
  gap: 20px;
}

.photo-upload,
.photo-preview {
  height: 154px;
  border-radius: 13px;
}

.photo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed #ceced0;
  background: #fafafa;
  cursor: pointer;
}

.photo-upload:hover {
  border-color: #9b9b9d;
  background: #f6f6f8;
}

.photo-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  width: 29px;
  height: 29px;
  margin-bottom: 8px;
  color: var(--accent);
}

.upload-icon svg {
  width: 100%;
  height: 100%;
}

.upload-title {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 650;
}

.upload-hint {
  color: var(--muted);
  font-size: 11px;
}

.photo-preview {
  position: relative;
  overflow: hidden;
  background: #efeff1;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.remove-photo {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.remove-photo svg {
  width: 17px;
  height: 17px;
}

.form-field {
  min-width: 0;
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
}

.form-field small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.form-field input,
.form-field select {
  width: 100%;
  height: 45px;
  padding: 0 13px;
  border: 1px solid #dddddf;
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.form-field input:focus,
.form-field select:focus {
  border-color: #9b9b9d;
  box-shadow: 0 0 0 3px rgba(155, 155, 157, 0.14);
}

.form-field input::placeholder {
  color: #a2a2a4;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dialog-actions {
  padding: 18px 28px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.detail-dialog {
  width: min(700px, calc(100% - 32px));
  overflow: hidden;
}

.detail-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.88);
}

.detail-image {
  min-height: 390px;
  grid-row: 1 / 3;
  background: #eaeaec;
}

.detail-image > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.detail-info {
  padding: 76px 28px 32px;
  align-self: center;
}

.detail-info h2 {
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.detail-color {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.detail-info {
  max-height: min(560px, calc(100vh - 130px));
  overflow-y: auto;
}

.detail-facts {
  margin: 20px 0 0;
  padding-top: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}

.detail-facts dt {
  color: var(--muted);
}

.detail-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-description {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.detail-link {
  margin-top: 14px;
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

.detail-actions {
  align-self: end;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 10;
  min-width: 240px;
  max-width: calc(100% - 32px);
  padding: 13px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  transform: translateX(-50%);
  border-radius: 11px;
  background: #2b2b2d;
  color: #fff;
  box-shadow: 0 8px 30px rgba(28, 28, 30, 0.2);
  font-size: 13px;
}

.toast[hidden] {
  display: none;
}

.toast button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #d4d4d6;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1000px) {
  .wardrobe-controls {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .search-box {
    flex-basis: 44px;
    width: min(100%, 360px);
  }

  .category-filters {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .site-header {
    height: 74px;
    padding: 0 20px;
  }

  .brand {
    font-size: 19px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .site-header .button {
    padding: 0 14px;
  }

  .main-content {
    width: calc(100% - 40px);
    padding-top: 38px;
  }

  .wardrobe-heading {
    margin-bottom: 28px;
  }

  h1 {
    font-size: 39px;
  }

  .delete-item {
    opacity: 1;
  }

  .empty-state {
    margin-top: 40px;
  }

  .dialog-header,
  .form-content,
  .dialog-actions {
    padding-left: 20px;
    padding-right: 20px;
  }

  .detail-dialog {
    overflow-y: auto;
  }

  .detail-dialog[open] {
    grid-template-columns: 1fr;
  }

  .detail-image {
    min-height: 0;
    aspect-ratio: 4 / 3;
    grid-row: auto;
  }

  .detail-info {
    padding: 28px 20px;
  }

  .detail-info h2 {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- App shell ---------- */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  background: rgba(246, 246, 248, 0.78);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
}

.main-content {
  padding-top: 46px;
}

#view-wardrobe:not([hidden]),
#view-finances:not([hidden]) {
  animation: view-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.wardrobe-controls {
  gap: 18px;
}

.category-filters {
  flex: 1;
  min-width: 0;
}

.filter-button span {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.6;
}

.sort-box {
  flex: none;
  height: 44px;
  padding: 0 6px 0 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.sort-box select {
  height: 40px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sort-box:focus-within {
  border-color: #aeaeb0;
  box-shadow: 0 0 0 3px rgba(174, 174, 176, 0.16);
}

/* ---------- Gallery ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 36px 22px;
}

.tile {
  min-width: 0;
  animation: tile-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

.tile-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 20px;
  background: #ebebed;
  transition: transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 450ms ease;
}

.tile:hover .tile-media,
.tile:focus-within .tile-media {
  transform: translateY(-6px);
  box-shadow: 0 30px 40px -26px rgba(37, 37, 39, 0.5);
}

.tile-media .item-view > img {
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tile:hover .item-view > img {
  transform: scale(1.05);
}

.tile-media:hover .delete-item {
  opacity: 1;
}

.tile-info {
  padding: 14px 4px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tile-text {
  min-width: 0;
}

.tile-brand {
  margin: 0 0 5px;
  overflow: hidden;
  color: #8c8c8e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tile-name {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tile.is-loading {
  animation: none;
}

.tile.is-loading .tile-media,
.tile-line {
  background: linear-gradient(100deg, #ebebed 30%, #f5f5f7 50%, #ebebed 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.tile-line {
  width: 78%;
  height: 12px;
  margin: 16px 4px 0;
  border-radius: 6px;
}

.tile-line.short {
  width: 42%;
  margin-top: 9px;
}

.tab-bar {
  display: none;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes tile-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -100% 0; }
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}

@media (max-width: 1000px) {
  .wardrobe-controls {
    align-items: stretch;
  }

  .sort-box {
    align-self: flex-start;
  }
}

/* ---------- Phone: a tab bar at the thumb and sheets from the bottom ---------- */
@media (max-width: 640px) {
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .site-header {
    height: 58px;
    justify-content: center;
  }

  .site-tabs,
  .site-header .button {
    display: none;
  }

  .brand > span:last-child {
    display: inline;
  }

  .main-content {
    padding-top: 28px;
  }

  .tab-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 30;
    height: 66px;
    padding: 0 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: saturate(1.6) blur(20px);
    backdrop-filter: saturate(1.6) blur(20px);
    box-shadow: 0 14px 40px -14px rgba(37, 37, 39, 0.4), 0 0 0 1px rgba(59, 59, 61, 0.07);
  }

  .tab-bar-link {
    display: grid;
    justify-items: center;
    gap: 3px;
    color: #8c8c8e;
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
  }

  .tab-bar-link svg {
    width: 23px;
    height: 23px;
  }

  .tab-bar-link.active {
    color: var(--accent);
  }

  .toast {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .item-dialog {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }

  .item-dialog[open] {
    animation: sheet-in 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .dialog-actions {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }

  .tile-media {
    border-radius: 16px;
  }

  .tile-info {
    display: block;
    padding-top: 10px;
  }

  .tile-name {
    font-size: 14px;
  }

  .tile .delete-item {
    display: none;
  }

  .heading-side {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .design-switch {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .design-switch::-webkit-scrollbar {
    display: none;
  }

  .design-option {
    flex: none;
  }

  .sort-box {
    align-self: stretch;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile,
  .item-dialog[open],
  #view-wardrobe:not([hidden]),
  #view-finances:not([hidden]) {
    animation: none;
  }
}

@media (max-width: 640px) {
  .deck-open {
    padding: 20px 14px 30px;
  }

  .deck-card {
    top: 30px;
    left: calc(50% - 62px);
    width: 124px;
    height: 162px;
  }

  .deck-pile {
    height: 218px;
  }
}

/* ---------- Browse ---------- */
.browse-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 30px 20px;
}

.browse-grid .tile {
  animation-delay: 0ms;
}

.browse-grid .tile-media {
  aspect-ratio: 1;
}

.tile-color {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 6px 16px -6px rgba(37, 37, 39, 0.45);
  transition: background 220ms ease, color 220ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.browse-badge svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  transition: opacity 180ms ease, transform 220ms ease;
}

.badge-check {
  opacity: 0;
  transform: scale(0.5);
}

.tile:hover .browse-badge {
  transform: scale(1.1);
}

.tile.is-owned .browse-badge {
  background: var(--accent);
  color: #fff;
}

.tile.is-owned .badge-plus {
  opacity: 0;
  transform: scale(0.5);
}

.tile.is-owned .badge-check {
  opacity: 1;
  transform: none;
}

.tile.is-adding .tile-media {
  opacity: 0.6;
}

.tile.is-adding .browse-badge {
  animation: badge-pulse 800ms ease-in-out infinite alternate;
}

.browse-more {
  min-height: 90px;
  padding-top: 34px;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.browse-more p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

#view-browse:not([hidden]) {
  animation: view-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes badge-pulse {
  from { transform: scale(0.9); }
  to { transform: scale(1.15); }
}

@media (max-width: 640px) {
  .browse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 12px;
  }

  .browse-badge {
    right: 8px;
    bottom: 8px;
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-browse:not([hidden]),
  .tile.is-adding .browse-badge {
    animation: none;
  }
}

.browse-groups {
  margin: -12px 0 26px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.browse-groups::-webkit-scrollbar {
  display: none;
}

.group-chip {
  min-height: 36px;
  padding: 0 13px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.group-chip:hover {
  border-color: #c2c2c4;
}

.group-chip span {
  margin-left: 7px;
  color: var(--muted);
  font-size: 11px;
}

.group-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.group-chip.active span {
  color: rgba(255, 255, 255, 0.72);
}

.browse-summary {
  margin-bottom: 22px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.browse-summary h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.browse-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Sections inside an opened deck ---------- */
.deck-section + .deck-section {
  margin-top: 44px;
}

.deck-section-title {
  margin: 0 0 18px;
  padding-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 20px;
  font-weight: 700;
}

.deck-section-title span {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
}

.panel-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* ---------- Piece detail ---------- */
.detail-dialog {
  width: min(1040px, calc(100% - 40px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
  border-radius: 26px;
}

.detail-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.detail-media {
  position: relative;
  min-height: 580px;
  background: #f2f2f4;
}

.detail-image {
  position: absolute;
  inset: 0;
  min-height: 0;
  grid-row: auto;
  background: none;
}

.detail-image > img {
  object-fit: contain;
}

.detail-media .stage-arrow {
  top: 50%;
  transform: translateY(-50%);
}

.detail-media .stage-arrow:hover {
  transform: translateY(-50%) scale(1.07);
}

.detail-media .stage-arrow-prev {
  left: 16px;
}

.detail-media .stage-arrow-next {
  right: 16px;
}

.detail-position {
  position: absolute;
  left: 22px;
  bottom: 16px;
  margin: 0;
  color: #767678;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.detail-side {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.detail-info {
  flex: 1;
  max-height: none;
  padding: 66px 34px 28px;
  align-self: auto;
  overflow-y: auto;
}

.detail-chips {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-chips span {
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}

.detail-info .eyebrow {
  margin-bottom: 10px;
}

.detail-info h2 {
  font-size: 36px;
  line-height: 1.1;
}

.detail-actions {
  align-self: auto;
  align-items: center;
}

.detail-actions .detail-link {
  margin: 0 auto 0 0;
  display: inline-flex;
  text-decoration: none;
}

/* ---------- Welcome and connection states ---------- */
.stage[data-design="welcome"] {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 70px 24px;
}

.welcome {
  width: min(640px, 100%);
  text-align: center;
}

.welcome h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.welcome-lead {
  margin: 0 auto;
  max-width: 460px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.welcome-steps {
  margin: 38px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  list-style: none;
  counter-reset: step;
  text-align: left;
}

.welcome-steps li {
  padding: 18px;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  counter-increment: step;
}

.welcome-steps li::before {
  content: counter(step);
  width: 26px;
  height: 26px;
  margin-bottom: 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft-green);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.welcome-steps strong {
  color: var(--ink);
  font-size: 15px;
}

.welcome-actions {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.welcome-actions .button {
  min-height: 48px;
  padding: 0 24px;
  text-decoration: none;
}

@media (max-width: 640px) {
  .detail-dialog {
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    border-radius: 26px 26px 0 0;
  }

  .detail-dialog[open] {
    grid-template-columns: 1fr;
  }

  .detail-media {
    min-height: 0;
    aspect-ratio: 1;
  }

  .detail-info {
    padding: 24px 20px 20px;
    overflow: visible;
  }

  .detail-close {
    position: fixed;
  }

  .detail-info h2 {
    font-size: 28px;
  }

  .welcome-steps {
    grid-template-columns: 1fr;
  }

  .stage[data-design="welcome"] {
    padding: 44px 18px;
  }
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #000000;
    --surface: #141416;
    --ink: #f5f5f7;
    --muted: #98989f;
    --line: #262629;
    --accent: #f5f5f7;
    --accent-hover: #d2d2d7;
    --on-accent: #0b0b0d;
    --soft-green: #232326;
    --danger: #e08d84;
  }

  .button-primary,
  .design-option.active,
  .group-chip.active,
  .bar {
    background: #5f5f61;
    color: #fff;
  }

  .group-chip.active {
    border-color: #5f5f61;
  }

  .site-header {
    background: rgba(21, 21, 23, 0.78);
  }

  .button-secondary:hover {
    background: #373739;
  }

  .button-plain:hover,
  .site-tab:hover,
  .filter-button:hover,
  .icon-button:hover,
  .bar-row:hover,
  .money-row:hover {
    background: #28282a;
  }

  .eyebrow,
  .tile-brand,
  .tab-bar-link,
  .detail-position {
    color: #8f8f91;
  }

  .tab-bar-link.active {
    color: var(--accent);
  }

  .search-box input::placeholder,
  .form-field input::placeholder {
    color: #78787a;
  }

  .form-field input,
  .form-field select {
    border-color: #39393b;
    background: #171719;
  }

  .photo-upload {
    border-color: #414143;
    background: #19191b;
  }

  .photo-upload:hover {
    border-color: #6a6a6c;
    background: #1e1e20;
  }

  .photo-preview,
  .dialog-actions {
    background: #1b1b1d;
  }

  .item-dialog {
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  }

  .item-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
  }

  .detail-close {
    background: rgba(31, 31, 33, 0.88);
  }

  .stage {
    background: linear-gradient(#1e1e20, #171719);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  }

  .stage[data-design="welcome"] {
    background: none;
    box-shadow: none;
  }

  .stage .empty-state {
    background: var(--surface);
    box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.7);
  }

  .empty-illustration {
    color: #a6a6a8;
  }

  .deck:hover,
  .deck:focus-visible {
    background: rgba(255, 255, 255, 0.05);
  }

  .stage-arrow {
    background: rgba(46, 46, 48, 0.92);
  }

  .flow-track .card3d {
    -webkit-box-reflect: below 10px linear-gradient(transparent 68%, rgba(255, 255, 255, 0.12));
  }

  .tile.is-loading .tile-media,
  .tile-line {
    background: linear-gradient(100deg, #222224 30%, #2f2f31 50%, #222224 70%);
    background-size: 220% 100%;
  }

  .stat-hero {
    background: radial-gradient(120% 140% at 0% 0%, #555557, #272729);
  }

  .tab-bar {
    background: rgba(31, 31, 33, 0.86);
    box-shadow: 0 14px 40px -14px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.07);
  }

  .toast {
    background: #efeff1;
    color: #1b1b1d;
  }

  .toast button {
    color: #4f4f51;
  }

  .browse-badge {
    background: #28282a;
  }

  .tile.is-owned .browse-badge {
    background: #5f5f61;
  }

  .sort-box:focus-within,
  .search-box:focus-within {
    border-color: #6a6a6c;
    box-shadow: 0 0 0 3px rgba(106, 106, 108, 0.25);
  }
}

/* ---------- Sign in ---------- */
body.signed-out > :not(.auth):not(.toast) {
  display: none;
}

.auth {
  min-height: 100vh;
  padding: 32px 20px;
  display: grid;
  place-items: center;
  background: radial-gradient(90% 60% at 50% 0%, var(--soft-green), transparent 70%);
}

.auth-card {
  width: min(400px, 100%);
  padding: 38px 34px 30px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 30px 70px -40px rgba(37, 37, 39, 0.5);
}

.auth-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border-radius: 15px;
}

.auth-card h1 {
  font-size: 34px;
  letter-spacing: -0.9px;
}

.auth-lead {
  margin: 8px 0 26px;
  color: var(--muted);
  font-size: 15px;
}

.auth-card form {
  display: grid;
  gap: 16px;
}

.auth-card .button {
  min-height: 48px;
  margin-top: 6px;
}

.auth-error {
  margin: 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(155, 64, 56, 0.1);
  color: var(--danger);
  font-size: 13px;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-switch button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

/* ---------- People ---------- */
.avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--soft-green);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
}

.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.avatar-large {
  width: 76px;
  height: 76px;
  font-size: 30px;
}

.avatar-hero {
  width: 104px;
  height: 104px;
  font-size: 42px;
}

.profile-link {
  border-radius: 50%;
  text-decoration: none;
  transition: box-shadow 160ms ease;
}

.profile-link.active {
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--accent);
}

.tab-badge {
  min-width: 18px;
  height: 18px;
  margin-left: 7px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.people-search {
  flex: 0 1 420px;
}

.people-panel {
  margin-bottom: 16px;
}

.people-panel .panel-title span {
  margin-left: 9px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.person-row {
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.person-row + .person-row {
  border-top: 1px solid var(--line);
}

.person-link {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.person-text {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.person-text strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-handle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.person-actions {
  flex: none;
  display: flex;
  gap: 6px;
}

.person-actions .button {
  min-height: 38px;
  padding: 0 15px;
  font-size: 13px;
}

.person-head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.person-head h1,
.person-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.person-head h2 {
  font-size: 28px;
}

.person-bio,
.person-facts {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.person-facts {
  color: var(--muted);
}

.person-hero {
  margin: 22px 0 40px;
}

.person-hero .person-actions {
  margin-left: auto;
}

.person-back {
  text-decoration: none;
}

.person-stats {
  margin-top: 26px;
  padding-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
}

.person-stat {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.person-stat strong {
  color: var(--ink);
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 24px;
  font-weight: 700;
}

/* ---------- Profile ---------- */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 16px;
}

.profile-layout .panel {
  margin: 0;
}

.profile-form {
  display: grid;
  gap: 18px;
}

.profile-form .panel-title {
  margin-bottom: 2px;
}

.profile-photo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-photo .button {
  min-height: 38px;
  font-size: 13px;
}

.toggle-row {
  padding: 14px;
  display: flex;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: #5f5f61;
}

.toggle-row span {
  display: grid;
  gap: 4px;
  font-size: 14px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
}

.detail-dialog.is-readonly #remove-item,
.detail-dialog.is-readonly #edit-item {
  display: none;
}

#view-friends:not([hidden]),
#view-person:not([hidden]),
#view-profile:not([hidden]) {
  animation: view-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tab-bar {
    grid-template-columns: repeat(4, 1fr);
  }

  .site-header {
    justify-content: space-between;
    padding: 0 16px;
  }

  .profile-link .avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .person-row {
    flex-wrap: wrap;
  }

  .person-hero {
    flex-wrap: wrap;
  }

  .person-hero .person-actions {
    width: 100%;
    margin: 0;
  }

  .avatar-hero {
    width: 76px;
    height: 76px;
    font-size: 30px;
  }

  .person-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 12px;
  }

  .auth-card {
    padding: 30px 22px 24px;
  }
}

@media (prefers-color-scheme: dark) {
  .auth-error {
    background: rgba(224, 141, 132, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-friends:not([hidden]),
  #view-person:not([hidden]),
  #view-profile:not([hidden]) {
    animation: none;
  }
}

/* Stacked controls: the people search is one row tall, not as tall as it is wide elsewhere. */
@media (max-width: 1000px) {
  .people-search {
    flex: none;
    width: 100%;
    height: 44px;
  }
}

/* The Drobe mark keeps its own two colors in light and dark alike. */
.brand-mark {
  background: var(--brand);
  color: #f7f6f2;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.auth-mark svg {
  width: 26px;
  height: 26px;
}

/* ---------- Finances inside Profile ---------- */
.profile-switch {
  width: fit-content;
  margin-bottom: 22px;
  display: flex;
}

.profile-switch .design-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.profile-finances .section-heading {
  margin-bottom: 18px;
}

.profile-finances .section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
}

/* ---------- Colorway picker ---------- */
.colorway-dialog {
  width: min(900px, calc(100% - 32px));
  max-height: min(820px, calc(100vh - 40px));
}

.colorway-dialog .dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  gap: 16px;
  background: var(--surface);
}

.colorway-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.colorway-grid {
  padding: 24px 28px 30px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 24px 16px;
}

@media (max-width: 640px) {
  .colorway-dialog {
    width: 100%;
    max-height: 92dvh;
  }

  .colorway-dialog .dialog-header {
    padding: 20px 18px 16px;
  }

  .colorway-dialog .dialog-header h2 {
    font-size: 23px;
  }

  .colorway-grid {
    padding: 18px 18px calc(26px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }
}

/* ---------- Polish: loading, fades, empty states ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.fade-image {
  opacity: 0;
  transition: opacity 320ms ease;
}

.fade-image.is-ready {
  opacity: 1;
}

.browse-grid .tile.is-loading .tile-media {
  border-radius: 18px;
}

.friends-empty {
  margin-top: 36px;
  padding: 0 8px 40px;
}

@media (prefers-reduced-motion: reduce) {
  .fade-image {
    transition: none;
  }
}

/* Stat tiles on narrow screens: notes wrap instead of being cut, and the last tile fills its row. */
@media (max-width: 900px) {
  .stat-note {
    display: -webkit-box;
    white-space: normal;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .stat-tiles > .stat-tile:last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
}

/* ---------- Phone setup ---------- */
.phone-card {
  grid-column: 1 / -1;
}

.phone-card .eyebrow {
  margin-bottom: 8px;
}

.phone-steps {
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  list-style: none;
  counter-reset: phone;
}

.phone-steps li {
  display: grid;
  align-content: start;
  gap: 8px;
  counter-increment: phone;
  font-size: 13px;
  line-height: 1.55;
}

.phone-steps li::before {
  content: counter(phone);
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft-green);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

.phone-steps strong {
  font-size: 14px;
}

.phone-steps span {
  color: var(--muted);
}

.phone-steps code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--soft-green);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.phone-form {
  display: grid;
  gap: 8px;
}

.phone-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.phone-form input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.phone-form .button {
  min-height: 40px;
  font-size: 13px;
}

.phone-address {
  padding: 11px 13px;
  border: 1px dashed var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: copy;
}

.phone-address:hover {
  border-color: var(--accent);
}

@media (max-width: 1100px) {
  .phone-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .phone-steps {
    grid-template-columns: 1fr;
  }
}

/* ---------- Phone wardrobe: controls in two tight rows so clothes start higher ---------- */
@media (max-width: 640px) {
  #view-wardrobe .wardrobe-heading {
    margin-bottom: 14px;
    gap: 14px;
  }

  #view-wardrobe .wardrobe-heading .eyebrow,
  #view-wardrobe .item-count {
    display: none;
  }

  #view-wardrobe .heading-side {
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
  }

  #view-wardrobe .design-switch {
    min-width: 0;
    flex: 1;
    overflow: visible;
  }

  #view-wardrobe .design-option {
    min-width: 0;
    padding: 0 4px;
    flex: 1;
  }

  #view-wardrobe .wardrobe-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  #view-wardrobe .search-box {
    width: 100%;
    grid-column: 1;
    grid-row: 1;
  }

  #view-wardrobe .sort-box {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
  }

  #view-wardrobe .sort-box > span {
    display: none;
  }

  #view-wardrobe .category-filters {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
  }
}

/* ---------- Feels like an app on a phone ---------- */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button,
a,
select,
label {
  touch-action: manipulation;
}

.tab-bar,
.site-tabs,
.design-switch,
.brand {
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 640px) {
  /* iPhone zooms the page when a focused field's text is under 16px. */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Opened from the Home Screen: no browser bars, so keep clear of the status bar and home indicator. */
@media (display-mode: standalone) {
  .site-header {
    padding-top: env(safe-area-inset-top);
    box-sizing: content-box;
  }

  body {
    overscroll-behavior-y: none;
  }
}

/* =====================================================================
   Look, second edition: black and white, bold type, photos carry color.
   Everything above was built cream-and-green; these rules set the final look.
   ===================================================================== */
body {
  background: var(--background);
  letter-spacing: -0.006em;
}

h1 {
  font-size: clamp(40px, 4.6vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ----- Header ----- */
.site-header {
  height: 72px;
  border-bottom-color: transparent;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(22px);
  backdrop-filter: saturate(1.8) blur(22px);
  box-shadow: 0 1px 0 var(--line);
}

.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.site-tabs {
  gap: 2px;
}

.site-tab {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.site-tab:hover {
  background: var(--soft-green);
  color: var(--ink);
}

.site-tab.active {
  background: var(--accent);
  color: var(--on-accent);
}

/* ----- Buttons and controls: pills ----- */
.button {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.button:active {
  transform: scale(0.97);
}

.button-primary,
.button-primary:hover {
  color: var(--on-accent);
}

.button-secondary {
  background: var(--soft-green);
  color: var(--ink);
}

.button-plain {
  color: var(--muted);
}

.button-plain:hover {
  color: var(--ink);
}

.search-box,
.people-search,
.sort-box {
  border-color: transparent;
  border-radius: 999px;
  background: var(--soft-green);
  box-shadow: none;
}

.search-box:focus-within,
.people-search:focus-within,
.sort-box:focus-within {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: none;
}

.design-switch {
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--soft-green);
}

.design-option {
  min-height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  font-weight: 600;
}

.design-option:hover {
  background: transparent;
  color: var(--ink);
}

.design-option.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

.filter-button {
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
}

.filter-button:hover {
  border-color: var(--ink);
  background: transparent;
}

.filter-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
}

.filter-button.active span,
.group-chip.active span {
  color: inherit;
  opacity: 0.6;
}

.category-filters,
.browse-types {
  gap: 8px;
}

.group-chip {
  border-radius: 999px;
  background: transparent;
  font-weight: 550;
}

.group-chip:hover {
  border-color: var(--ink);
}

.group-chip.active {
  color: var(--on-accent);
}

/* ----- Surfaces ----- */
.panel,
.stat-tile {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line);
}

.panel-title {
  font-size: 22px;
  letter-spacing: -0.035em;
}

.stat-label {
  font-weight: 600;
  letter-spacing: 0;
}

.stat-value {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.stat-hero {
  background: #0b0b0d;
  color: #fff;
  box-shadow: none;
}

.stat-hero .stat-value {
  font-size: clamp(44px, 5vw, 64px);
}

.stat-hero .stat-label,
.stat-hero .stat-note {
  color: rgba(255, 255, 255, 0.62);
}

.bar-track {
  background: var(--soft-green);
}

.bar {
  background: var(--accent);
}

.person-stat strong,
.bar-value strong,
.money-trailing {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.avatar {
  background: var(--soft-green);
  color: var(--ink);
  font-weight: 700;
}

.profile-link.active {
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ink);
}

/* ----- Wardrobe stage and tiles ----- */
.stage {
  border-radius: 32px;
  background: linear-gradient(180deg, #ffffff, #ececf0);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.tile-media {
  border-radius: 22px;
  background: #ececee;
}

.browse-grid .tile-media,
.browse-grid .tile.is-loading .tile-media {
  border-radius: 20px;
}

.tile-info {
  padding: 12px 2px 0;
}

.tile-brand {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.tile-name {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.tile-color {
  margin-top: 3px;
  font-size: 13px;
}

.browse-badge {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.92);
  color: #0b0b0d;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.35);
}

.tile.is-owned .browse-badge {
  background: #0b0b0d;
  color: #fff;
}

.browse-summary h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.04em;
}

/* ----- Dialogs ----- */
.item-dialog {
  border-radius: 28px;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.45);
}

.item-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.dialog-header h2,
.detail-info h2 {
  letter-spacing: -0.04em;
}

.empty-illustration {
  background: var(--soft-green);
  color: var(--ink);
}

.toast {
  border-radius: 999px;
}

.phone-steps li::before,
.phone-steps code {
  color: var(--ink);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ----- Phone ----- */
@media (max-width: 640px) {
  h1 {
    font-size: 38px;
  }

  .site-header {
    height: 60px;
  }

  .tab-bar {
    border-radius: 999px;
    height: 64px;
  }

  .tab-bar-link {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0;
  }

  .tab-bar-link.active {
    color: var(--ink);
  }

  .item-dialog {
    border-radius: 28px 28px 0 0;
  }

  .panel,
  .stat-tile {
    border-radius: 22px;
  }
}

/* ----- Dark ----- */
@media (prefers-color-scheme: dark) {
  .button-primary,
  .group-chip.active,
  .bar {
    background: var(--accent);
    color: var(--on-accent);
  }

  .button-primary:hover {
    background: var(--accent-hover);
  }

  .group-chip.active {
    border-color: var(--accent);
  }

  .design-option.active {
    background: #3a3a3e;
    color: #fff;
    box-shadow: none;
  }

  .stage {
    background: linear-gradient(180deg, #17171a, #0a0a0c);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }

  .stat-hero {
    background: #f5f5f7;
    color: #0b0b0d;
  }

  .stat-hero .stat-label,
  .stat-hero .stat-note {
    color: rgba(0, 0, 0, 0.56);
  }

  .tile-media {
    background: #1c1c1f;
  }

  .browse-badge {
    background: rgba(20, 20, 22, 0.86);
    color: #fff;
  }

  .tile.is-owned .browse-badge {
    background: #f5f5f7;
    color: #0b0b0d;
  }

  .item-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
  }

  .tab-bar {
    background: rgba(28, 28, 30, 0.82);
  }
}

/* ---------- Inside the iOS app: the page runs edge to edge under the status bar ---------- */
.in-app .site-header {
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
}

.in-app .auth {
  padding-top: calc(24px + env(safe-area-inset-top));
}

.in-app body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.in-app input,
.in-app textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* ---------- Wheel: Orbit turned on its side, pieces roll past top to bottom ---------- */
.orbit-view.is-vertical {
  perspective: 1400px;
  perspective-origin: 50% 50%;
  touch-action: pan-x;
}

.orbit-view.is-vertical .orbit-ring {
  top: 50%;
  left: 36%;
  transform: translateZ(calc(var(--r) * -1)) rotateY(7deg) rotateX(calc(var(--angle, 0deg) * -1));
}

.orbit-view.is-vertical .orbit-slot .card3d {
  -webkit-box-reflect: none;
}

.stage[data-design="wheel"] {
  min-height: 640px;
}

/* The piece's name sits beside the wheel instead of under it. */
.stage[data-design="wheel"] .stage-caption {
  left: auto;
  right: 6%;
  top: 50%;
  bottom: auto;
  width: min(380px, 38%);
  transform: translateY(-50%);
  text-align: left;
}

.stage[data-design="wheel"] .stage-caption h2 {
  display: -webkit-box;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.08;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.stage[data-design="wheel"] .stage-meta {
  justify-content: flex-start;
  margin-top: 10px;
}

.stage[data-design="wheel"] .stage-arrow {
  left: calc(36% - 23px);
  right: auto;
}

.stage[data-design="wheel"] .stage-arrow-prev {
  top: 18px;
}

.stage[data-design="wheel"] .stage-arrow-next {
  top: auto;
  bottom: 18px;
}

.stage[data-design="wheel"] .stage-arrow svg {
  transform: rotate(90deg);
}

.stage[data-design="wheel"] .stage-arrow-next svg {
  transform: rotate(-90deg);
}

@media (max-width: 760px) {
  /* Short enough that the piece's name stays above the tab bar. */
  .stage[data-design="wheel"] {
    min-height: clamp(390px, calc(100dvh - 490px), 540px);
  }

  .orbit-view.is-vertical .orbit-ring {
    top: 40%;
    left: 50%;
    transform: translateZ(calc(var(--r) * -1)) rotateX(calc(var(--angle, 0deg) * -1));
  }

  .stage[data-design="wheel"] .stage-caption {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    padding: 44px 22px 18px;
    transform: none;
    text-align: center;
    background: linear-gradient(transparent, #171719 46%);
  }

  .stage[data-design="wheel"] .stage-caption h2 {
    font-size: 21px;
    -webkit-line-clamp: 2;
  }

  .stage[data-design="wheel"] .stage-meta {
    justify-content: center;
    margin-top: 4px;
  }

  .stage[data-design="wheel"] .stage-arrow {
    left: auto;
    right: 14px;
    width: 40px;
    height: 40px;
  }

  .stage[data-design="wheel"] .stage-arrow-prev {
    top: calc(40% - 50px);
  }

  .stage[data-design="wheel"] .stage-arrow-next {
    top: calc(40% + 10px);
    bottom: auto;
  }
}

.auth-forgot {
  margin-top: 10px;
}

.auth-forgot button {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Sign-in page: form on the left, a drifting wall of pieces on the right ---------- */
.auth {
  min-height: 100dvh;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  place-items: stretch;
  background: var(--background);
}

.auth-side {
  padding: 40px 24px;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(380px, 100%);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-card h1 {
  font-size: clamp(36px, 3.6vw, 46px);
  letter-spacing: -0.045em;
}

.auth-card .form-field input {
  min-height: 50px;
  border-radius: 14px;
}

.auth-or {
  margin: 22px 0 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.auth-or::before,
.auth-or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.auth-card .auth-google {
  width: 100%;
  margin: 0;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.auth-card .auth-google:hover {
  border-color: var(--ink);
}

.auth-google svg {
  width: 18px;
  height: 18px;
}

.auth-show {
  position: relative;
  margin: 14px;
  overflow: hidden;
  border-radius: 36px;
  background: #0b0b0d;
  color: #fff;
  perspective: 1300px;
}

.auth-show-grid {
  position: absolute;
  inset: -22% -10%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  transform: rotateX(calc(16deg + var(--ty, 0deg))) rotateY(calc(-14deg + var(--tx, 0deg))) rotateZ(5deg);
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.auth-col {
  padding-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
  animation: auth-roll 44s linear infinite;
}

.auth-col:nth-child(2) {
  animation-duration: 56s;
  animation-direction: reverse;
}

.auth-col:nth-child(3) {
  animation-duration: 50s;
}

.auth-tile {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  flex: none;
  border-radius: 24px;
  background: #ececee;
  transition: transform 350ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 350ms ease;
}

.auth-tile:hover {
  transform: scale(1.06);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
}

.auth-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.auth-tile.is-empty img {
  display: none;
}

.auth-show-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 150px 44px 44px;
  background: linear-gradient(transparent, rgba(11, 11, 13, 0.94) 58%);
  pointer-events: none;
}

.auth-show-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(32px, 3.6vw, 56px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-points span {
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  font-size: 13px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@keyframes auth-roll {
  to { transform: translateY(-50%); }
}

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

  .auth-show {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-col {
    animation: none;
  }
}

/* ---------- Appearance setting ---------- */
.theme-switch {
  width: fit-content;
}

/* ---------- Start-up: the mark holds the screen until Drobe knows who is here ---------- */
.boot,
body.signed-out > .boot:not(.auth):not(.toast) {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--background);
}

.boot-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  animation: boot-pulse 900ms ease-in-out infinite alternate;
}

.boot-mark svg {
  width: 38px;
  height: 38px;
}

@keyframes boot-pulse {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.94); opacity: 0.72; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-mark {
    animation: none;
  }
}

/* A page saved before the split sign-in layout holds the form directly; keep it centred and padded. */
.auth > .auth-card {
  width: min(428px, 100%);
  padding: 40px 24px;
  grid-column: 1 / -1;
  place-self: center;
}

/* Phone: money in the small stat cards must fit a half-width card. */
@media (max-width: 560px) {
  .stat-tile:not(.stat-hero) .stat-value {
    font-size: clamp(20px, 6.6vw, 34px);
  }
}

/* Profile heading: Log out sits beside the title as a small pill, on every width. */
#view-profile .wardrobe-heading {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

#view-profile #log-out {
  flex: none;
  width: auto;
  min-height: 38px;
  margin: 0 0 6px;
  padding: 0 16px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 7%, transparent);
  font-size: 14px;
}

/* Search pills: the pill itself shows focus; the field inside stays invisible. */
.search-box input,
.search-box input:focus,
.search-box input:focus-visible {
  outline: none;
  background: transparent;
  box-shadow: none;
  border: 0;
}

.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* ===== Profile, third edition: a cover made of your own pieces ===== */
#view-profile .profile-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.profile-hero {
  --hero: #0b0b0d;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--hero);
  color: #fff;
}

.me-cover {
  position: relative;
  height: 210px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 85% 0%, #3a5644 0%, transparent 55%),
    radial-gradient(90% 120% at 0% 100%, #26262b 0%, transparent 60%),
    var(--hero);
}

.me-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0.1) 0%, rgba(11, 11, 13, 0.35) 45%, var(--hero) 100%);
  pointer-events: none;
}

.me-strip {
  position: absolute;
  top: -26px;
  left: -30px;
  right: -30px;
  display: flex;
  gap: 12px;
  transform: rotate(-5deg);
  transform-origin: 30% 50%;
}

.me-tile {
  flex: none;
  width: 132px;
  height: 168px;
  overflow: hidden;
  border-radius: 20px;
  background: #f2f2f4;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.me-tile:nth-child(even) {
  margin-top: 26px;
}

.me-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.me-head {
  position: relative;
  margin-top: -58px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.avatar.me-avatar {
  width: 112px;
  height: 112px;
  border: 4px solid var(--hero);
  background: #2a2a2e;
  color: #fff;
  font-size: 44px;
  font-weight: 750;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.me-text {
  min-width: 0;
  padding-bottom: 6px;
}

.me-text h2 {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-handle {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  font-weight: 600;
}

.me-bio {
  margin: 10px 0 0;
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.45;
}

.me-edit {
  min-height: 42px;
  margin-bottom: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0b0b0d;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.me-edit:hover {
  background: #e9e9ed;
}

.me-edit:active {
  transform: scale(0.96);
}

.me-stats {
  margin: 26px 28px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
}

.me-stat {
  min-width: 0;
  padding: 18px 20px;
  display: grid;
  gap: 4px;
}

.me-stat + .me-stat {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.1);
}

.me-stat strong {
  overflow: hidden;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-stat span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.me-chips {
  padding: 18px 28px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.me-chip {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 600;
}

.me-chip b {
  color: #fff;
  font-weight: 800;
}

.profile-hero > :last-child {
  margin-bottom: 28px;
}

/* Settings: two cards side by side, a row per setting. */
#view-profile .profile-form {
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}

.set-card {
  display: grid;
  gap: 18px;
  border-radius: 24px;
}

.set-card .eyebrow {
  margin: 0 0 -12px;
}

.set-card .panel-title {
  margin: 0;
}

.set-row {
  padding: 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.set-text {
  min-width: 0;
  display: grid;
  gap: 3px;
  font-size: 15px;
}

.set-text small {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.set-row .theme-switch {
  flex: none;
}

/* The worth setting is a real switch. */
.toggle-row input[role="switch"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  cursor: pointer;
  transition: background 200ms ease;
}

.toggle-row input[role="switch"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 220ms cubic-bezier(0.3, 1.4, 0.5, 1);
}

.toggle-row input[role="switch"]:checked {
  background: #2f9e5b;
}

.toggle-row input[role="switch"]:checked::after {
  transform: translateX(20px);
}

#view-profile .profile-actions {
  grid-column: 1 / -1;
}

#view-profile .profile-actions .button {
  min-width: 180px;
}

#view-profile .phone-card {
  border-radius: 24px;
}

@media (max-width: 760px) {
  .profile-hero {
    border-radius: 24px;
  }

  .me-cover {
    height: 168px;
  }

  .me-tile {
    width: 104px;
    height: 134px;
    border-radius: 16px;
  }

  .me-head {
    margin-top: -52px;
    padding: 0 20px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 14px;
  }

  .avatar.me-avatar {
    width: 96px;
    height: 96px;
    font-size: 38px;
  }

  .me-text {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 0;
  }

  .me-edit {
    justify-self: end;
    margin-bottom: 4px;
  }

  .me-stats {
    margin: 20px 20px 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .me-stat {
    padding: 14px 16px;
  }

  .me-stat + .me-stat {
    box-shadow: none;
  }

  .me-stat:nth-child(even) {
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.1);
  }

  .me-stat:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .me-chips {
    padding: 16px 20px 0;
  }

  .profile-hero > :last-child {
    margin-bottom: 20px;
  }

  #view-profile .profile-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .set-row {
    flex-wrap: wrap;
  }

  #view-profile .profile-actions .button {
    width: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  .profile-hero {
    --hero: #18181b;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  }

  .me-cover::after {
    background: linear-gradient(180deg, rgba(24, 24, 27, 0.1) 0%, rgba(24, 24, 27, 0.35) 45%, var(--hero) 100%);
  }
}

/* A small wardrobe: its few pieces sit centred in the cover instead of running off the edge. */
.me-strip.is-few {
  top: 18px;
  left: 0;
  right: 0;
  justify-content: center;
  transform: rotate(-4deg);
  transform-origin: 50% 50%;
}

.me-strip.is-few .me-tile:nth-child(even) {
  margin-top: 14px;
}

/* ===== Profile, fourth edition: photo and numbers on top, a grid of pieces below, the rest behind ⋯ ===== */
#view-profile {
  max-width: 780px;
  margin: 0 auto;
}

.pf-bar {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-handle {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-bar .icon-button {
  flex: none;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
}

.pf-bar .icon-button svg {
  width: 24px;
  height: 24px;
}

.pf-back {
  margin-left: -10px;
}

.pf-top {
  display: flex;
  align-items: center;
  gap: clamp(18px, 6vw, 56px);
}

.avatar.pf-avatar {
  flex: none;
  width: clamp(86px, 22vw, 150px);
  height: clamp(86px, 22vw, 150px);
  font-size: clamp(34px, 8vw, 58px);
  font-weight: 750;
}

.pf-stats {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: center;
}

.pf-stat {
  display: grid;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.pf-stat strong {
  font-size: clamp(19px, 4.6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.pf-stat span {
  color: var(--muted);
  font-size: clamp(13px, 3.4vw, 15px);
}

.pf-about {
  margin-top: 16px;
  display: grid;
  gap: 4px;
}

.pf-about h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.pf-bio {
  margin: 0;
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pf-worth {
  width: fit-content;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.pf-worth b {
  color: var(--ink);
  font-weight: 750;
}

.pf-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pf-button {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.pf-button:hover {
  background: color-mix(in srgb, var(--ink) 13%, transparent);
}

.pf-button:active {
  transform: scale(0.97);
}

.pf-button-solid {
  background: var(--ink);
  color: var(--surface);
}

.pf-chips {
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pf-chips::-webkit-scrollbar {
  display: none;
}

.pf-chip {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.pf-chip span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pf-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.pf-chip.active span {
  color: inherit;
  opacity: 0.6;
}

.pf-grid {
  margin-top: 18px;
  padding-top: 2px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  border-top: 1px solid var(--line);
}

.pf-cell {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #ececef;
  cursor: pointer;
}

.pf-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease, opacity 200ms ease;
}

.pf-cell:hover img {
  transform: scale(1.04);
}

.pf-cell:active img {
  opacity: 0.75;
}

.pf-cell-name {
  position: absolute;
  inset: 0;
  padding: 10px;
  display: grid;
  place-items: center;
  color: #55555a;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
}

.pf-empty {
  grid-column: 1 / -1;
  padding: 56px 20px;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.pf-empty h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.pf-empty p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 15px;
}

/* Sheets: the ⋯ menu, the edit form, the phone steps. */
.pf-sheet {
  width: min(460px, calc(100% - 32px));
}

.pf-grabber {
  display: none;
}

.pf-menu-list {
  padding: 10px;
  display: grid;
  gap: 2px;
}

.pf-item {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.pf-item[hidden] {
  display: none;
}

.pf-item svg {
  flex: none;
  width: 22px;
  height: 22px;
}

.pf-item > span {
  flex: 1;
}

button.pf-item:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.pf-item-static {
  cursor: default;
}

.pf-item-danger {
  color: #d92d20;
}

.pf-edit .profile-form {
  padding: 0 0 22px;
  display: grid;
  gap: 0;
}

.pf-edit-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.pf-edit-bar h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
}

.pf-edit-bar .button {
  width: fit-content;
  min-height: 40px;
  padding: 0 12px;
  font-size: 15px;
}

.pf-edit-bar .pf-done {
  justify-self: end;
  color: #1f6feb;
  font-weight: 750;
}

.pf-edit-photo {
  padding: 24px 20px 18px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.pf-edit-photo .avatar {
  width: 96px;
  height: 96px;
  font-size: 38px;
}

.pf-edit-photo > div {
  display: flex;
  gap: 18px;
}

.pf-link {
  padding: 0;
  border: 0;
  background: none;
  color: #1f6feb;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.pf-link-muted {
  color: var(--muted);
  font-weight: 600;
}

.pf-field {
  margin: 0 20px;
  padding: 14px 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.pf-field > span:first-child {
  color: var(--muted);
}

.pf-field input[type="text"] {
  width: 100%;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.pf-field-switch {
  grid-template-columns: minmax(0, 1fr) auto;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
}

.pf-field-switch .set-text {
  color: var(--ink);
}

.pf-phone .phone-card {
  padding: 0 24px 24px;
  border: 0;
  background: none;
}

.pf-phone .phone-steps {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 640px) {
  .pf-bar {
    margin-bottom: 16px;
  }

  .pf-chips {
    margin: 18px -20px 0;
    padding: 0 20px;
  }

  .pf-grid {
    margin-left: -20px;
    margin-right: -20px;
    gap: 2px;
  }

  .pf-cell {
    border-radius: 0;
  }

  /* On a phone every sheet rises from the bottom edge. */
  .pf-sheet {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 24px 24px 0 0;
  }

  .pf-sheet[open] {
    animation: pf-rise 300ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  }

  .pf-grabber {
    width: 40px;
    height: 5px;
    margin: 10px auto 2px;
    display: block;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 18%, transparent);
  }
}

@keyframes pf-rise {
  from {
    transform: translateY(100%);
  }
}

@media (prefers-color-scheme: dark) {
  .pf-cell {
    background: #2a2a2d;
  }

  .pf-item-danger {
    color: #ff6b5e;
  }

  .pf-link,
  .pf-edit-bar .pf-done {
    color: #6aa8ff;
  }
}

/* Menu rows show keyboard focus as a tint, not a ring around the first row when the sheet opens. */
.pf-item:focus,
.pf-item:focus-visible {
  outline: none;
}

@media (hover: hover) {
  button.pf-item:focus-visible {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
  }
}

/* ===== Profile, Drobe's own take: a wardrobe-mix ring and a mosaic of pieces ===== */
:root {
  --mix-1: #2a78d6;
  --mix-2: #eb6834;
  --mix-3: #1baf7a;
  --mix-4: #eda100;
  --mix-5: #e87ba4;
  --mix-other: #a9a9b2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mix-1: #3987e5;
    --mix-2: #d95926;
    --mix-3: #199e70;
    --mix-4: #c98500;
    --mix-5: #d55181;
    --mix-other: #6b6b74;
  }
}

.pf-ring {
  flex: none;
  padding: 10px;
  display: grid;
  border-radius: 50%;
  background: var(--line);
  animation: pf-ring-in 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pf-ring .avatar.pf-avatar {
  box-shadow: 0 0 0 4px var(--background);
}

@keyframes pf-ring-in {
  from {
    transform: rotate(-90deg) scale(0.9);
    opacity: 0;
  }
}

.pf-ring .avatar {
  animation: pf-avatar-in 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes pf-avatar-in {
  from {
    transform: rotate(90deg);
  }
}

.pf-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pf-chip.active .pf-dot {
  box-shadow: 0 0 0 1.5px var(--surface);
}

#view-profile .pf-grid {
  margin: 18px 0 0;
  padding: 0;
  gap: 6px;
  border: 0;
  grid-auto-flow: dense;
}

#view-profile .pf-cell {
  border-radius: 16px;
  background: var(--surface);
  animation: pf-cell-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pf-cell:nth-child(2) { animation-delay: 30ms; }
.pf-cell:nth-child(3) { animation-delay: 60ms; }
.pf-cell:nth-child(4) { animation-delay: 90ms; }
.pf-cell:nth-child(5) { animation-delay: 120ms; }
.pf-cell:nth-child(6) { animation-delay: 150ms; }
.pf-cell:nth-child(n + 7) { animation-delay: 180ms; }

@keyframes pf-cell-in {
  from {
    transform: translateY(14px) scale(0.97);
    opacity: 0;
  }
}

#view-profile .pf-cell.is-big {
  grid-column: span 2;
  grid-row: span 2;
  border-radius: 22px;
}

#view-profile .pf-cell.is-big.is-right {
  grid-column: 2 / span 2;
}

.pf-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 44px 16px 14px;
  display: grid;
  gap: 3px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.62));
  color: #fff;
  text-align: left;
  pointer-events: none;
}

.pf-caption small {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.pf-caption b {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: clamp(14px, 3.6vw, 18px);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

@media (prefers-reduced-motion: reduce) {
  .pf-ring,
  .pf-ring .avatar,
  #view-profile .pf-cell {
    animation: none;
  }
}

.pf-still .pf-ring,
.pf-still .pf-ring .avatar {
  animation: none;
}

/* ===== Profile, fifth edition: a bold centred hero, then cards of rows. No clothes wall. ===== */
:root {
  --sp-hero: #2f4638;
}

#view-profile {
  max-width: 640px;
}

#view-profile .pf-bar {
  position: relative;
  z-index: 2;
  margin: 0 0 -54px;
  padding: 12px 12px 0;
  color: #fff;
}

#view-profile .pf-bar .icon-button {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#view-profile .pf-handle {
  visibility: hidden;
}

#view-profile.is-finances .pf-bar {
  margin-bottom: 18px;
  padding: 0;
  color: var(--ink);
}

#view-profile.is-finances .pf-bar .icon-button {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}

#view-profile.is-finances .pf-handle {
  visibility: visible;
}

.sp-hero {
  padding: 62px 24px 26px;
  display: grid;
  justify-items: center;
  border-radius: 32px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    var(--sp-hero);
  color: #fff;
  text-align: center;
}

.sp-hero .pf-ring {
  padding: 11px;
  background: rgba(255, 255, 255, 0.22);
}

.sp-hero .pf-ring .avatar.pf-avatar {
  width: 124px;
  height: 124px;
  background: #f2f2f4;
  color: #1b1b1f;
  font-size: 50px;
  box-shadow: 0 0 0 5px var(--sp-hero);
}

.sp-hero h2 {
  margin: 18px 0 0;
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-handle {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  font-weight: 600;
}

.sp-bio {
  margin: 12px 0 0;
  max-width: 40ch;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sp-facts {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.sp-fact {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.sp-fact:hover {
  background: rgba(255, 255, 255, 0.22);
}

.sp-fact:active {
  transform: scale(0.96);
}

.sp-fact b {
  color: #fff;
  font-weight: 800;
}

.sp-cards {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.sp-card {
  padding: 18px 8px 8px;
  border-radius: 26px;
  background: var(--surface);
  animation: pf-cell-in 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sp-card:nth-child(2) { animation-delay: 50ms; }
.sp-card:nth-child(3) { animation-delay: 100ms; }
.sp-card:nth-child(4) { animation-delay: 150ms; }
.sp-card:nth-child(5) { animation-delay: 200ms; }

.sp-card h3 {
  margin: 0 12px 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.sp-row {
  width: 100%;
  min-height: 62px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 18px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.sp-row:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.sp-row:active {
  transform: scale(0.985);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.sp-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
}

.sp-icon svg {
  width: 22px;
  height: 22px;
}

.sp-tint-1 { background: var(--mix-1); }
.sp-tint-2 { background: var(--mix-2); }
.sp-tint-3 { background: var(--mix-3); }
.sp-tint-4 { background: var(--mix-4); }
.sp-tint-5 { background: var(--mix-5); }
.sp-tint-other { background: #77777f; }

.sp-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sp-text strong {
  font-size: 16px;
  font-weight: 700;
}

.sp-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-chevron {
  flex: none;
  width: 20px;
  height: 20px;
  color: color-mix(in srgb, var(--ink) 30%, transparent);
}

.sp-chevron svg {
  width: 100%;
  height: 100%;
}

.sp-mix {
  margin: 2px 12px 10px;
  display: grid;
  gap: 12px;
}

.sp-bar {
  height: 12px;
  display: flex;
  gap: 3px;
}

.sp-bar span {
  min-width: 6px;
  border-radius: 999px;
}

.sp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.sp-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.sp-key b {
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Highlights: favorite piece and most valuable piece, side by side. */
.hl-row {
  margin: 0 8px 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hl-row.is-single {
  grid-template-columns: minmax(0, 1fr);
}

#view-person .hl-row {
  max-width: 640px;
  margin: 0 0 28px;
}

.hl-tile {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  display: block;
  border: 0;
  border-radius: 20px;
  background: #ececef;
  color: #fff;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease;
}

.hl-row.is-single .hl-tile {
  aspect-ratio: 16 / 10;
}

.hl-tile:active {
  transform: scale(0.97);
}

.hl-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hl-text {
  position: absolute;
  inset: auto 0 0;
  padding: 50px 14px 14px;
  display: grid;
  gap: 3px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
}

.hl-tile small {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hl-tile b {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hl-tile em {
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  opacity: 0.85;
}

.hl-hidden {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 11px;
  font-weight: 700;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hl-empty {
  padding: 16px;
  display: grid;
  align-content: end;
  gap: 4px;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 22%, transparent);
  background: none;
  color: var(--ink);
}

.hl-empty small,
.hl-empty em {
  color: var(--muted);
  opacity: 1;
}

/* The star in a piece's detail view. */
.fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.fav-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
}

.fav-toggle.active {
  color: #c98500;
}

.fav-toggle.active svg {
  fill: currentColor;
}

.detail-dialog.is-readonly #fav-item {
  display: none;
}

.pf-menu-title {
  margin: 12px 14px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pf-menu-list .toggle-row {
  border: 0;
  cursor: pointer;
}

@media (max-width: 640px) {
  #view-profile .pf-bar {
    padding: 10px 10px 0;
  }

  .sp-hero {
    border-radius: 28px;
  }

  .hl-tile b {
    font-size: 14px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --sp-hero: #22332a;
  }

  .hl-tile {
    background: #2a2a2d;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-card {
    animation: none;
  }
}

/* Phone: four actions under a piece don't fit as words, so the star goes icon-only. */
@media (max-width: 640px) {
  .detail-actions {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .detail-actions .button {
    white-space: nowrap;
  }

  /* A long store name gives way instead of pushing Edit off the screen. */
  .detail-actions .detail-link {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .detail-actions .fav-toggle {
    flex: none;
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ink) 7%, transparent);
  }

  .detail-actions .fav-toggle span {
    display: none;
  }

  .detail-actions .fav-toggle svg {
    width: 22px;
    height: 22px;
  }

  .detail-actions #remove-item {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* ===== ⋯ menu, detailed: who you are on top, then grouped rows with a line of detail each ===== */
#pf-menu {
  width: min(480px, calc(100% - 32px));
  background: var(--background);
}

.pf-menu-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 16px 16px 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--background);
}

.pf-menu-head .avatar {
  flex: none;
  width: 52px;
  height: 52px;
  font-size: 21px;
}

.pf-menu-head .pf-label strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.pf-menu-head .icon-button {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
}

.pf-menu-head .icon-button svg {
  width: 18px;
  height: 18px;
}

#pf-menu .pf-menu-list {
  padding: 0 14px 18px;
  display: block;
}

#pf-menu .pf-menu-title {
  margin: 16px 10px 8px;
}

.pf-group {
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface);
}

.pf-group + .pf-group {
  margin-top: 16px;
}

#pf-menu .pf-item {
  min-height: 62px;
  padding: 9px 14px;
  border-radius: 0;
  font-weight: 500;
}

#pf-menu .pf-item + .pf-item {
  box-shadow: inset 0 1px 0 var(--line);
}

.pf-glyph {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.pf-item .pf-glyph svg {
  width: 20px;
  height: 20px;
}

.pf-label {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pf-label strong {
  font-size: 15.5px;
  font-weight: 700;
}

.pf-label small {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-item .pf-go {
  flex: none;
  width: 18px;
  height: 18px;
  color: color-mix(in srgb, var(--ink) 30%, transparent);
}

#pf-menu .pf-item-danger .pf-glyph {
  background: color-mix(in srgb, #d92d20 12%, transparent);
}

#pf-menu .theme-switch {
  flex: none;
}

@media (max-width: 640px) {
  #pf-menu {
    width: 100%;
    max-height: 88dvh;
  }
}

@media (max-width: 380px) {
  #pf-menu .theme-switch .design-option {
    padding-left: 10px;
    padding-right: 10px;
  }
}

#pf-menu .pf-item > .pf-glyph {
  flex: none;
}

/* ===== Header bell, replacing the profile photo ===== */
.bell {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.bell:hover {
  background: color-mix(in srgb, var(--ink) 12%, transparent);
}

.bell:active {
  transform: scale(0.94);
}

.bell svg {
  width: 23px;
  height: 23px;
}

.bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid var(--background);
  border-radius: 999px;
  background: #e5342b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.bell-badge[hidden] {
  display: none;
}

#pf-notes {
  width: min(460px, calc(100% - 32px));
}

#pf-notes .pf-menu-head {
  background: var(--surface);
}

.notes-list {
  padding: 0 18px 22px;
}

.notes-list .person-row {
  padding: 12px 0;
}

.notes-empty {
  padding: 34px 12px 40px;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.notes-empty strong {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.notes-empty span {
  color: var(--muted);
  font-size: 14.5px;
}

/* ===== Wardrobe feed: one full-width post per piece, scrolled like a timeline ===== */
.stage[data-design="feed"] {
  min-height: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.feed {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 26px;
}

.feed-post {
  overflow: hidden;
  border-radius: 28px;
  background: var(--surface);
}

.feed-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-mark {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-size: 16px;
  font-weight: 800;
}

.feed-who {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.feed-who strong {
  font-size: 15px;
  font-weight: 750;
}

.feed-who span {
  color: var(--muted);
  font-size: 13px;
}

.feed-fav {
  flex: none;
  padding: 6px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, #c98500 16%, transparent);
  color: #9a6600;
  font-size: 12px;
  font-weight: 750;
}

.feed-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  display: block;
  border: 0;
  background: #ececef;
  cursor: pointer;
}

.feed-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feed-blank {
  padding: 20px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.feed-foot {
  padding: 16px 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feed-text {
  flex: 1;
  min-width: 0;
}

.feed-text h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.feed-text p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.feed-price {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .feed {
    gap: 14px;
  }

  .feed-post {
    margin: 0 -8px;
    border-radius: 24px;
  }
}

@media (prefers-color-scheme: dark) {
  .feed-photo {
    background: #2a2a2d;
  }

  .feed-fav {
    color: #f0b63a;
  }
}

/* Phone: four wardrobe views plus three groupings must share one row. */
@media (max-width: 640px) {
  #view-wardrobe .design-switch .design-option {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 13.5px;
  }
}

/* ===== Profile, sixth edition: the profile is a garment tag on a string ===== */
:root {
  --tag-paper: #f4efe3;
  --tag-ink: #1c1a15;
  --tag-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

#view-profile .pf-bar {
  margin: 0 0 -6px;
  padding: 0;
  color: var(--ink);
}

#view-profile .pf-bar .icon-button {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#view-profile #profile-card {
  position: relative;
  padding-top: 46px;
  overflow: visible;
  display: grid;
  justify-items: center;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--tag-ink);
  perspective: 1100px;
}

.tag-string {
  position: absolute;
  top: -40px;
  left: 50%;
  width: 2px;
  height: 116px;
  margin-left: -1px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--ink) 45%, transparent) 40%);
  transform-origin: top center;
  animation: tag-sway 5.5s ease-in-out 1.1s infinite;
}

.tag {
  --lean-x: 0deg;
  --lean-y: 0deg;
  --light-x: 50%;
  --light-y: 20%;
  position: relative;
  width: min(100%, 430px);
  padding: 58px 26px 22px;
  border-radius: 28px;
  background:
    repeating-linear-gradient(97deg, rgba(120, 100, 60, 0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(8deg, rgba(120, 100, 60, 0.03) 0 1px, transparent 1px 7px),
    var(--tag-paper);
  box-shadow:
    inset 0 0 0 1px rgba(60, 45, 20, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 4px rgba(40, 30, 10, 0.08),
    0 36px 60px -28px rgba(40, 30, 10, 0.45);
  color: var(--tag-ink);
  transform: rotateX(var(--lean-x)) rotateY(var(--lean-y));
  transform-origin: 50% 30px;
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: tag-drop 1.1s cubic-bezier(0.3, 1.5, 0.5, 1) both, tag-sway 5.5s ease-in-out 1.1s infinite;
  touch-action: pan-y;
}

.tag.is-held {
  transition: transform 90ms linear;
}

@keyframes tag-drop {
  0% { rotate: -14deg; translate: 0 -30px; opacity: 0; }
  35% { opacity: 1; }
  55% { rotate: 6deg; translate: 0 0; }
  75% { rotate: -3deg; }
  100% { rotate: 0deg; }
}

@keyframes tag-sway {
  0%, 100% { rotate: 0deg; }
  30% { rotate: 0.9deg; }
  70% { rotate: -0.9deg; }
}

.pf-still .tag {
  animation: tag-sway 5.5s ease-in-out infinite;
}

.tag-hole {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: var(--background);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.28), 0 0 0 4px rgba(60, 45, 20, 0.12);
}

.tag-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(60% 45% at var(--light-x) var(--light-y), rgba(255, 255, 255, 0.75), transparent 70%);
  mix-blend-mode: soft-light;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.tag.is-held .tag-sheen {
  opacity: 1;
}

.tag-top {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  font-family: var(--tag-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  opacity: 0.62;
}

.tag-who {
  display: grid;
  justify-items: center;
  text-align: center;
}

.tag .pf-ring {
  padding: 10px;
  background: rgba(60, 45, 20, 0.12);
}

.tag .pf-ring .avatar.pf-avatar {
  width: 116px;
  height: 116px;
  background: #e6dfd0;
  color: var(--tag-ink);
  font-size: 46px;
  box-shadow: 0 0 0 5px var(--tag-paper);
}

.tag-who h2 {
  margin: 16px 0 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--tag-ink);
  font-size: clamp(28px, 7.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-handle {
  margin: 5px 0 0;
  font-family: var(--tag-mono);
  font-size: 13px;
  opacity: 0.6;
}

.tag-bio {
  margin: 12px 0 0;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tag-rows {
  margin: 22px -26px 0;
  padding: 16px 26px;
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 12px 10px;
  border-top: 1.5px dashed rgba(60, 45, 20, 0.28);
  border-bottom: 1.5px dashed rgba(60, 45, 20, 0.28);
}

.tag-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: inherit;
  text-decoration: none;
}

.tag-cell dt,
.tag-label {
  font-family: var(--tag-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.58;
}

.tag-cell dd {
  margin: 0;
  font-size: clamp(17px, 4.6vw, 21px);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tag-made {
  margin-top: 16px;
  display: grid;
  gap: 9px;
}

.tag-bar {
  height: 8px;
  display: flex;
  gap: 2px;
}

.tag-bar span {
  min-width: 4px;
  border-radius: 2px;
}

.tag-lines {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-family: var(--tag-mono);
  font-size: 12.5px;
  line-height: 1.5;
}

.tag-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tag-code {
  margin-top: 18px;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.tag-bars {
  height: 42px;
  max-width: 100%;
  overflow: hidden;
  display: flex;
}

.tag-bars i {
  flex: none;
  height: 100%;
  background: var(--tag-ink);
}

.tag-code span {
  font-family: var(--tag-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  opacity: 0.6;
}

/* Highlights as prints: a stitched label for the favorite, a price tag on a string for the priciest. */
.hl-row {
  margin: 6px 12px 12px;
  gap: 16px;
}

button.hl-tile {
  aspect-ratio: auto;
  padding: 8px 8px 12px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.4);
  color: var(--ink);
  transition: rotate 300ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 180ms ease;
}

button.hl-loved {
  rotate: -2deg;
}

button.hl-prized {
  rotate: 2deg;
}

button.hl-tile:hover {
  rotate: 0deg;
}

.hl-row.is-single button.hl-tile {
  aspect-ratio: auto;
  rotate: 0deg;
}

.hl-frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: block;
  border-radius: 12px;
  background: #ececef;
}

.hl-row.is-single .hl-frame {
  aspect-ratio: 16 / 10;
}

button.hl-tile .hl-text {
  position: static;
  padding: 12px 4px 2px;
  background: none;
}

button.hl-tile small {
  color: var(--muted);
  opacity: 1;
}

button.hl-tile em {
  color: var(--muted);
  opacity: 1;
}

.hl-woven {
  position: absolute;
  top: 20px;
  left: -8px;
  z-index: 1;
  padding: 7px 11px;
  border-radius: 4px;
  background: #2f4638;
  color: #f4efe3;
  font-family: var(--tag-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  outline: 1px dashed rgba(244, 239, 227, 0.6);
  outline-offset: -4px;
  rotate: -5deg;
  box-shadow: 0 6px 12px -6px rgba(0, 0, 0, 0.5);
}

.hl-pricetag,
.look-price {
  position: absolute;
  top: -8px;
  right: 16px;
  z-index: 1;
  padding: 22px 11px 9px;
  display: grid;
  justify-items: center;
  background: var(--tag-paper);
  color: var(--tag-ink);
  clip-path: polygon(50% 0, 100% 16px, 100% 100%, 0 100%, 0 16px);
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.28));
  transform-origin: 50% 0;
  animation: price-swing 3.4s ease-in-out infinite;
}

.hl-pricetag i,
.look-price i {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
}

.hl-pricetag b,
.look-price b {
  font-family: var(--tag-mono);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

@keyframes price-swing {
  0%, 100% { rotate: 5deg; }
  50% { rotate: -5deg; }
}

button.hl-tile .hl-hidden {
  top: auto;
  bottom: 84px;
  left: 16px;
}

a.hl-empty {
  min-height: 220px;
  border-radius: 18px;
}

/* ===== Wardrobe feed, second edition: a lookbook. Numbered pages that arrive as you scroll. ===== */
.feed {
  max-width: 1000px;
  gap: 0;
}

.look {
  position: relative;
  padding: 46px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
}

.look + .look {
  border-top: 1px solid var(--line);
}

.look.is-flipped .look-photo {
  order: 2;
}

.look-number {
  position: absolute;
  top: 6px;
  right: -8px;
  z-index: 0;
  color: transparent;
  font-size: clamp(120px, 22vw, 260px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.8;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--ink) 13%, transparent);
  pointer-events: none;
  translate: 0 70px;
  opacity: 0;
  transition: translate 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 900ms ease;
}

.look.is-flipped .look-number {
  right: auto;
  left: -8px;
}

.look-photo {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 0;
  border-radius: 34px;
  background: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(54px) scale(0.94) rotate(-2.5deg);
  transition: transform 1s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 700ms ease;
}

.look.is-flipped .look-photo {
  transform: translateY(54px) scale(0.94) rotate(2.5deg);
}

.look-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  box-shadow: 0 40px 70px -40px rgba(0, 0, 0, 0.5);
  transition: scale 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.look-photo:hover img {
  scale: 1.02;
}

.look-photo .hl-woven {
  top: 26px;
  left: -10px;
}

.look-price {
  right: 28px;
  padding: 26px 14px 11px;
}

.look-price b {
  font-size: 14px;
}

.look-text {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 10px;
}

.look-text > * {
  opacity: 0;
  translate: 0 26px;
  transition: translate 800ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 600ms ease;
}

.look-text > :nth-child(2) { transition-delay: 70ms; }
.look-text > :nth-child(3) { transition-delay: 140ms; }
.look-text > :nth-child(4) { transition-delay: 210ms; }
.look-text > :nth-child(5) { transition-delay: 280ms; }

.look.is-in .look-number,
.look.is-in .look-text > * {
  opacity: 1;
  translate: 0 0;
}

.look.is-in .look-photo,
.look.is-in.is-flipped .look-photo {
  opacity: 1;
  transform: none;
}

.look-count {
  margin: 0;
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.look-count b {
  color: var(--ink);
}

.look-kind {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.look-text h3 {
  margin: 0;
  font-size: clamp(27px, 4.2vw, 46px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.04;
  text-wrap: balance;
}

.look-color {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.look-open {
  min-height: 46px;
  margin-top: 8px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, translate 800ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 600ms ease;
}

.look-open:active {
  transform: scale(0.95);
}

@media (max-width: 720px) {
  .look {
    padding: 30px 0 34px;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .look.is-flipped .look-photo {
    order: 0;
  }

  .look-number,
  .look.is-flipped .look-number {
    top: 8px;
    left: auto;
    right: -6px;
    font-size: 132px;
  }

  .look-photo {
    margin-top: 44px;
    border-radius: 28px;
  }

  .look-text h3 {
    font-size: 30px;
  }

  .look-open {
    display: none;
  }

  .tag {
    padding-left: 22px;
    padding-right: 22px;
  }

  .tag-rows {
    margin-left: -22px;
    margin-right: -22px;
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media (max-width: 380px) {
  .tag-rows {
    grid-template-columns: repeat(2, auto);
  }
}

@media (prefers-color-scheme: dark) {
  .hl-frame {
    background: #2a2a2d;
  }

  .tag {
    box-shadow:
      inset 0 0 0 1px rgba(60, 45, 20, 0.1),
      0 36px 70px -30px rgba(0, 0, 0, 0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tag,
  .tag-string,
  .hl-pricetag,
  .look-price {
    animation: none;
  }

  .look-number,
  .look-photo,
  .look.is-flipped .look-photo,
  .look-text > * {
    opacity: 1;
    translate: 0 0;
    transform: none;
    transition: none;
  }
}

@media (max-width: 640px) {
  #view-wardrobe .design-switch .design-option {
    padding-left: 7px;
    padding-right: 7px;
    font-size: 13px;
    letter-spacing: -0.01em;
  }
}

/* ===== Bottom bar: icons only ===== */
@media (max-width: 900px) {
  .tab-bar-link {
    position: relative;
    width: 56px;
    height: 46px;
    place-items: center;
    place-content: center;
    gap: 0;
    border-radius: 999px;
    transition: background 200ms ease, color 200ms ease, transform 150ms ease;
  }

  .tab-bar-link svg {
    width: 26px;
    height: 26px;
  }

  .tab-bar-link.active {
    background: var(--ink);
    color: var(--surface);
  }

  .tab-bar-link:active {
    transform: scale(0.92);
  }

  .tab-bar {
    align-items: center;
    justify-items: center;
  }

  .tab-bar-link .tab-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    margin: 0;
  }
}

/* Wardrobe view settings inside the ⋯ menu. */
#pf-menu .pf-item-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 13px;
  padding-bottom: 13px;
}

#pf-menu .pf-item-stack .design-switch {
  display: flex;
  width: 100%;
}

#pf-menu .pf-item-stack .design-option {
  flex: 1;
  justify-content: center;
  text-align: center;
}

/* ===== The tag has two sides: profile on the front, care label on the back ===== */
.tag {
  --flip: 0deg;
  padding: 0;
  background: none;
  box-shadow: none;
  transform: rotateX(var(--lean-x)) rotateY(calc(var(--lean-y) + var(--flip)));
  transform-style: preserve-3d;
  transition: transform 800ms cubic-bezier(0.3, 1.25, 0.4, 1);
}

.tag.is-flipped {
  --flip: 180deg;
}

.tag-face {
  position: relative;
  padding: 58px 26px 22px;
  border-radius: 28px;
  background:
    repeating-linear-gradient(97deg, rgba(120, 100, 60, 0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(8deg, rgba(120, 100, 60, 0.03) 0 1px, transparent 1px 7px),
    var(--tag-paper);
  box-shadow:
    inset 0 0 0 1px rgba(60, 45, 20, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 4px rgba(40, 30, 10, 0.08),
    0 36px 60px -28px rgba(40, 30, 10, 0.45);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* A row of stitches just inside the edge. */
.tag-face::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1.5px dashed rgba(60, 45, 20, 0.2);
  border-radius: 20px;
  pointer-events: none;
}

.tag-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transform: rotateY(180deg);
}

.tag-sheen {
  border-radius: 28px;
}

.tag-flip {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(60, 45, 20, 0.1);
  color: var(--tag-ink);
  cursor: pointer;
  transition: background 150ms ease, rotate 500ms cubic-bezier(0.3, 1.4, 0.5, 1);
}

.tag-flip:hover {
  background: rgba(60, 45, 20, 0.18);
  rotate: 180deg;
}

.tag-flip svg {
  width: 18px;
  height: 18px;
}

.tag-code {
  padding: 0 44px;
}

.care-title {
  margin: 6px 0 0;
  overflow: hidden;
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.care-list {
  flex: 1;
  margin: 18px -26px 0;
  padding: 6px 26px;
  display: grid;
  align-content: space-evenly;
  border-top: 1.5px dashed rgba(60, 45, 20, 0.28);
  border-bottom: 1.5px dashed rgba(60, 45, 20, 0.28);
}

.care-row {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.care-glyph {
  flex: none;
  width: 34px;
  height: 34px;
}

.care-glyph svg {
  width: 100%;
  height: 100%;
}

.care-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.care-text small {
  font-family: var(--tag-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.58;
}

.care-text b {
  overflow: hidden;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.care-motto {
  margin: 14px 44px 4px 0;
  font-family: var(--tag-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.5;
  opacity: 0.62;
}

@media (max-width: 720px) {
  .tag {
    padding: 0;
  }

  .tag-face {
    padding-left: 22px;
    padding-right: 22px;
  }

  .care-list {
    margin-left: -22px;
    margin-right: -22px;
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media (prefers-color-scheme: dark) {
  .tag {
    box-shadow: none;
  }

  .tag-face {
    box-shadow:
      inset 0 0 0 1px rgba(60, 45, 20, 0.1),
      0 36px 70px -30px rgba(0, 0, 0, 0.9);
  }
}

/* ===== Header tools: settings and notifications side by side ===== */
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

#view-profile:not(.is-finances) .pf-bar {
  display: none;
}

/* ===== The tag hangs from a rig that swings as one piece, string and all ===== */
.tag-rig {
  position: relative;
  width: min(100%, 430px);
  transform-origin: 50% -60px;
  animation: tag-drop 1.1s cubic-bezier(0.3, 1.5, 0.5, 1) both, tag-sway 5.5s ease-in-out 1.1s infinite;
  touch-action: pan-y;
}

.pf-still .tag-rig {
  animation: tag-sway 5.5s ease-in-out infinite;
}

.tag-rig.is-swinging,
.pf-still .tag-rig.is-swinging {
  animation: none;
}

.tag-rig .tag,
.pf-still .tag-rig .tag {
  width: 100%;
  animation: none;
  cursor: grab;
}

.tag-rig.is-swinging .tag {
  cursor: grabbing;
}

.tag-rig .tag-string {
  top: -86px;
  animation: none;
}

#view-profile #profile-card {
  padding-top: 40px;
}

/* Highlights: just the print and what it is. */
button.hl-tile .hl-text {
  padding: 10px 4px 0;
}

@media (prefers-color-scheme: dark) {
  .look-number {
    -webkit-text-stroke-color: color-mix(in srgb, var(--ink) 26%, transparent);
  }
}

/* ===== Start-up: clothes ride past on a rail while Drobe opens ===== */
.boot,
body.signed-out > .boot:not(.auth):not(.toast) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vh, 56px);
  overflow: hidden;
  transition: opacity 480ms ease, transform 520ms cubic-bezier(0.3, 0, 0.2, 1);
}

.boot.is-leaving {
  opacity: 0;
  transform: translateY(-3%) scale(1.03);
  pointer-events: none;
}

.boot-rail {
  position: relative;
  width: 100%;
  padding-top: 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.boot-rail::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: 999px;
  background: var(--ink);
  opacity: 0.86;
}

.boot-track {
  width: max-content;
  display: flex;
  animation: boot-run 22s linear infinite;
}

@keyframes boot-run {
  to { transform: translateX(-50%); }
}

.boot-item {
  position: relative;
  width: clamp(104px, 26vw, 150px);
  margin-right: clamp(18px, 4vw, 30px);
  padding-top: 40px;
  transform-origin: 50% 0;
  animation: boot-swing 1.9s ease-in-out infinite alternate;
}

.boot-item:nth-child(3n + 1) { animation-delay: -0.6s; }
.boot-item:nth-child(3n + 2) { animation-delay: -1.3s; animation-duration: 2.3s; }
.boot-item:nth-child(4n) { animation-duration: 2.6s; }

@keyframes boot-swing {
  from { rotate: -3.5deg; }
  to { rotate: 3.5deg; }
}

/* The hanger: a hook over the rail and two arms down to the print. */
.boot-hook {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 20px;
  margin-left: -7px;
  border: 2.5px solid var(--ink);
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  rotate: -45deg;
}

.boot-item::before,
.boot-item::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 2.5px;
  height: 36px;
  border-radius: 2px;
  background: var(--ink);
  transform-origin: 50% 0;
}

.boot-item::before { rotate: 56deg; }
.boot-item::after { rotate: -56deg; }

.boot-item img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  background: #ececef;
  box-shadow: 0 22px 34px -22px rgba(0, 0, 0, 0.5);
}

.boot-center {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.boot-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.boot-mark svg {
  width: 34px;
  height: 34px;
}

.boot-word {
  margin: 4px 0 0;
  font-family: var(--tag-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
}

.boot-scan {
  position: relative;
  width: 150px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
}

.boot-scan i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: var(--ink);
  animation: boot-scan 1.1s cubic-bezier(0.5, 0, 0.5, 1) infinite alternate;
}

@keyframes boot-scan {
  from { translate: -20% 0; }
  to { translate: 160% 0; }
}

.boot-note {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

@media (prefers-color-scheme: dark) {
  .boot-item img {
    background: #2a2a2d;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-track,
  .boot-item,
  .boot-scan i {
    animation: none;
  }
}

/* ===== Wardrobe, kept simple: no title, no words. One photo after another. ===== */
#view-wardrobe .wardrobe-heading {
  display: none;
}

.feed {
  max-width: 560px;
  gap: 14px;
}

.look,
.look + .look {
  margin: 0;
  padding: 0;
  display: block;
  border: 0;
}

.look-photo,
.look.is-flipped .look-photo {
  width: 100%;
  margin: 0;
  display: block;
  border-radius: 28px;
  transform: translateY(26px);
}

.look.is-in .look-photo,
.look.is-in.is-flipped .look-photo {
  transform: none;
}

.look-photo img {
  box-shadow: none;
}

@media (max-width: 720px) {
  .feed {
    gap: 10px;
  }

  .look-photo,
  .look.is-flipped .look-photo {
    width: 100%;
    margin: 0;
    border-radius: 24px;
  }
}

/* ===== Start-up, same language as the sign-in page: a dark, tilted wall of pieces rolling by ===== */
.boot,
body.signed-out > .boot:not(.auth):not(.toast) {
  display: block;
  background: #0b0b0d;
  color: #fff;
}

.boot-wall {
  position: absolute;
  inset: 0;
  overflow: hidden;
  perspective: 1300px;
}

.boot-wall .auth-show-grid {
  inset: -30% -22%;
  gap: 18px;
}

.boot-wall .auth-col {
  animation-duration: 26s;
}

.boot-wall .auth-col:nth-child(2) {
  animation-duration: 32s;
}

.boot-wall .auth-col:nth-child(3) {
  animation-duration: 29s;
}

.boot-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 45% at 50% 62%, rgba(11, 11, 13, 0.9), transparent 75%),
    linear-gradient(180deg, rgba(11, 11, 13, 0.55), rgba(11, 11, 13, 0.1) 30%, rgba(11, 11, 13, 0.96) 88%);
}

.boot-center {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(70px, 16vh, 150px);
}

.boot-mark {
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
}

.boot-word {
  color: #fff;
}

.boot-scan {
  background: rgba(255, 255, 255, 0.2);
}

.boot-scan i {
  background: #fff;
}

.boot-note {
  color: rgba(255, 255, 255, 0.62);
}

@media (min-width: 900px) {
  .boot-wall .auth-show-grid {
    inset: -30% 10%;
  }
}

/* ===== Wardrobe: a little separation, so each piece sits on its own card ===== */
.feed {
  gap: 22px;
}

.look-photo,
.look.is-flipped .look-photo {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 34px -26px rgba(0, 0, 0, 0.35);
}

@media (max-width: 720px) {
  .feed {
    gap: 18px;
  }
}

/* ===== ⋯ lives on the profile page again, top right ===== */
#view-profile {
  position: relative;
}

#view-profile:not(.is-finances) .pf-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

#view-profile:not(.is-finances) .pf-bar .pf-handle {
  display: none;
}

#view-profile .pf-bar .pf-more {
  pointer-events: auto;
}

#view-profile.is-finances .pf-bar .pf-more {
  display: none;
}

/* ===== Profile, bottom: your pieces drifting sideways on their own ===== */
.pf-gallery {
  margin: 22px calc(50% - 50vw) 0;
  padding: 6px 0 26px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.pf-gallery[hidden] {
  display: none;
}

.pf-gallery-track {
  width: max-content;
  display: flex;
  animation: pf-drift 40s linear infinite;
}

.pf-gallery:hover .pf-gallery-track,
.pf-gallery:active .pf-gallery-track,
.pf-gallery:focus-within .pf-gallery-track {
  animation-play-state: paused;
}

@keyframes pf-drift {
  to { transform: translateX(-50%); }
}

.pf-gallery-tile {
  flex: none;
  width: clamp(128px, 34vw, 190px);
  aspect-ratio: 4 / 5;
  margin-right: 12px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pf-gallery-tile:hover {
  transform: translateY(-6px);
}

.pf-gallery-tile:active {
  transform: scale(0.96);
}

.pf-gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .pf-gallery {
    overflow-x: auto;
  }

  .pf-gallery-track {
    animation: none;
  }
}

/* The gallery runs edge to edge; never let that widen the page. */
html {
  overflow-x: clip;
}

/* =====================================================================
   One material for the whole app: warm paper, ink, and label type.
   ===================================================================== */
:root {
  --background: #f4f1ea;
  --surface: #fcfaf5;
  --ink: #15130f;
  --muted: #736d62;
  --line: #e2dccf;
  --accent: #15130f;
  --accent-hover: #2e2a23;
  --on-accent: #fcfaf5;
  --soft-green: #ebe6da;
  --photo: #ebe6da;
  --tag-paper: #fffdf6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f0e0c;
    --surface: #1b1a17;
    --ink: #f3efe6;
    --muted: #a39d90;
    --line: #2d2b26;
    --accent: #f3efe6;
    --accent-hover: #d8d2c4;
    --on-accent: #15130f;
    --soft-green: #25231f;
    --photo: #ece8df;
    --tag-paper: #f4efe3;
  }
}

body {
  background: var(--background);
  color: var(--ink);
}

.site-header {
  background: color-mix(in srgb, var(--background) 86%, transparent);
  border-bottom-color: var(--line);
}

.eyebrow,
.pf-section,
.sp-card h3,
.pf-menu-title {
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.search-box,
.sort-box,
.bell,
.design-switch {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

@media (max-width: 900px) {
  .tab-bar {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: 0 14px 40px -14px rgba(40, 30, 10, 0.4), 0 0 0 1px var(--line);
  }
}

/* Product photos come on a cold grey backdrop. On paper they are multiplied in, so the
   backdrop takes the page's own tone and only the garment stands out. */
.look-photo,
.look.is-flipped .look-photo,
.pf-gallery-tile,
.hl-frame,
.tile-media {
  border: 0;
  background: var(--photo);
  box-shadow: none;
}

.look-photo img,
.pf-gallery-tile img,
.hl-frame img,
.tile-media img {
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .look-photo img,
  .pf-gallery-tile img,
  .hl-frame img,
  .tile-media img {
    mix-blend-mode: normal;
  }
}

.look-photo img {
  background: none !important;
}

/* ===== Profile, composed: a title row, the tag, then two labelled sections ===== */
#view-profile:not(.is-finances) .pf-bar {
  position: static;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}

#view-profile:not(.is-finances) .pf-bar .pf-handle {
  display: block;
  visibility: visible;
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

#view-profile #profile-card {
  padding-top: 30px;
}

.tag-rig .tag-string {
  top: -70px;
  height: 100px;
}

.tag-face {
  box-shadow:
    inset 0 0 0 1px rgba(60, 45, 20, 0.1),
    0 1px 2px rgba(40, 30, 10, 0.08),
    0 30px 50px -30px rgba(40, 30, 10, 0.4);
}

.sp-cards {
  margin-top: 34px;
  gap: 30px;
}

.sp-card,
.sp-card:nth-child(n) {
  padding: 0;
  border-radius: 0;
  background: none;
}

.sp-card h3,
.pf-section {
  margin: 0 0 14px;
}

.pf-section {
  margin-top: 34px;
}

.pf-section[hidden] {
  display: none;
}

.hl-row {
  margin: 0;
  gap: 14px;
}

button.hl-tile {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  rotate: 0deg;
}

button.hl-tile:hover {
  transform: translateY(-4px);
}

.hl-frame,
.hl-row.is-single .hl-frame {
  border-radius: 24px;
}

.hl-row.is-single .hl-frame {
  aspect-ratio: 16 / 11;
}

.hl-row.is-single .hl-frame img {
  object-fit: contain;
}

button.hl-tile .hl-text {
  padding: 10px 2px 0;
}

button.hl-tile small {
  font-family: var(--tag-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

button.hl-tile .hl-hidden {
  top: 12px;
  bottom: auto;
  left: 12px;
}

.pf-gallery {
  margin-top: 0;
  padding-top: 0;
}

.pf-gallery-tile {
  border-radius: 20px;
}

.feed {
  gap: 16px;
}

@media (max-width: 720px) {
  .tag-rig {
    width: min(100%, 336px);
  }

  .tag-face {
    padding: 50px 20px 18px;
  }

  .tag .pf-ring .avatar.pf-avatar {
    width: 92px;
    height: 92px;
    font-size: 36px;
  }

  .tag-who h2 {
    margin-top: 12px;
    font-size: 28px;
  }

  .tag-rows {
    margin: 16px -20px 0;
    padding: 13px 20px;
  }

  .tag-cell dd {
    font-size: 17px;
  }

  .tag-made {
    margin-top: 13px;
  }

  .tag-code {
    margin-top: 14px;
  }

  .tag-bars {
    height: 34px;
  }

  .care-list {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ===== Start-up follows the app's appearance: paper in light, near-black in dark ===== */
.boot,
body.signed-out > .boot:not(.auth):not(.toast) {
  background: var(--background);
  color: var(--ink);
}

.boot-wall::after {
  background:
    radial-gradient(70% 45% at 50% 62%, color-mix(in srgb, var(--background) 92%, transparent), transparent 75%),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--background) 55%, transparent),
      color-mix(in srgb, var(--background) 8%, transparent) 30%,
      color-mix(in srgb, var(--background) 97%, transparent) 88%
    );
}

.boot-wall .auth-tile {
  background: var(--photo);
}

.boot-wall .auth-tile img {
  mix-blend-mode: multiply;
}

.boot-mark {
  box-shadow: 0 20px 44px -14px color-mix(in srgb, var(--ink) 45%, transparent);
}

.boot-word {
  color: var(--ink);
}

.boot-scan {
  background: color-mix(in srgb, var(--ink) 16%, transparent);
}

.boot-scan i {
  background: var(--ink);
}

.boot-note {
  color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  .boot-wall .auth-tile img {
    mix-blend-mode: normal;
  }
}

/* ===== Browse and Friends open straight on their search, like Wardrobe ===== */
#view-browse .wardrobe-heading,
#view-friends .wardrobe-heading {
  display: none;
}

/* Browse: a big search first, then a grid with a wide piece every so often for rhythm. */
#view-browse .search-box {
  min-height: 56px;
}

#view-browse .browse-summary {
  margin: 26px 0 16px;
}

#view-browse .browse-summary h2 {
  font-size: clamp(24px, 4vw, 34px);
}

#view-browse .browse-grid {
  grid-auto-flow: dense;
  gap: 22px 14px;
}

#view-browse .browse-grid > .tile:nth-child(9n + 1) {
  grid-column: span 2;
}

#view-browse .browse-grid > .tile:nth-child(9n + 1) .tile-media {
  aspect-ratio: 2 / 1.18;
}

#view-browse .browse-grid > .tile:nth-child(9n + 1) .tile-media img {
  object-fit: cover;
  object-position: 50% 28%;
}

#view-browse .tile-media {
  border-radius: 24px;
}

#view-browse .tile-brand {
  font-family: var(--tag-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

/* ===== Friends: requests as cards, friends as a look into their wardrobes ===== */
.fr-label {
  margin: 30px 0 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.fr-label:first-child {
  margin-top: 6px;
}

.fr-label span {
  opacity: 0.6;
}

.fr-asks {
  display: grid;
  gap: 10px;
}

.fr-ask {
  padding: 14px 14px 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 24px;
  background: var(--ink);
  color: var(--surface);
}

.fr-ask .fr-who {
  color: inherit;
}

.fr-ask .fr-text small {
  color: color-mix(in srgb, var(--surface) 68%, transparent);
}

.fr-ask .person-actions {
  display: flex;
  gap: 6px;
}

.fr-ask .button-primary {
  background: var(--surface);
  color: var(--ink);
}

.fr-ask .button-plain {
  color: color-mix(in srgb, var(--surface) 78%, transparent);
}

.fr-who {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.avatar.fr-avatar {
  flex: none;
  width: 48px;
  height: 48px;
  font-size: 19px;
}

.fr-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.fr-text strong {
  overflow: hidden;
  font-size: 16.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fr-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fr-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

.fr-card {
  padding: 16px;
  display: grid;
  gap: 14px;
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease;
}

.fr-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px -28px rgba(40, 30, 10, 0.45);
}

.fr-card:active {
  transform: scale(0.985);
}

.fr-go {
  flex: none;
  width: 20px;
  height: 20px;
  color: color-mix(in srgb, var(--ink) 30%, transparent);
}

.fr-go svg {
  width: 100%;
  height: 100%;
}

.fr-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.fr-shot {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 14px;
  background: var(--photo);
}

.fr-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  mix-blend-mode: multiply;
}

.fr-shot.is-blank {
  opacity: 0.45;
}

.fr-shot b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 14, 12, 0.55);
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.fr-sent {
  padding: 4px 16px;
  border-radius: 24px;
  background: var(--surface);
}

@media (prefers-color-scheme: dark) {
  .fr-shot img {
    mix-blend-mode: normal;
  }
}

/* ===== Notifications sheet: full width on a phone, rows that never squeeze ===== */
#pf-notes {
  background: var(--background);
}

#pf-notes .pf-menu-head {
  padding: 16px 16px 8px 22px;
  background: var(--background);
}

#pf-notes .pf-menu-head .pf-label strong {
  font-size: 22px;
}

.notes-list {
  padding: 0 14px calc(22px + env(safe-area-inset-bottom));
}

.notes-list .pf-menu-title {
  margin: 10px 8px 10px;
}

.notes-list .person-row {
  margin-bottom: 8px;
  padding: 12px 12px 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
}

.notes-list .person-link {
  flex: 1 1 180px;
  min-width: 0;
}

.notes-list .person-actions {
  display: flex;
  gap: 6px;
}

.notes-empty {
  margin: 4px 0 10px;
  border-radius: 20px;
  background: var(--surface);
}

@media (max-width: 640px) {
  #pf-notes {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
  }
}

/* ===== Notifications, done properly: same cards as the Friends page, no dead space ===== */
#pf-notes .pf-menu-head .pf-label small {
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.notes-list {
  padding: 6px 14px 16px;
  display: grid;
  gap: 8px;
}

.note-row {
  padding: 12px 12px 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  border-radius: 22px;
  background: var(--surface);
}

.notes-list .fr-who {
  flex: 1 1 190px;
}

.notes-list .person-actions {
  display: flex;
  gap: 6px;
}

.notes-list .person-actions .button {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  white-space: nowrap;
}

.notes-empty {
  margin: 0;
  padding: 30px 16px 34px;
}

.notes-art {
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--muted);
}

.notes-art svg {
  width: 26px;
  height: 26px;
}

/* ===== Browse on a phone: search and "for" share a row, then the two rows of pills ===== */
@media (max-width: 640px) {
  #view-browse .wardrobe-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  #view-browse .search-box {
    width: 100%;
    min-height: 50px;
    grid-column: 1;
    grid-row: 1;
  }

  #view-browse .sort-box {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
  }

  #view-browse .sort-box > span {
    display: none;
  }

  #view-browse #browse-brand-box {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  #view-browse .category-filters {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
  }

  #view-browse .browse-groups {
    margin-top: 10px;
  }

  #view-browse .browse-summary {
    margin: 20px 0 12px;
  }

  #view-browse .browse-grid {
    gap: 18px 10px;
  }
}

/* ===== A friend's page: their tag, their highlights, their pieces ===== */
#view-person {
  max-width: 640px;
  margin: 0 auto;
}

.person-bar {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-back-button {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}

.person-back-button svg {
  width: 22px;
  height: 22px;
}

.person-bar-handle {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-bar .person-actions {
  display: flex;
  gap: 6px;
}

.person-bar .person-actions .button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13.5px;
  white-space: nowrap;
}

.person-tag {
  position: relative;
  padding-top: 30px;
  display: grid;
  justify-items: center;
  color: var(--tag-ink);
  perspective: 1100px;
}

.person-tag .tag-rig {
  animation: tag-drop 1.1s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.person-locked {
  margin-top: 34px;
  padding: 26px 22px;
  border-radius: 26px;
  background: var(--surface);
  text-align: center;
}

.person-locked h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.person-locked p:last-child {
  margin: 0;
  color: var(--muted);
}

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

.person-cell {
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--photo);
  cursor: pointer;
  transition: transform 180ms ease;
}

.person-cell:active {
  transform: scale(0.96);
}

.person-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .person-cell img {
    mix-blend-mode: normal;
  }
}

/* ===== Piece detail: photo sits on the same warm card as everywhere else ===== */
.detail-media,
.detail-image {
  background: var(--photo);
}

.detail-image > img {
  background-color: transparent !important;
  background-blend-mode: multiply;
  mix-blend-mode: multiply;
}

.detail-dialog,
.detail-dialog .detail-info,
.detail-dialog .detail-actions {
  background: var(--surface);
}

.detail-dialog .detail-actions {
  border-top-color: var(--line);
}

.detail-info h2 {
  letter-spacing: -0.045em;
}

.detail-dialog .eyebrow,
.detail-dialog #detail-position {
  font-family: var(--tag-mono);
  letter-spacing: 0.14em;
}

@media (prefers-color-scheme: dark) {
  .detail-image > img {
    mix-blend-mode: normal;
  }
}

/* ===== Finances: total across the top, three facts under it, nothing clipped ===== */
#view-profile .stat-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#view-profile .stat-tile {
  min-width: 0;
  padding: 16px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
}

#view-profile .stat-tile.stat-hero {
  grid-column: 1 / -1;
  padding: 24px 22px;
  border-radius: 28px;
  background: var(--ink);
  color: var(--surface);
}

#view-profile .stat-hero .stat-label,
#view-profile .stat-hero .stat-note {
  color: color-mix(in srgb, var(--surface) 62%, transparent);
}

#view-profile .stat-label {
  margin-bottom: 8px;
  font-family: var(--tag-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#view-profile .stat-tile .stat-value {
  overflow: hidden;
  font-size: clamp(17px, 4.6vw, 24px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-profile .stat-hero .stat-value {
  font-size: clamp(44px, 12vw, 64px);
  line-height: 1;
}

#view-profile .stat-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-profile .profile-finances .panel {
  border: 0;
  border-radius: 26px;
  background: var(--surface);
}

#view-profile .profile-finances .panel-title {
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#view-profile .bar-track {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

@media (prefers-color-scheme: dark) {
  #view-profile .stat-tile.stat-hero {
    background: var(--tag-paper);
    color: var(--tag-ink);
  }

  #view-profile .stat-hero .stat-label,
  #view-profile .stat-hero .stat-note {
    color: rgba(28, 26, 21, 0.62);
  }
}

/* Piece detail actions: star is always a round icon button, so the row never wraps. */
.detail-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.detail-actions .button {
  white-space: nowrap;
}

.detail-actions .fav-toggle {
  flex: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.detail-actions .fav-toggle span {
  display: none;
}

.detail-actions .fav-toggle svg {
  width: 21px;
  height: 21px;
}

.person-wait {
  width: min(100%, 336px);
  aspect-ratio: 5 / 7;
  margin: 76px auto 0;
  border-radius: 28px;
  background: var(--surface);
  animation: boot-pulse 900ms ease-in-out infinite alternate;
}

/* ===== Composition, as a garment label prints it: name · · · · · share ===== */
.tag-comp {
  display: grid;
  gap: 7px;
}

.tag-comp-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--tag-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag-comp-line .pf-dot {
  align-self: center;
}

.tag-comp-dots {
  flex: 1;
  min-width: 16px;
  height: 0;
  border-bottom: 1.5px dotted rgba(60, 45, 20, 0.4);
  translate: 0 -3px;
}

.tag-comp-line b {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Feel: the app moves like one object.
   ===================================================================== */

/* Sections cross-fade with a small lift; header and tab bar stay put. */
::view-transition-old(root) {
  animation: vt-out 160ms ease both;
}

::view-transition-new(root) {
  animation: vt-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes vt-out {
  to { opacity: 0; transform: translateY(-6px) scale(0.992); }
}

@keyframes vt-in {
  from { opacity: 0; transform: translateY(14px); }
}

.site-header {
  view-transition-name: drobe-header;
}

.tab-bar {
  view-transition-name: drobe-tabs;
}

::view-transition-group(drobe-header),
::view-transition-group(drobe-tabs) {
  animation: none;
}

/* Bottom bar: one pill that slides between sections; the icon it lands on pops. */
@media (max-width: 900px) {
  .tab-bar {
    position: fixed;
  }

  .tab-pill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 46px;
    margin-top: -23px;
    border-radius: 999px;
    background: var(--ink);
    transition: transform 420ms cubic-bezier(0.3, 1.35, 0.5, 1), width 300ms ease;
    pointer-events: none;
  }

  .tab-bar.has-pill .tab-bar-link.active {
    background: none;
  }

  .tab-bar-link {
    z-index: 1;
  }

  .tab-bar-link.active svg {
    animation: tab-pop 460ms cubic-bezier(0.3, 1.6, 0.5, 1) both;
  }

  .tab-bar-link.is-landing svg {
    animation: tab-land 620ms cubic-bezier(0.3, 1.8, 0.5, 1) both;
  }

  /* Header tucks away on the way down. */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 25;
    transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
    -webkit-backdrop-filter: saturate(1.4) blur(18px);
    backdrop-filter: saturate(1.4) blur(18px);
  }

  body.header-away .site-header {
    transform: translateY(-110%);
  }
}

@keyframes tab-pop {
  0% { scale: 0.7; }
  100% { scale: 1; }
}

@keyframes tab-land {
  0% { scale: 1; }
  35% { scale: 1.45; rotate: -10deg; }
  100% { scale: 1; rotate: 0deg; }
}

.site-tab.is-landing {
  animation: tab-land 620ms cubic-bezier(0.3, 1.8, 0.5, 1) both;
}

/* The photo in flight when a piece is added. */
.fly-ghost {
  position: fixed;
  z-index: 300;
  object-fit: cover;
  border-radius: 24px;
  background: var(--photo);
  box-shadow: 0 30px 50px -20px rgba(40, 30, 10, 0.5);
  pointer-events: none;
  will-change: transform;
}

/* Everything you can press gives a little. */
.button:active,
.filter-button:active,
.bell:active,
.design-option:active,
.pf-item:active,
.fr-ask .button:active {
  transform: scale(0.96);
}

.tile .item-view:active img,
.look-photo:active img {
  scale: 0.97;
}

/* Browse: the add button answers the tap. */
.tile.is-adding .tile-media {
  animation: tile-give 420ms cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes tile-give {
  40% { transform: scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root),
  .tab-bar-link.active svg {
    animation: none;
  }

  .tab-pill,
  .site-header {
    transition: none;
  }
}

/* With the header tucked away, the clock and battery still need their own strip. */
@media (max-width: 900px) {
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 26;
    height: env(safe-area-inset-top);
    background: color-mix(in srgb, var(--background) 90%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    pointer-events: none;
  }

  body.signed-out::before {
    display: none;
  }
}

/* ===== Patches: achievements as embroidered sew-ons ===== */
.patches h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.patches h3 span {
  opacity: 0.6;
}

#view-person .patches {
  margin-top: 34px;
}

.patch-row {
  margin: 0 calc(50% - 50vw);
  padding: 8px max(20px, calc(50vw - 320px)) 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.patch-row::-webkit-scrollbar {
  display: none;
}

.patch {
  flex: none;
  width: 104px;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
}

.patch-disc {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  rotate: var(--tilt);
  transition: rotate 300ms cubic-bezier(0.3, 1.5, 0.5, 1), scale 300ms cubic-bezier(0.3, 1.5, 0.5, 1);
}

.patch:hover .patch-disc,
.patch:active .patch-disc {
  rotate: 0deg;
  scale: 1.06;
}

.patch-disc svg {
  position: relative;
  width: 34px;
  height: 34px;
}

/* Earned: solid thread colour, a row of stitches inside the edge, a soft drop like felt on fabric. */
.patch.is-earned .patch-disc {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 2px, transparent 2px 5px),
    var(--patch);
  color: #fff;
  box-shadow: 0 10px 18px -10px color-mix(in srgb, var(--patch) 80%, #000), inset 0 0 0 3px color-mix(in srgb, var(--patch) 78%, #000);
}

.patch.is-earned .patch-disc::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1.5px dashed rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

/* Not yet: only the outline, and the stitching has got as far as you have. */
.patch:not(.is-earned) .patch-disc {
  background:
    radial-gradient(closest-side, var(--background) calc(100% - 5px), transparent calc(100% - 4px)),
    conic-gradient(var(--patch) var(--fill), color-mix(in srgb, var(--ink) 12%, transparent) 0);
  color: color-mix(in srgb, var(--ink) 38%, transparent);
}

.patch:not(.is-earned) .patch-disc::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 50%;
}

.patch strong {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.patch small {
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.patch:not(.is-earned) strong {
  color: var(--muted);
}

.patch.is-earned small {
  color: var(--patch);
  filter: brightness(0.8);
}

@media (prefers-color-scheme: dark) {
  .patch.is-earned small {
    filter: none;
  }
}

/* ===== Style, not a breakdown: one word for how the wardrobe dresses ===== */
.tag-style {
  margin: 0;
  font-size: clamp(24px, 6.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.tag-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-style-chip {
  padding: 5px 10px;
  border: 1.5px dashed rgba(60, 45, 20, 0.22);
  border-radius: 999px;
  color: rgba(28, 26, 21, 0.38);
  font-family: var(--tag-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tag-style-chip.is-some {
  border-style: solid;
  border-color: rgba(60, 45, 20, 0.4);
  color: var(--tag-ink);
}

.tag-style-chip.is-main {
  border: 1.5px solid var(--tag-ink);
  background: var(--tag-ink);
  color: var(--tag-paper);
}

/* ===== First visit: four cards ===== */
.onboard {
  width: min(440px, calc(100% - 32px));
  overflow: hidden;
  background: var(--surface);
}

.onboard-art {
  position: relative;
  height: 250px;
  overflow: hidden;
  background: var(--photo);
}

.onboard-shot {
  --i: 0;
  position: absolute;
  top: 34px;
  left: 50%;
  width: 150px;
  aspect-ratio: 4 / 5;
  margin-left: -75px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 22px 34px -20px rgba(40, 30, 10, 0.55);
  transform: translateX(calc((var(--i) - 1) * 96px)) rotate(calc((var(--i) - 1) * 9deg)) translateY(calc((1 - var(--i)) * (1 - var(--i)) * 14px));
  opacity: 0;
}

.onboard-shot:nth-child(2) {
  z-index: 1;
}

.onboard-art.is-in .onboard-shot {
  animation: onboard-deal 620ms cubic-bezier(0.2, 0.9, 0.2, 1) calc(var(--i) * 80ms) both;
}

@keyframes onboard-deal {
  from {
    transform: translateY(80px) rotate(0deg) scale(0.9);
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.onboard-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.onboard-badge {
  position: absolute;
  right: 26px;
  bottom: 22px;
  z-index: 2;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 12px 22px -10px rgba(0, 0, 0, 0.6);
  animation: tab-land 620ms cubic-bezier(0.3, 1.8, 0.5, 1) 320ms both;
}

.onboard-body {
  padding: 24px 24px 6px;
  display: grid;
  gap: 8px;
}

.onboard-body .eyebrow {
  margin: 0;
}

.onboard-body h2 {
  margin: 0;
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.onboard-text {
  margin: 0;
  min-height: 3.2em;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.5;
}

.onboard-lang {
  width: fit-content;
  margin-top: 6px;
}

.onboard-lang[hidden] {
  display: none;
}

.onboard-foot {
  padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
}

.onboard-dots {
  flex: 1;
  display: flex;
  gap: 6px;
}

.onboard-dots i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  transition: width 300ms cubic-bezier(0.3, 1.4, 0.5, 1), background 200ms ease;
}

.onboard-dots i.active {
  width: 22px;
  background: var(--ink);
}

.onboard-foot .button {
  min-height: 46px;
  white-space: nowrap;
}

.onboard-next {
  padding: 0 24px;
}

.lang-switch .design-option {
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .onboard-shot {
    background: var(--photo);
  }
}

/* Every sheet on a phone: full width, rising from the bottom edge. One rule, so no sheet can drift. */
@media (max-width: 640px) {
  dialog.item-dialog,
  dialog.item-dialog.onboard,
  dialog.item-dialog.pf-sheet {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }

  .onboard-art {
    height: 230px;
  }
}

/* ===== New wardrobe: three steps and one button ===== */
.starter {
  padding: 20px !important;
  border-radius: 26px !important;
  background: var(--surface) !important;
}

.starter-steps {
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 14px;
  list-style: none;
}

.starter-steps li {
  display: flex;
  align-items: center;
  gap: 14px;
}

.starter-steps b {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  font-family: var(--tag-mono);
  font-size: 13px;
}

.starter-steps li:first-child b {
  background: var(--ink);
  color: var(--surface);
}

.starter-steps span {
  display: grid;
  gap: 2px;
}

.starter-steps strong {
  font-size: 15.5px;
  font-weight: 750;
}

.starter-steps small {
  color: var(--muted);
  font-size: 13.5px;
}

.starter-go {
  width: 100%;
  min-height: 50px;
  justify-content: center;
  text-decoration: none;
}

/* Empty and error screens sit on the same warm paper as everything else. */
.stage[data-design="welcome"] {
  border: 0;
  background: var(--surface);
  box-shadow: none;
}

.stage[data-design="welcome"] .welcome-step,
.welcome-steps > li {
  border-color: var(--line);
  background: var(--background);
}

/* Finances on a phone: two facts side by side under the total; a third, when there is one, across. */
@media (max-width: 640px) {
  #view-profile .stat-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-profile .stat-tile:nth-child(4) {
    grid-column: 1 / -1;
  }
}

#view-profile .stat-tile .stat-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  line-height: 1.35;
}

#view-profile .stat-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Form fields: warm, quiet, and a soft ring when typing instead of a heavy black outline. */
.item-dialog input:not([type="checkbox"]):not([type="file"]),
.item-dialog select {
  border-color: var(--line);
  background: var(--background);
}

.item-dialog input:not([type="checkbox"]):not([type="file"]):focus,
.item-dialog input:not([type="checkbox"]):not([type="file"]):focus-visible,
.item-dialog select:focus,
.item-dialog select:focus-visible {
  outline: none;
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 10%, transparent);
}

.item-dialog .photo-preview,
.item-dialog .photo-preview img {
  background: var(--photo);
}

.item-dialog .photo-preview img {
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .item-dialog .photo-preview img {
    mix-blend-mode: normal;
  }
}

/* Dark mode: product photos come on near-white backdrops; take the glare off so they sit in the page. */
@media (prefers-color-scheme: dark) {
  .look-photo img,
  .pf-gallery-tile img,
  .hl-frame img,
  .tile-media img,
  .fr-shot img,
  .person-cell img,
  .detail-image > img,
  .boot-wall .auth-tile img {
    filter: brightness(0.86) contrast(1.04);
  }
}

/* ===== Currency ===== */
.currency-row {
  cursor: pointer;
}

.currency-select {
  flex: none;
  max-width: 46%;
  min-height: 40px;
  padding: 0 34px 0 14px;
  border: 0;
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m7 10 5 5 5-5' stroke='%23736d62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 16px no-repeat,
    color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  cursor: pointer;
}

.price-symbol {
  margin-left: 2px;
  color: var(--muted);
  font-weight: 700;
}

.stat-rate {
  margin: 8px 0 0;
  color: color-mix(in srgb, var(--surface) 55%, transparent);
  font-family: var(--tag-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

@media (prefers-color-scheme: dark) {
  .stat-rate {
    color: rgba(28, 26, 21, 0.55);
  }
}

/* Patches row: free scrolling. Snapping ignored the side padding and could park the row past its patches. */
.patch-row {
  scroll-snap-type: none;
  scroll-padding-inline: max(20px, calc(50vw - 320px));
}

.patch {
  scroll-snap-align: none;
}

/* Grid cards must not grow to fit a wide scrolling row inside them; that pushed the patches off screen. */
.sp-cards > *,
#view-person .person-body > * {
  min-width: 0;
}

.patches {
  width: 100%;
  min-width: 0;
}

/* ===== Scanning a tag ===== */
.scan-button {
  flex: none;
  min-height: 50px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease;
}

.scan-button:active {
  transform: scale(0.95);
}

.scan-button svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 640px) {
  #view-browse .wardrobe-controls {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  #view-browse .scan-button {
    grid-column: 2;
    grid-row: 1;
    width: 50px;
    padding: 0;
    justify-content: center;
  }

  #view-browse .scan-button span {
    display: none;
  }

  #view-browse .sort-box {
    grid-column: 3;
  }
}

.scan-sheet {
  width: min(480px, calc(100% - 32px));
  background: var(--surface);
}

.scan-sheet .pf-menu-head {
  background: var(--surface);
}

.scan-stage {
  position: relative;
  margin: 0 16px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 24px;
  background: #0f0e0c;
}

.scan-stage[hidden] {
  display: none;
}

.scan-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 300ms ease;
}

.scan-stage.is-live video {
  opacity: 1;
}

.scan-frame {
  position: absolute;
  inset: 26% 12%;
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(15, 14, 12, 0.45);
  pointer-events: none;
}

.scan-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2.5px solid #fff;
  border-radius: inherit;
  -webkit-mask:
    linear-gradient(#000 0 0) top left / 28px 28px no-repeat,
    linear-gradient(#000 0 0) top right / 28px 28px no-repeat,
    linear-gradient(#000 0 0) bottom left / 28px 28px no-repeat,
    linear-gradient(#000 0 0) bottom right / 28px 28px no-repeat;
  mask:
    linear-gradient(#000 0 0) top left / 28px 28px no-repeat,
    linear-gradient(#000 0 0) top right / 28px 28px no-repeat,
    linear-gradient(#000 0 0) bottom left / 28px 28px no-repeat,
    linear-gradient(#000 0 0) bottom right / 28px 28px no-repeat;
}

.scan-frame i {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 2px;
  border-radius: 2px;
  background: #ff5a4e;
  box-shadow: 0 0 12px #ff5a4e;
  opacity: 0;
}

.scan-stage.is-live .scan-frame i {
  opacity: 1;
  animation: scan-sweep 1.6s ease-in-out infinite alternate;
}

@keyframes scan-sweep {
  from { translate: 0 -34px; }
  to { translate: 0 34px; }
}

.scan-stage.is-off .scan-frame {
  box-shadow: none;
  opacity: 0.35;
}

.scan-status {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 14, 12, 0.6);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.scan-type {
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
}

.scan-type label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.scan-type div {
  display: flex;
  gap: 8px;
}

.scan-type input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--background);
  color: var(--ink);
  font: inherit;
  font-family: var(--tag-mono);
  font-size: 16px;
  letter-spacing: 0.06em;
}

.scan-type input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 10%, transparent);
}

.scan-type .button {
  min-height: 48px;
}

.scan-result {
  padding: 0 16px;
}

.scan-result[hidden] {
  display: none;
}

.scan-card {
  display: grid;
  gap: 14px;
  animation: pf-cell-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.scan-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 24px;
  background: var(--photo);
}

.scan-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}

.scan-text .eyebrow {
  margin: 0 0 6px;
}

.scan-text h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.scan-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.scan-price {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.scan-actions {
  display: flex;
  gap: 8px;
}

.scan-actions .button-primary {
  flex: 1;
  min-height: 50px;
  justify-content: center;
}

.scan-card.is-added .scan-photo {
  animation: tile-give 420ms cubic-bezier(0.3, 1.5, 0.5, 1);
}

.scan-miss {
  padding: 22px 6px 6px;
  display: grid;
  justify-items: start;
  gap: 8px;
}

.scan-miss strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.scan-miss p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.starter-buttons {
  display: grid;
  gap: 8px;
}

@media (prefers-color-scheme: dark) {
  .scan-photo img {
    mix-blend-mode: normal;
  }
}

.scan-type[hidden] {
  display: none;
}

.scan-result {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* ===== Browse view modes ===== */
#view-browse .browse-summary {
  align-items: center;
}

.view-switch {
  margin-left: auto;
  padding: 3px;
  display: flex;
  gap: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.view-option {
  width: 36px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.view-option svg {
  width: 18px;
  height: 18px;
}

.view-option.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(40, 30, 10, 0.18);
}

/* Compact: many small photos, words hidden. */
#view-browse .browse-grid[data-view="dense"] {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

#view-browse .browse-grid[data-view="dense"] .tile-info {
  display: none;
}

#view-browse .browse-grid[data-view="dense"] > .tile:nth-child(9n + 1) {
  grid-column: auto;
}

#view-browse .browse-grid[data-view="dense"] .tile-media,
#view-browse .browse-grid[data-view="dense"] > .tile:nth-child(9n + 1) .tile-media {
  aspect-ratio: 4 / 5;
  border-radius: 16px;
}

#view-browse .browse-grid[data-view="dense"] .browse-badge {
  transform: scale(0.78);
  transform-origin: bottom right;
}

/* Large: one big photo per row, like a lookbook. */
#view-browse .browse-grid[data-view="large"] {
  max-width: 640px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
}

#view-browse .browse-grid[data-view="large"] > .tile:nth-child(9n + 1) {
  grid-column: auto;
}

#view-browse .browse-grid[data-view="large"] .tile-media,
#view-browse .browse-grid[data-view="large"] > .tile:nth-child(9n + 1) .tile-media {
  aspect-ratio: 4 / 5;
  border-radius: 30px;
}

#view-browse .browse-grid[data-view="large"] .tile-media img {
  object-fit: cover;
  object-position: 50% 30%;
}

#view-browse .browse-grid[data-view="large"] .tile-name {
  font-size: 20px;
  -webkit-line-clamp: 3;
}

/* List: a photo and the words beside it, for scanning by name. */
#view-browse .browse-grid[data-view="list"] {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

#view-browse .browse-grid[data-view="list"] > .tile,
#view-browse .browse-grid[data-view="list"] > .tile:nth-child(9n + 1) {
  grid-column: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-radius: 22px;
  background: var(--surface);
}

#view-browse .browse-grid[data-view="list"] .tile-media,
#view-browse .browse-grid[data-view="list"] > .tile:nth-child(9n + 1) .tile-media {
  aspect-ratio: 1;
  border-radius: 16px;
}

#view-browse .browse-grid[data-view="list"] .tile-info {
  margin: 0;
  padding: 0;
}

#view-browse .browse-grid[data-view="list"] .tile-name {
  -webkit-line-clamp: 2;
}

#view-browse .browse-grid[data-view="list"] .browse-badge {
  transform: scale(0.72);
  transform-origin: bottom right;
}

@media (min-width: 900px) {
  #view-browse .browse-grid[data-view="list"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #view-browse .browse-summary {
    flex-wrap: wrap;
  }

  #view-browse .browse-grid[data-view="dense"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .view-option {
    width: 34px;
  }
}

/* ===== Friend activity ===== */
.fr-feed-rows {
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface);
}

.fr-feed-row {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.fr-feed-row + .fr-feed-row {
  box-shadow: inset 0 1px 0 var(--line);
}

.fr-feed-row:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.fr-feed-row.is-waiting {
  animation: boot-pulse 900ms ease-in-out infinite alternate;
  cursor: default;
}

.fr-feed-row .avatar.fr-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.fr-feed-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.fr-feed-line {
  color: var(--muted);
  font-size: 13px;
}

.fr-feed-line b {
  color: var(--ink);
  font-weight: 750;
}

.fr-feed-text strong {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fr-feed-text small {
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.fr-feed-shot {
  flex: none;
  width: 52px;
  height: 64px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--photo);
}

.fr-feed-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .fr-feed-shot img {
    mix-blend-mode: normal;
  }
}

/* Small legal links: "For brands" on the sign-in page and under every catalog piece. */
.auth-legal {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
}

.auth-legal a,
.brand-note {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent);
  text-underline-offset: 3px;
}

.brand-note {
  margin-top: 14px;
  display: inline-block;
  font-size: 13px;
}

.brand-note[hidden] {
  display: none;
}

a.pf-item {
  text-decoration: none;
}

/* ===== Onboarding questions ===== */
.onboard.is-question .onboard-art {
  height: 150px;
}

.onboard.is-question .onboard-shot {
  top: 22px;
  width: 104px;
  margin-left: -52px;
}

.onboard-answer {
  margin-top: 6px;
  display: grid;
  gap: 14px;
}

.onboard-answer[hidden] {
  display: none;
}

.choice-block {
  display: grid;
  gap: 8px;
}

.choice-label {
  margin: 0;
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-row.is-scroll {
  flex-wrap: nowrap;
  margin: 0 -24px;
  padding: 2px 24px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.choice-row.is-scroll::-webkit-scrollbar {
  display: none;
}

.choice {
  flex: none;
  min-width: 52px;
  min-height: 44px;
  padding: 0 16px;
  display: grid;
  place-content: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--background);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.choice:active {
  transform: scale(0.95);
}

.choice.has-note {
  flex: 1 1 140px;
  min-height: 64px;
  padding: 10px 16px;
  justify-content: start;
  text-align: left;
  border-radius: 18px;
}

.choice small {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.choice.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.choice.active small {
  color: color-mix(in srgb, var(--surface) 70%, transparent);
}

@media (max-width: 640px) {
  .onboard {
    max-height: 94dvh;
    overflow-y: auto;
  }
}

/* =====================================================================
   Onboarding: full-screen, photo-led pages.
   ===================================================================== */
.onb {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  display: none;
  border: 0;
  background: var(--background);
  color: var(--ink);
  overflow: hidden;
}

.onb[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: vt-in 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.onb::backdrop {
  background: var(--background);
}

.onb-top {
  position: relative;
  z-index: 3;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 20px 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.onb[data-kind="welcome"] .onb-top {
  position: absolute;
  inset: 0 0 auto;
}

.onb-progress {
  flex: 1;
  display: flex;
  gap: 6px;
}

.onb-progress i {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
}

.onb-progress i::after {
  content: "";
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.onb-progress i.done::after {
  transform: scaleX(1);
}

.onb-skip {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.onb-stage {
  grid-row: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.onb-stage::-webkit-scrollbar {
  display: none;
}

.onb-page {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 18px 20px 28px;
  animation: onb-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes onb-in {
  from {
    opacity: 0;
    transform: translateX(var(--from, 40px));
  }
}

.onb-page .eyebrow {
  margin: 0 0 10px;
}

.onb-page h2 {
  margin: 0 0 12px;
  font-size: clamp(34px, 8.5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.98;
  text-wrap: balance;
}

.onb-lead {
  margin: 0 0 22px;
  max-width: 44ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.onb-foot {
  grid-row: 3;
  position: relative;
  z-index: 3;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
}

.onb-foot::before {
  content: "";
  position: absolute;
  inset: -36px 0 0;
  z-index: -1;
  background: linear-gradient(transparent, var(--background) 45%);
  pointer-events: none;
}

.onb-foot[hidden],
.onb-foot .onb-back[hidden] {
  display: none;
}

.onb-foot .onb-next {
  flex: 1;
  min-height: 58px;
  justify-content: center;
  border-radius: 999px;
  font-size: 16.5px;
}

.onb-foot .onb-back {
  min-height: 58px;
  padding: 0 22px;
  border-radius: 999px;
}

.onb img {
  opacity: 0;
  transition: opacity 500ms ease;
}

.onb img.in {
  opacity: 1;
}

/* Welcome: rows of looks drifting by. */
.onb-page-welcome {
  width: 100%;
  min-height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.onb-reel {
  position: relative;
  flex: 1 1 auto;
  height: 46dvh;
  min-height: 250px;
  max-height: 520px;
  padding-top: calc(52px + env(safe-area-inset-top));
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent 98%);
  mask-image: linear-gradient(#000 55%, transparent 98%);
}

.onb-reel-row {
  transform: rotate(-4deg) scale(1.16);
}

.onb-reel-strip {
  width: max-content;
  margin-left: -70px;
  display: flex;
  gap: 10px;
  animation: onb-drift calc(46s + var(--row) * 8s) linear infinite;
}

.onb-reel-row:nth-child(2) .onb-reel-strip {
  animation-direction: reverse;
}

@keyframes onb-drift {
  to {
    transform: translateX(calc(-50% - 5px));
  }
}

.onb-reel-shot {
  width: clamp(96px, 25vw, 170px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 18px;
  background: var(--photo);
}

.onb-reel-shot img,
.onb-person-photos img,
.onb-style-shot img,
.onb-fan-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 22%;
}

.onb-copy {
  position: relative;
  width: min(1040px, 100%);
  margin: -28px auto 0;
  padding: 0 20px 12px;
}

.onb-page h2.onb-display {
  max-width: 12ch;
  font-size: clamp(38px, 10.5vw, 84px);
}

.onb-lang {
  width: fit-content;
}

/* About you: tall photo cards. */
.onb-people {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.onb-person {
  position: relative;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 3 / 4.2;
  border: 0;
  border-radius: 28px;
  background: var(--photo);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  transition: transform 260ms cubic-bezier(0.3, 1.4, 0.5, 1), box-shadow 200ms ease, opacity 200ms ease, filter 200ms ease;
}

.onb-person::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  z-index: 1;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
  pointer-events: none;
}

.onb-person-photos {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
}

.onb-person-text {
  position: absolute;
  inset: auto 18px 16px;
  z-index: 2;
  display: grid;
  gap: 2px;
}

.onb-person-text strong {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.onb-person-text small {
  font-size: 13.5px;
  opacity: 0.82;
}

.onb-person:active,
.onb-style:active {
  transform: scale(0.97);
}

.onb-person.active {
  box-shadow: 0 0 0 3px var(--background), 0 0 0 6px var(--ink);
}

.onb-people:has(.active) .onb-person:not(.active) {
  opacity: 0.55;
  filter: saturate(0.6);
}

/* Tick on anything picked. */
.onb-tick {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 260ms cubic-bezier(0.3, 1.8, 0.5, 1), background-color 160ms ease;
}

.active > .onb-tick {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 12.5 4 4L18 8' stroke='%23111' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: scale(1.12);
}

/* Styles: a grid of looks. */
.onb-style-head {
  margin-bottom: 18px;
}

.onb-count {
  width: fit-content;
  margin: 6px 0 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 200ms ease, color 200ms ease;
}

.onb-count.on {
  background: var(--ink);
  color: var(--background);
}

.onb-style-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.onb-style {
  --bg: #eee;
  --fg: #111;
  position: relative;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 0;
  border-radius: 22px;
  background: var(--bg);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  transition: transform 260ms cubic-bezier(0.3, 1.4, 0.5, 1), box-shadow 200ms ease;
  animation: onb-tile 520ms cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--i) * 28ms) both;
}

@keyframes onb-tile {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
}

.onb-style-shot {
  position: absolute;
  inset: 0;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.onb-style::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  z-index: 1;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.66));
  pointer-events: none;
}

.onb-style-text {
  position: absolute;
  inset: auto 14px 13px;
  z-index: 2;
  display: grid;
  gap: 3px;
}

.onb-style-text strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.onb-style-text small {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.8;
}

.onb-style .onb-tick {
  top: 11px;
  right: 11px;
  width: 26px;
  height: 26px;
}

.onb-style.active {
  box-shadow: 0 0 0 3px var(--background), 0 0 0 6px var(--ink);
}

.onb-style.active .onb-style-shot {
  transform: scale(1.06);
}

@media (hover: hover) {
  .onb-style:hover .onb-style-shot {
    transform: scale(1.04);
  }
}

.no-photo img {
  display: none;
}

/* Ready: a fan of what they picked. */
.onb-page-ready {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.onb-fan {
  position: relative;
  height: clamp(190px, 27dvh, 260px);
  margin: 0 0 22px;
}

.onb-fan-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: clamp(120px, 30vw, 170px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 4px solid var(--surface);
  border-radius: 22px;
  background: var(--photo);
  box-shadow: 0 22px 40px -22px rgba(30, 20, 5, 0.6);
  transform: translateX(calc(-50% + var(--i) * 46%)) translateY(calc(var(--i) * var(--i) * 7px)) rotate(calc(var(--i) * 7deg));
  animation: onb-deal 760ms cubic-bezier(0.25, 1.4, 0.4, 1) calc(var(--n) * 80ms) both;
}

@keyframes onb-deal {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(60px) rotate(0deg) scale(0.8);
  }
}

.onb-page-ready h2,
.onb-page-ready .eyebrow,
.onb-page-ready .onb-lead {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.onb-picked {
  margin: 0 0 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.onb-picked span {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}

.onb-actions {
  width: min(420px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.onb-actions .button {
  min-height: 58px;
  justify-content: center;
  border-radius: 999px;
  font-size: 16.5px;
}

@media (max-width: 640px) {
  .onb-style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .onb-people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .onb-person:nth-child(3) {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 10;
  }
}

@media (prefers-reduced-motion: reduce) {
  .onb-page,
  .onb-style,
  .onb-fan-card,
  .onb-reel-strip {
    animation: none;
  }
}

.onb-page-welcome .onb-lead {
  margin-bottom: 16px;
  font-size: 16px;
}

/* Delete account sheet. */
.delete-form {
  display: grid;
  gap: 12px;
  padding: 4px 22px calc(22px + env(safe-area-inset-bottom));
}

.delete-lead {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.5;
}

.delete-label {
  font-size: 14px;
  font-weight: 600;
}

#delete-confirm {
  min-height: 52px;
  padding: 0 16px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

#delete-confirm:focus {
  border-color: #d13b2f;
  outline: none;
}

.delete-button {
  min-height: 54px;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #d13b2f;
  color: #fff;
  font-weight: 700;
}

.delete-button:disabled {
  opacity: 0.4;
}

/* The side of the tag that faces away is hidden outright, not just turned away: page-change
   snapshots ignore backface-visibility and would otherwise flash the back, mirrored. */
.tag .tag-face {
  transition: visibility 0s 170ms;
}

.tag:not(.is-flipped) .tag-back,
.tag.is-flipped .tag-front {
  visibility: hidden;
}

.delete-form > * {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

/* Where: your country only, or everywhere. Sits beside the view switch. */
.where-switch {
  margin-left: auto;
  padding: 3px;
  display: flex;
  gap: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.where-switch + .view-switch {
  margin-left: 8px;
}

.where-option {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.where-option.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(40, 30, 10, 0.18);
}

/* A piece your country doesn't sell: still visible, clearly marked. */
.tile.is-elsewhere .tile-media img {
  opacity: 0.55;
  filter: grayscale(0.6);
}

.tile-elsewhere {
  width: fit-content;
  margin: 4px 0 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #d13b2f 12%, transparent);
  color: #b4362b;
  font-size: 11.5px;
  font-weight: 700;
}

#view-browse .browse-grid[data-view="dense"] .tile.is-elsewhere .tile-media::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d13b2f;
  box-shadow: 0 0 0 2px var(--surface);
}

@media (max-width: 640px) {
  .browse-summary:has(.where-switch) {
    flex-wrap: wrap;
  }

  .where-switch {
    order: 3;
    margin-left: 0;
  }
}

/* Sign in with Apple: black on light, white on dark, as Apple's guidelines ask. */
.auth-card .auth-apple {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-weight: 650;
}

.auth-apple svg {
  width: 20px;
  height: 20px;
  margin-top: -3px;
}

@media (prefers-color-scheme: dark) {
  .auth-card .auth-apple {
    background: #fff;
    color: #000;
  }
}

/* Phone wardrobe toolbar: the search gets the room, the sort menu stays compact. */
@media (max-width: 640px) {
  #view-wardrobe .wardrobe-controls {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-wardrobe .sort-box {
    max-width: 150px;
  }

  #view-wardrobe .sort-box select {
    max-width: 120px;
    text-overflow: ellipsis;
  }
}

/* =====================================================================
   Browse: one row (search, scan, filter), chips for what's on, and a filter sheet.
   ===================================================================== */
.browse-bar {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.browse-bar .search-box {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 50px;
  border-radius: 999px;
}

.browse-bar .scan-button {
  min-height: 50px;
}

.filter-open {
  position: relative;
  flex: none;
  min-height: 50px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.filter-open svg {
  width: 20px;
  height: 20px;
}

.filter-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11.5px;
  font-weight: 800;
}

.filter-count[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .browse-bar .scan-button span,
  .filter-open > span {
    display: none;
  }

  .browse-bar .scan-button,
  .filter-open {
    width: 50px;
    padding: 0;
    justify-content: center;
  }

  .filter-open .filter-count {
    position: absolute;
    top: -3px;
    right: -3px;
    box-shadow: 0 0 0 2px var(--background);
  }
}

/* What's switched on, each removable with one tap. */
.browse-active {
  margin: 0 -4px 12px;
  padding: 0 4px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.browse-active::-webkit-scrollbar {
  display: none;
}

.browse-active[hidden] {
  display: none;
}

.active-chip {
  flex: none;
  min-height: 34px;
  padding: 0 10px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  animation: pf-cell-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.active-chip svg {
  width: 14px;
  height: 14px;
  opacity: 0.75;
}

/* Count on the left, view switch on the right, nothing else. */
#view-browse .browse-summary {
  margin-bottom: 14px;
  align-items: center;
}

#view-browse .browse-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

/* The filter sheet. */
.filter-sheet {
  display: none;
}

.filter-sheet[open] {
  display: flex;
  flex-direction: column;
}

.filter-body {
  /* "1 1 auto", not "1": a zero basis collapses the body to nothing in WebKit (iPhone). */
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 20px 12px;
  overflow-y: auto;
}

.filter-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.filter-block:last-child {
  border-bottom: 0;
}

.filter-block h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.filter-block[hidden],
.filter-sports:has(#browse-groups[hidden]) {
  display: none;
}

.filter-sheet .filter-chips,
.filter-sheet .category-filters,
.filter-sheet .browse-groups {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
}

.filter-sheet .filter-button,
.filter-sheet .group-chip {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.filter-sheet .filter-button.active,
.filter-sheet .group-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.filter-sheet .group-chip span {
  margin-left: 6px;
  opacity: 0.6;
  font-size: 12px;
}

.filter-sheet .where-switch {
  margin: 0;
  width: fit-content;
}

.filter-select {
  width: 100%;
  max-width: none;
}

.filter-select select {
  width: 100%;
  max-width: none;
  font-size: 15px;
}

.filter-foot {
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.filter-foot .button-primary {
  flex: 1;
  min-height: 52px;
  justify-content: center;
  border-radius: 999px;
}

.filter-foot .button-plain {
  min-height: 52px;
  padding: 0 18px;
}

/* Where to buy: one row per store, official first, then cheapest. */
.where-to-buy {
  margin-top: 18px;
}

.where-to-buy[hidden] {
  display: none;
}

.where-to-buy h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--tag-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.where-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
}

.where-row + .where-row {
  border-top: 1px solid var(--line);
}

.where-link {
  min-height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.where-store {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.where-official,
.where-best {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.where-official {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.where-best {
  background: color-mix(in srgb, #2f9e5b 16%, transparent);
  color: #237a45;
}

.where-price {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.where-link::after {
  content: "›";
  margin-left: 4px;
  color: var(--muted);
  font-size: 20px;
}

.where-to-buy {
  width: 100%;
  flex-basis: 100%;
}

.where-official,
.where-best {
  white-space: nowrap;
}

.detail-side > .where-to-buy {
  margin: 0;
  padding: 4px 20px 22px;
  box-sizing: border-box;
}

.where-price {
  margin-left: auto;
}

.where-link {
  justify-content: flex-start;
}

.filter-sheet[open] {
  max-height: 88dvh;
}
