:root {
  color-scheme: light;
  --ink: #11100f;
  --paper: #fbf8f3;
  --paper-deep: #f4eee7;
  --taupe: #97887b;
  --taupe-dark: #6f6258;
  --line: #ded4ca;
  --pink: #e93e6b;
  --pink-soft: #fbe6eb;
  --serif: Didot, "Bodoni MT", "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { background: #efe9e2; }
body { min-width: 320px; margin: 0; background: #efe9e2; }
button, input, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus, a:focus, label:focus { outline: none; }
button:focus-visible, a:focus-visible, label:focus-visible { outline: 2px solid rgba(233,62,107,.72); outline-offset: 3px; }
[hidden] { display: none !important; }

.app-shell {
  position: relative;
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 70px rgba(66,45,33,.12);
}

.view { min-height: 100svh; background: var(--paper); }
.wordmark { font-family: var(--serif); font-weight: 400; letter-spacing: -.065em; line-height: .85; }
.wordmark span { color: var(--pink); }
#file { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  padding: 15px 22px;
  border: 0;
  border-radius: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.primary-button { background: #11100f; color: #fff; }
.primary-button:disabled { cursor: wait; opacity: .48; }
.secondary-button { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.text-button { border: 0; background: transparent; color: var(--taupe-dark); cursor: pointer; }
.icon-button { display: grid; width: 46px; height: 46px; padding: 0; border: 0; background: transparent; place-items: center; cursor: pointer; }
.icon-button svg { width: 31px; height: 31px; }

.topbar {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  width: 100%;
  min-height: 82px;
  padding: max(16px,env(safe-area-inset-top)) 28px 10px;
}
.compact-wordmark { justify-self: center; font-size: 48px; }
.topbar-spacer { width: 48px; }

/* One-time intro */
.intro-view { display: flex; flex-direction: column; padding: max(18px,env(safe-area-inset-top)) 30px max(28px,env(safe-area-inset-bottom)); }
.intro-skip { align-self: flex-end; padding: 8px 0; font-size: 15px; }
.intro-brand { align-self: center; margin: -2px 0 22px; font-size: 57px; }
.intro-visual {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 1 / 1.03;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 27px;
  background: #c7b5a6 url('/assets/findit-landing-hero.webp') center 33% / cover no-repeat;
  box-shadow: 0 24px 54px rgba(68,46,33,.16);
}
.intro-visual::after { position: absolute; inset: 0; content: ""; background: rgba(13,10,9,.12); }
.intro-crop-frame { position: absolute; z-index: 2; top: 19%; right: 13%; bottom: 11%; left: 24%; border: 1.5px solid rgba(255,255,255,.86); }
.crop-corners::before, .crop-corners::after { position: absolute; inset: -7px; content: ""; pointer-events: none; }
.crop-corners::before { border-top: 7px solid #fff; border-bottom: 7px solid #fff; clip-path: polygon(0 0,20% 0,20% 100%,0 100%,0 80%,100% 80%,100% 100%,80% 100%,80% 0,100% 0,100% 20%,0 20%); }
.crop-corners::after { border-right: 7px solid #fff; border-left: 7px solid #fff; clip-path: polygon(0 0,20% 0,20% 100%,0 100%,0 80%,100% 80%,100% 100%,80% 100%,80% 0,100% 0,100% 20%,0 20%); }
.intro-copy { width: min(100%, 500px); margin: 30px auto 25px; }
.eyebrow { margin: 0 0 8px !important; color: var(--pink) !important; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.intro-copy h1 { margin: 0; font-family: var(--serif); font-size: clamp(34px,9vw,55px); font-weight: 400; letter-spacing: -.035em; line-height: .97; }
.intro-copy > p:last-child { margin: 17px 0 0; color: var(--taupe-dark); font-size: 15px; line-height: 1.5; }
.intro-view > .primary-button { width: min(100%,500px); margin: auto auto 0; }

/* Landing */
.landing-state { min-height: calc(100svh - 92px); padding: clamp(54px,8vh,86px) 34px 128px; }
.landing-header { margin-bottom: 35px; text-align: center; }
.landing-wordmark { font-size: clamp(65px,15vw,92px); }
.landing-header p { margin: 20px 0 0; color: #8e7e72; font-family: var(--serif); font-size: clamp(21px,5vw,30px); }
.landing-hero {
  position: relative;
  width: min(100%,540px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
}
.landing-image {
  --crop-top: 17%;
  --crop-right: 13%;
  --crop-bottom: 10%;
  --crop-left: 23%;
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 28px;
  background: #c7b5a6 url('/assets/findit-landing-hero.webp') center 37% / cover no-repeat;
  box-shadow: 0 22px 55px rgba(60,42,31,.14);
}
.landing-image::before,
.landing-image::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}
.landing-image::after {
  z-index: 0;
  background: rgba(14,11,9,.34);
}
.landing-image::before {
  z-index: 1;
  background: url('/assets/findit-landing-hero.webp') center 37% / cover no-repeat;
  clip-path: inset(var(--crop-top) var(--crop-right) var(--crop-bottom) var(--crop-left));
}
.landing-crop-frame {
  position: absolute;
  z-index: 2;
  top: var(--crop-top);
  right: var(--crop-right);
  bottom: var(--crop-bottom);
  left: var(--crop-left);
  border: 1.5px solid rgba(255,255,255,.9);
}
.photo-action {
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(75%, 355px);
  min-height: 68px;
  padding: 16px 24px;
  border-radius: 20px;
  background: linear-gradient(105deg,#e83e6b,#ec3868);
  color: #fff;
  font-size: 20px;
  font-weight: 620;
  cursor: pointer;
  transform: translate(-50%,50%);
  box-shadow: 0 16px 32px rgba(201,36,85,.27),0 2px 4px rgba(56,32,35,.12);
  transition: transform .18s ease;
}
.photo-action:active { transform: translate(-50%,52%) scale(.985); }
.photo-action svg { width: 29px; height: 29px; }

/* Crop */
.crop-state { min-height: 100svh; padding: 0 32px max(34px,env(safe-area-inset-bottom)); }
.crop-topbar { padding-right: 0; padding-left: 0; }
.change-button { justify-self: end; padding: 10px 0 10px 10px; font-size: 16px; }
.crop-shell { width: 100%; height: min(64svh,700px); overflow: hidden; border-radius: 28px; background: #d2c6bc; }
#cropImage { display: block; max-width: 100%; }
.crop-shell .cropper-container { height: 100% !important; }
.cropper-modal { background: #151311; opacity: .58; }
.cropper-view-box, .cropper-face { border-radius: 2px; }
.cropper-view-box { outline: 1px solid rgba(255,255,255,.88); outline-color: rgba(255,255,255,.88); }
.cropper-dashed { opacity: 0; }
.cropper-line { background: #fff; opacity: .55; }
.cropper-point { width: 26px !important; height: 26px !important; background: transparent !important; opacity: 1 !important; }
.cropper-point.point-n, .cropper-point.point-e, .cropper-point.point-s, .cropper-point.point-w { display: none; }
.cropper-point.point-ne { border-top: 6px solid #fff; border-right: 6px solid #fff; }
.cropper-point.point-nw { border-top: 6px solid #fff; border-left: 6px solid #fff; }
.cropper-point.point-se { border-right: 6px solid #fff; border-bottom: 6px solid #fff; }
.cropper-point.point-sw { border-bottom: 6px solid #fff; border-left: 6px solid #fff; }
.crop-copy { margin: 34px 10px 26px; }
.crop-copy h1 { margin: 0; font-family: var(--serif); font-size: clamp(43px,9vw,62px); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.crop-copy p { margin: 12px 0 0; color: var(--taupe); font-size: 19px; }
.detail-field { position: relative; display: grid; grid-template-columns: 42px auto 1fr; align-items: center; min-height: 80px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 15px; cursor: text; }
.detail-field svg { width: 30px; height: 30px; color: var(--taupe-dark); }
.detail-field span { font-size: 18px; }
.detail-field em { margin-left: 10px; color: var(--taupe); font-size: 14px; font-style: normal; }
.detail-field input { position: absolute; right: 18px; left: 60px; width: calc(100% - 78px); padding: 8px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; opacity: 0; }
.detail-field input::placeholder { color: #b2a59b; }
.detail-field:focus-within span, .detail-field:focus-within em, .detail-field:has(input:not(:placeholder-shown)) span, .detail-field:has(input:not(:placeholder-shown)) em { visibility: hidden; }
.detail-field:focus-within input, .detail-field:has(input:not(:placeholder-shown)) input { opacity: 1; }
.crop-submit { margin-top: 24px; font-size: 18px; }
.inline-status { min-height: 21px; margin: 13px 4px 0; color: var(--taupe-dark); font-size: 13px; text-align: center; }
.notice { margin-top: 15px; padding: 11px 13px; border-radius: 11px; background: #fff1c4; color: #725719; font-size: 13px; }

/* Results and saved */
.content-view { padding: 0 30px 125px; }
.results-heading { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 24px; margin: 30px 0 28px; }
.results-heading img { width: 96px; height: 96px; border-radius: 22px; background: var(--paper-deep); object-fit: cover; }
.results-heading h1, .section-header h1 { margin: 0 0 9px; font-family: var(--serif); font-size: clamp(41px,8vw,58px); font-weight: 400; letter-spacing: -.04em; line-height: .98; }
.product-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 31px 22px; }
.product-card { min-width: 0; }
.product-image-wrap { position: relative; overflow: hidden; width: 100%; aspect-ratio: .72; border-radius: 18px; background: #eee8e1; cursor: pointer; }
.product-image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.product-card:hover .product-image-wrap img { transform: scale(1.015); }
.card-heart { position: absolute; top: 12px; right: 12px; display: grid; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.88); color: #7f746b; place-items: center; cursor: pointer; backdrop-filter: blur(8px); }
.card-heart svg { width: 25px; height: 25px; }
.card-heart.saved { color: var(--pink); }
.card-heart.saved svg { fill: var(--pink); }
.top-match-badge { position: absolute; bottom: 12px; left: 12px; padding: 7px 12px; border-radius: 999px; background: rgba(251,230,235,.95); color: var(--pink); font-size: 12px; font-weight: 750; box-shadow: 0 5px 16px rgba(42,25,27,.1); backdrop-filter: blur(8px); }
.product-info { padding: 11px 8px 0; cursor: pointer; }
.product-info h2 { display: -webkit-box; margin: 0; overflow: hidden; font-family: var(--serif); font-size: clamp(18px,4vw,24px); font-weight: 400; letter-spacing: -.02em; line-height: 1.12; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-info p { margin: 7px 0 0; font-size: 17px; font-weight: 650; }
.product-info small { display: block; margin-top: 6px; overflow: hidden; color: var(--taupe); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.section-header { padding: max(45px,env(safe-area-inset-top)) 0 30px; }
.section-header .wordmark { margin-bottom: 45px; text-align: center; }
.section-header > p { margin: 0; color: var(--taupe); }
.empty-collection { padding: 80px 20px; text-align: center; }
.empty-collection svg { width: 62px; height: 62px; color: var(--pink); }
.empty-collection h2 { margin: 20px 0 8px; font-family: var(--serif); font-size: 32px; font-weight: 400; }
.empty-collection p { margin: 0 0 24px; color: var(--taupe); }
.empty-collection .secondary-button { width: auto; }

/* Detail */
.detail-view { padding-bottom: 48px; }
.detail-topbar { padding-right: 28px; padding-left: 28px; }
.heart-button svg { transition: fill .15s ease,color .15s ease; }
.heart-button.saved { color: var(--pink); }
.heart-button.saved svg { fill: var(--pink); }
.detail-image { display: block; width: calc(100% - 60px); max-height: 66svh; aspect-ratio: .82; margin: 10px 30px 0; border-radius: 25px; background: #eee8e1; object-fit: cover; }
.detail-copy { padding: 31px 45px 0; }
.product-source { margin: 0 0 12px; color: #7b6a5d; font-size: 13px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.detail-copy h1 { margin: 0; font-family: var(--serif); font-size: clamp(40px,8vw,62px); font-weight: 400; letter-spacing: -.035em; line-height: 1; }
.detail-price { margin: 13px 0 20px; font-size: 24px; }
.closest-match { display: flex; align-items: center; gap: 12px; margin: 22px 0 25px; font-size: 16px; }
.closest-match span { position: relative; width: 23px; height: 23px; border: 3px solid var(--pink); border-radius: 50%; }
.closest-match span::after { position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); content: ""; transform: translate(-50%,-50%); }
.retailer-button { gap: 12px; font-size: 18px; }
.retailer-button svg { width: 23px; height: 23px; }
/* Profile */
.profile-view { padding: 0 30px 125px; }
.settings-card { overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.48); }
.settings-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 86px; padding: 17px 20px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.settings-row:last-child { border-bottom: 0; }
.settings-row small { display: block; margin-bottom: 5px; color: var(--taupe); }
.settings-row strong { font-size: 17px; }
.settings-row > span:last-child { color: var(--taupe); font-size: 29px; }
.profile-note { margin: 24px 6px; color: var(--taupe); font-size: 13px; line-height: 1.55; }

/* Navigation, dialogs, feedback */
.bottom-nav { position: fixed; z-index: 30; right: 50%; bottom: 0; display: grid; width: min(100%,760px); min-height: 88px; padding: 9px 30px max(8px,env(safe-area-inset-bottom)); border-top: 1px solid rgba(197,184,173,.68); background: rgba(251,248,243,.94); grid-template-columns: repeat(3,1fr); transform: translateX(50%); backdrop-filter: blur(18px); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 3px 10px; border: 0; background: transparent; color: #95887c; font-size: 11px; cursor: pointer; }
.nav-item svg { width: 30px; height: 30px; }
.nav-item.active { color: var(--ink); }
.nav-item.active[data-view="search"] { color: var(--pink); }
.nav-item:focus-visible { border-radius: 12px; outline: 0; box-shadow: inset 0 0 0 2px rgba(233,62,107,.45); }
dialog { width: min(430px,calc(100% - 30px)); padding: 0; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 28px 90px rgba(35,25,20,.28); }
dialog::backdrop { background: rgba(22,17,14,.48); backdrop-filter: blur(4px); }
.market-dialog { padding: 25px; }
.market-dialog h2 { margin: 0 0 7px; font-family: var(--serif); font-size: 34px; font-weight: 400; }
.market-dialog p { margin: 0 0 20px; color: var(--taupe); line-height: 1.45; }
.market-dialog label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
.market-dialog select { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.dialog-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; margin-top: 18px; }
.dialog-actions button { min-height: 51px; }
.toast { position: fixed; z-index: 60; bottom: 105px; left: 50%; max-width: calc(100% - 40px); padding: 11px 17px; border-radius: 999px; background: #161412; color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%,12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 520px) {
  .app-shell { box-shadow: none; }
  .topbar { min-height: 72px; padding-right: 18px; padding-left: 18px; }
  .compact-wordmark { font-size: 42px; }
  .intro-view { padding-right: 22px; padding-left: 22px; }
  .intro-brand { font-size: 51px; }
  .intro-copy { margin-top: 25px; }
  .landing-state { padding: clamp(39px,6vh,60px) 18px 120px; }
  .landing-header { margin-bottom: 29px; }
  .landing-header p { margin-top: 16px; }
  .landing-hero { border-radius: 23px; }
  .landing-image { --crop-bottom: 20%; border-radius: 23px; }
  .photo-action { position: fixed; z-index: 31; bottom: calc(96px + env(safe-area-inset-bottom)); width: min(78%,330px); min-height: 61px; border-radius: 18px; font-size: 17px; transform: translateX(-50%); }
  .photo-action:active { transform: translateX(-50%) scale(.985); }
  .photo-action svg { width: 26px; height: 26px; }
  .crop-state { padding: 0 20px 28px; }
  .crop-topbar { padding-right: 0; padding-left: 0; }
  .crop-shell { height: min(55svh,520px); border-radius: 23px; }
  .crop-copy { margin: 28px 10px 22px; }
  .crop-copy p { font-size: 16px; }
  .detail-field { min-height: 76px; }
  .content-view, .profile-view { padding-right: 18px; padding-left: 18px; }
  .results-heading { grid-template-columns: 78px 1fr; gap: 18px; margin-top: 22px; }
  .results-heading img { width: 78px; height: 78px; border-radius: 18px; }
  .product-grid { gap: 27px 14px; }
  .product-image-wrap { border-radius: 15px; }
  .card-heart { top: 9px; right: 9px; width: 36px; height: 36px; }
  .product-info { padding-right: 3px; padding-left: 3px; }
  .product-info p { font-size: 15px; }
  .detail-image { width: calc(100% - 36px); margin-right: 18px; margin-left: 18px; border-radius: 22px; }
  .detail-copy { padding: 27px 28px 0; }
  .bottom-nav { min-height: 82px; padding-right: 18px; padding-left: 18px; }
}

@media (min-width: 761px) {
  .landing-state { padding-top: 48px; padding-bottom: 145px; }
  .landing-header { margin-bottom: 25px; }
  .landing-wordmark { font-size: 78px; }
  .landing-hero { width: min(100%,430px); }
  .crop-state { padding-right: 54px; padding-left: 54px; }
  .product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .saved-view .product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

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