:root {
  --paper: #f8f4ec;
  --surface: #fffdf8;
  --ink: #302d2a;
  --muted: #81786d;
  --line: #dfd4c4;
  --teal: #2f9c95;
  --rose: #cc6d6d;
  --sun: #e0b757;
  --shadow: 0 14px 34px rgba(66, 52, 36, 0.12);
}

* { box-sizing: border-box; }

html {
  touch-action: manipulation;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(47, 156, 149, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(204, 109, 109, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000, transparent 58%);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
a,
button,
input,
select,
[role="button"],
.swipe-card,
.product-card {
  touch-action: manipulation;
}
img { display: block; max-width: 100%; }

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px max(18px, calc((100vw - 1180px) / 2));
  background: rgba(248, 244, 236, 0.88);
  border-bottom: 1px solid rgba(223, 212, 196, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 3px solid var(--teal);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 -7px 0 rgba(47, 156, 149, 0.13);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  padding: 9px 12px;
  border-radius: 999px;
}

.top-nav a:hover {
  background: var(--surface);
  color: var(--ink);
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 18px;
  cursor: pointer;
}

.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.secondary-button,
.ghost-button {
  background: var(--surface);
  color: var(--ink);
}

.text-link {
  color: var(--teal);
  font-weight: 700;
}

.home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.7fr);
  gap: 34px;
  align-items: center;
  min-height: 520px;
  padding: 56px 0 34px;
}

.home-copy h1,
.page-title h1,
.picker-copy h1,
.about-page h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.94;
  font-weight: 500;
}

.lead,
.page-title p,
.picker-copy p,
.about-page p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.wishlist-preview,
.browse-panel,
.export-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
}

.wishlist-preview {
  padding: 18px;
}

.preview-title,
.section-head,
.result-meta,
.two-col {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  min-height: 220px;
}

.mini-grid img,
.mini-empty {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid #ebe4d8;
  background: #faf8f2;
  object-fit: cover;
}

.browse-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  margin: 18px 0 34px;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  background: white;
}

.search-shell input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.control-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

select,
.chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.chip.active {
  border-color: var(--teal);
  background: rgba(47, 156, 149, 0.1);
  color: #146e69;
}

.section-head,
.page-title,
.about-page {
  padding: 42px 0 18px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
  padding-bottom: 46px;
}

.product-card {
  position: relative;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 8px 18px rgba(66, 52, 36, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.product-image {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #eee7dc;
  border-radius: 6px;
  background: #fbfaf6;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-name {
  display: grid;
  gap: 3px;
  min-height: 54px;
}

.product-name strong {
  font-size: 16px;
  line-height: 1.25;
}

.product-name span,
.product-meta {
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.wish-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  cursor: pointer;
}

.wish-button.active {
  border-color: var(--rose);
  background: rgba(204, 109, 109, 0.1);
  color: #a94141;
}

.detail-page,
.wishlist-layout,
.picker-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 34px;
  padding: 50px 0;
}

.detail-media {
  display: grid;
  place-items: center;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-media img {
  width: min(86%, 620px);
  max-height: 620px;
  object-fit: contain;
}

.detail-copy h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
}

.detail-en {
  color: var(--muted);
  font-size: 22px;
}

.detail-meta,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.detail-meta span,
.tag-cloud span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

.wishlist-list {
  display: grid;
  gap: 12px;
}

.wishlist-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.wishlist-item img {
  width: 82px;
  height: 82px;
  border-radius: 6px;
  object-fit: contain;
  background: #fbfaf6;
}

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

.icon-button,
.round-button {
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.export-card {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.export-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.export-card input,
.export-card select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
}

.export-preview {
  display: grid;
  gap: 10px;
}

.export-preview-item {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
}

.export-preview-item img {
  width: 110px;
  max-height: 120px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.picker-page {
  grid-template-columns: minmax(260px, 0.7fr) minmax(300px, 1fr);
  align-items: center;
  min-height: calc(100vh - 160px);
}

.picker-stage {
  position: relative;
  height: min(68vh, 640px);
  min-height: 460px;
}

.swipe-card {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  touch-action: none;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease;
}

.swipe-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #fbfaf6;
}

.swipe-card h2 {
  margin: 14px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
}

.picker-actions {
  grid-column: 2;
  display: flex;
  justify-content: center;
  gap: 14px;
}

.round-button {
  min-width: 72px;
  min-height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 7px 12px;
  box-shadow: 0 10px 22px rgba(66, 52, 36, 0.12);
}

.round-button span {
  font-size: 28px;
  line-height: 1;
}

.round-button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.round-button.like { color: var(--rose); }
.round-button.skip { color: var(--muted); }
.round-button.undo { color: var(--teal); }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.66);
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 40px auto 0;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 820px) {
  main,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .top-nav a {
    min-width: 0;
    padding: 9px 6px;
    text-align: center;
    background: rgba(255, 253, 248, 0.66);
  }

  .home-shell,
  .detail-page,
  .wishlist-layout,
  .picker-page {
    grid-template-columns: 1fr;
  }

  .picker-actions {
    grid-column: auto;
  }

  .picker-page {
    min-height: 0;
    gap: 18px;
    padding: 22px 0 28px;
  }

  .picker-stage {
    height: min(56vh, 440px);
    min-height: 340px;
  }

  .swipe-card {
    padding: 12px;
  }

  .swipe-card h2 {
    font-size: 24px;
    line-height: 1.08;
  }

  .picker-actions {
    position: sticky;
    bottom: 10px;
    z-index: 12;
    padding: 8px;
    border: 1px solid rgba(223, 212, 196, 0.85);
    border-radius: 999px;
    background: rgba(248, 244, 236, 0.86);
    backdrop-filter: blur(14px);
  }

  .round-button {
    min-width: 72px;
    min-height: 56px;
    padding: 6px 10px;
  }

  .home-copy h1,
  .page-title h1,
  .picker-copy h1,
  .about-page h1 {
    font-size: 40px;
    line-height: 1.02;
  }

  .lead,
  .page-title p,
  .picker-copy p,
  .about-page p {
    font-size: 15px;
    line-height: 1.58;
  }

  .home-shell {
    min-height: 0;
    padding: 28px 0 20px;
    gap: 22px;
  }

  .browse-panel {
    padding: 12px;
    margin: 14px 0 24px;
  }

  .control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .control-row .ghost-button {
    grid-column: 1 / -1;
  }

  .two-col {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
  }

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

  .product-card {
    gap: 8px;
    padding: 9px;
  }

  .product-name {
    min-height: 0;
  }

  .product-name strong {
    font-size: 14px;
  }

  .product-name span,
  .product-meta {
    font-size: 12px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .wish-button,
  .ghost-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .wishlist-item {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
  }

  .wishlist-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .icon-button {
    width: 100%;
    border-radius: 999px;
  }

  .export-card {
    position: static;
  }
}

@media (max-width: 430px) {
  .brand {
    font-size: 20px;
  }

  .top-nav {
    font-size: 13px;
  }

  .home-copy h1,
  .page-title h1,
  .picker-copy h1,
  .about-page h1 {
    font-size: 34px;
  }

  .hero-actions,
  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mini-grid {
    min-height: 0;
    gap: 6px;
  }

  .product-grid {
    gap: 9px;
  }

  .product-card {
    padding: 8px;
  }

  .picker-stage {
    height: 52vh;
    min-height: 320px;
  }

  .round-button {
    min-width: 68px;
    min-height: 54px;
  }
}
