:root {
  --canvas: #f3f8f4;
  --paper: #ffffff;
  --ink: #18372a;
  --muted: #6d7c75;
  --line: #dbe8df;
  --mint: #daf3e4;
  --coral: #ff7a5c;
  --coral-soft: #fff0eb;
  --shadow: 0 8px 24px rgba(24, 55, 42, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  background: #e8efea;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: #e8efea;
  font-family: Pretendard, "Apple SD Gothic Neo", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 122, 92, 0.48);
  outline-offset: 3px;
}

.page-shell {
  width: min(100%, 500px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--canvas);
  box-shadow: 0 0 60px rgba(24, 55, 42, 0.1);
}

.site-header {
  display: flex;
  justify-content: flex-end;
  min-height: 66px;
  padding: max(16px, env(safe-area-inset-top)) 20px 8px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.icon-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile {
  padding: 2px 22px 30px;
  text-align: center;
}

.profile-mark {
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  place-items: center;
}

.profile-mark img {
  display: block;
  width: 76px;
  height: 76px;
}

.profile h1 {
  margin: 0;
  font-family: ui-rounded, "Arial Rounded MT Bold", Pretendard, sans-serif;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.profile p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.category-feed {
  display: grid;
  gap: 13px;
  padding: 0 22px 12px;
}

.category-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 78px;
  padding: 14px 15px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease;
}

.category-card[data-type="product"] {
  border-color: #f2d8cf;
  background: linear-gradient(135deg, #fff, #fff5f1);
}

.category-card[data-type="gift"] {
  border-color: #efd89e;
  background: linear-gradient(135deg, #fffdf8, #fff8e7);
}

.category-card:hover,
.detail-card:hover {
  border-color: #8dceaa;
  transform: translateY(-2px);
}

.category-card:active,
.detail-card:active {
  transform: scale(0.985);
}

.category-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: var(--mint);
  font-size: 22px;
}

.category-card[data-type="product"] .category-icon {
  background: var(--coral-soft);
}

.category-card[data-type="gift"] .category-icon {
  background: #fff0bd;
}

.category-title {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-arrow,
.item-arrow {
  color: #8b9b93;
  font-size: 24px;
  line-height: 1;
  text-align: center;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: max(16px, env(safe-area-inset-top)) 20px 8px;
}

.detail-main {
  padding-top: 10px;
}

.detail-intro {
  padding: 0 22px 28px;
}

.detail-brand {
  display: block;
  margin-bottom: 8px;
  color: #668174;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.detail-intro h1 {
  margin: 0;
  font-family: ui-rounded, "Arial Rounded MT Bold", Pretendard, sans-serif;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.detail-intro p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.detail-list {
  display: grid;
  gap: 11px;
  padding: 0 22px 12px;
}

.detail-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 13px;
  min-height: 86px;
  padding: 11px 13px 11px 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease;
}

.detail-card.is-static {
  grid-template-columns: 62px minmax(0, 1fr);
}

.item-thumb {
  display: grid;
  width: 62px;
  height: 62px;
  overflow: hidden;
  place-items: center;
  border-radius: 17px;
  background: var(--mint);
  font-size: 26px;
}

.item-thumb[data-type="gift"] {
  background: #fff0bd;
}

.item-thumb[data-type="product"] {
  background: var(--coral-soft);
}

.item-thumb img {
  width: 100%;
  height: 100%;
  padding: 4px;
  background: #fff;
  object-fit: contain;
}

.item-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.item-copy strong {
  overflow: hidden;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-copy > span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-card,
.empty-state {
  padding: 24px 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
  font-size: 15px;
}

.affiliate-note {
  margin: -10px 22px 18px;
  padding: 0;
  color: var(--muted);
}

.affiliate-note-label {
  display: none;
}

.affiliate-note p {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.site-footer {
  padding: 25px 24px calc(30px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 40px);
  padding: 11px 16px;
  color: #fff;
  border-radius: 999px;
  background: rgba(24, 55, 42, 0.95);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(50%, 0);
}

.noscript {
  position: fixed;
  inset: auto 12px 12px;
  z-index: 50;
  padding: 12px;
  color: #fff;
  border-radius: 12px;
  background: #8c3020;
  text-align: center;
}

@media (max-width: 360px) {
  .profile,
  .category-feed,
  .detail-intro,
  .detail-list {
    padding-inline: 16px;
  }

  .site-header,
  .detail-header {
    padding-inline: 16px;
  }

  .affiliate-note {
    margin-inline: 16px;
  }

  .category-title,
  .item-copy strong {
    font-size: 15px;
  }
}

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