* { box-sizing: border-box; }
/* .home sets display:flex, which would otherwise override the hidden attribute */
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color: #202124;
  background: #fff;
}
a { color: #1a0dab; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Logo */
.logo { font-weight: 700; letter-spacing: -1px; margin: 0; user-select: none; }
.logo span:nth-child(4n+1) { color: #4285f4; }
.logo span:nth-child(4n+2) { color: #ea4335; }
.logo span:nth-child(4n+3) { color: #fbbc05; }
.logo span:nth-child(4n+4) { color: #34a853; }
.logo-big { font-size: 84px; margin-bottom: 28px; }
.logo-small { font-size: 28px; white-space: nowrap; }
.logo-small:hover { text-decoration: none; }

/* Search box */
.search-box {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px;
  border: 1px solid #dfe1e5; border-radius: 24px; background: #fff;
}
.search-box:hover, .search-box:focus-within { box-shadow: 0 1px 6px rgba(32,33,36,.28); border-color: transparent; }
.search-box input { flex: 1; border: 0; outline: 0; font-size: 16px; background: transparent; min-width: 0; }
.icon { width: 20px; height: 20px; fill: #9aa0a6; flex: none; }
.icon-btn { border: 0; background: none; padding: 0; cursor: pointer; display: flex; }
.icon-btn .icon { fill: #4285f4; }

/* Home */
.home {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 0 20px 18vh;
}
.home .search-form { width: min(584px, 100%); }
.buttons { display: flex; justify-content: center; margin-top: 28px; }
.buttons button {
  background: #f8f9fa; border: 1px solid #f8f9fa; border-radius: 4px; color: #3c4043;
  font-size: 14px; padding: 0 16px; height: 36px; cursor: pointer;
}
.buttons button:hover { border-color: #dadce0; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.sites-note { margin-top: 28px; color: #70757a; font-size: 13px; text-align: center; max-width: 584px; line-height: 1.6; }

/* Results layout */
.topbar {
  display: flex; align-items: center; gap: 28px; padding: 20px 24px 12px;
}
.topbar .search-form { flex: 1; max-width: 692px; }
.tabs {
  display: flex; gap: 4px; padding: 0 24px 0 160px; border-bottom: 1px solid #ebebeb; overflow-x: auto;
}
.tabs button {
  border: 0; background: none; padding: 12px 12px 10px; font-size: 14px; color: #5f6368;
  border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
}
.tabs button.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.tabs .count { color: #9aa0a6; margin-left: 4px; }
.more-sellers { align-self: center; margin-left: 4px; font-size: 13px; padding: 4px 6px; border: 1px solid #dadce0; border-radius: 4px; background: #fff; color: #5f6368; }
.more-sellers.active { border-color: #1a73e8; color: #1a73e8; }
.tabs-pending { align-self: center; color: #9aa0a6; font-size: 12px; white-space: nowrap; padding: 0 8px; }
.content { padding: 0 24px 60px 160px; max-width: 900px; }
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; color: #70757a; font-size: 14px;
}
.toolbar select { margin-left: 6px; font-size: 14px; padding: 2px 4px; max-width: 180px; }
.controls { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }

/* Notices */
.notice { font-size: 13px; padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; background: #fef7e0; color: #7a5b00; }
.notice.error { background: #fce8e6; color: #a50e0e; }
.loading { color: #70757a; padding: 30px 0; }

/* Result list */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid #f1f3f4; }
.item img { width: 92px; height: 92px; object-fit: contain; border-radius: 8px; background: #f8f9fa; flex: none; }
.item .body { min-width: 0; }
.item .site { font-size: 13px; color: #4d5156; display: flex; align-items: center; gap: 6px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; color: #fff; }
.badge.danawa { background: #00a4e4; }
.badge.enuri { background: #ff6c00; }
.badge.lotteon { background: #e60012; }
.badge.naver { background: #03c75a; }
.mall { font-weight: 600; color: #202124; }
.kind { font-size: 11px; color: #5f6368; border: 1px solid #dadce0; border-radius: 4px; padding: 0 5px; }
.item h3 { margin: 4px 0; font-size: 18px; font-weight: 400; line-height: 1.35; }
.item .price { font-size: 18px; font-weight: 700; color: #202124; }
.item .meta { font-size: 13px; color: #70757a; margin-top: 2px; }
.lowest { color: #188038; font-size: 12px; font-weight: 600; margin-left: 6px; }
.empty { color: #70757a; padding: 30px 0; }

/* Seller listings for comparison-site items */
.offers { margin-top: 8px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.muted { color: #70757a; }
.best-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.offer-price { font-weight: 700; color: #202124; }
.buy {
  background: #1a73e8; color: #fff; border-radius: 4px; padding: 3px 10px; font-size: 12px; font-weight: 600;
}
.buy:hover { background: #1765cc; text-decoration: none; }
.offers details summary { cursor: pointer; color: #1a73e8; }
.offer-list { list-style: none; margin: 6px 0 2px; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 4px; }
.offer-list a { display: flex; gap: 8px; color: inherit; }
.offer-list a:hover .mall { text-decoration: underline; }
.compare-link { color: #70757a; font-size: 12px; }

/* Link-only sites */
.links { margin-top: 32px; }
.links h2 { font-size: 18px; font-weight: 500; margin: 0 0 4px; }
.hint { color: #70757a; font-size: 13px; margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a {
  border: 1px solid #dadce0; border-radius: 18px; padding: 8px 16px; color: #3c4043; font-size: 14px;
}
.chips a:hover { background: #f8f9fa; text-decoration: none; }

@media (max-width: 760px) {
  .logo-big { font-size: 56px; }
  .topbar { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px 8px; }
  .topbar .logo-small { text-align: center; }
  .tabs { padding: 0 16px; }
  .content { padding: 0 16px 40px; }
  .item img { width: 72px; height: 72px; }
  .item h3 { font-size: 16px; }
}
