/* Design System v1: calm commerce feed with a warm, trustworthy brand tone. */
:root {
  --color-brand: #006241;
  --color-brand-dark: #004f35;
  --color-brand-soft: #e7f1ec;
  --color-background: #f7f5f0;
  --color-surface: #fff;
  --color-surface-soft: #f1efe9;
  --color-text: #17211c;
  --color-text-secondary: #65716b;
  --color-border: #e3e5e2;
  --color-price: #c84b38;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --shadow-card: 0 1px 2px rgb(23 33 28 / 4%);
  font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text);
  background: var(--color-background);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--color-background); }
a { -webkit-tap-highlight-color: transparent; }

/* Layout and header */
.site-header { background: rgb(255 255 255 / 90%); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 20; }
.header-inner, .page { width: min(1080px, calc(100% - 32px)); margin: auto; }
.header-inner { align-items: center; display: flex; gap: var(--space-3); min-height: 64px; }
.brand { color: var(--color-brand); font-size: clamp(1.5rem, 3vw, 1.7rem); font-weight: 800; letter-spacing: -.075em; text-decoration: none; white-space: nowrap; }
.header-inner p { color: var(--color-text-secondary); font-size: .82rem; margin: 0; }
.header-actions { margin-left: auto; }
.notification-bell, .notification-icon-button { align-items: center; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-pill); color: var(--color-text); cursor: pointer; display: inline-flex; font: inherit; justify-content: center; min-height: 38px; min-width: 38px; position: relative; }
.notification-bell:hover, .notification-bell:focus-visible { border-color: #b8d6c7; outline: 2px solid rgb(0 98 65 / 18%); outline-offset: 2px; }
.notification-badge { align-items: center; background: var(--color-price); border: 2px solid #fff; border-radius: var(--radius-pill); color: #fff; display: flex; font-size: .62rem; font-weight: 800; height: 19px; justify-content: center; line-height: 1; min-width: 19px; padding: 0 4px; position: absolute; right: -7px; top: -7px; }
.notification-badge[hidden], .notification-panel[hidden] { display: none; }
.notification-panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: 0 14px 38px rgb(23 33 28 / 18%); max-height: min(650px, calc(100vh - 88px)); overflow: auto; padding: var(--space-4); position: fixed; right: max(16px, calc((100vw - 1080px) / 2)); top: 76px; width: min(420px, calc(100vw - 32px)); z-index: 30; }
.notification-panel-heading { align-items: flex-start; display: flex; justify-content: space-between; }
.notification-kicker { color: var(--color-brand); font-size: .72rem; font-weight: 800; margin: 0 0 2px; }
.notification-panel h2 { font-size: 1.15rem; letter-spacing: -.035em; margin: 0; }
.notification-icon-button { border-radius: var(--radius-sm); font-size: 1.25rem; }
.notification-filters, .notification-actions { display: flex; gap: 6px; margin-top: var(--space-3); }
.notification-filters button, .notification-actions button, .notification-row-controls button, .notification-message button { background: var(--color-surface-soft); border: 1px solid var(--color-border); border-radius: var(--radius-pill); color: var(--color-text-secondary); cursor: pointer; font: inherit; font-size: .74rem; min-height: 34px; padding: 6px 9px; }
.notification-filters button[aria-pressed="true"] { background: var(--color-brand); border-color: var(--color-brand); color: #fff; font-weight: 750; }
.notification-actions { justify-content: space-between; }
.notification-actions button:last-child { margin-left: auto; }
.notification-message { color: var(--color-brand-dark); font-size: .78rem; min-height: 1.2em; margin: var(--space-2) 0; }
.notification-message button { margin-left: 4px; }
.notification-list { border-top: 1px solid var(--color-border); }
.notification-row { align-items: stretch; border-bottom: 1px solid var(--color-border); display: flex; gap: 6px; padding: var(--space-2) 0; }
.notification-row.is-unread { border-left: 3px solid var(--color-price); padding-left: var(--space-2); }
.notification-open { background: transparent; border: 0; color: var(--color-text); cursor: pointer; display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; padding: 0; text-align: left; }
.notification-open strong { font-size: .85rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-keyword { color: var(--color-brand); font-size: .71rem; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-meta { color: var(--color-text-secondary); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-row-controls { align-items: flex-end; display: flex; flex-direction: column; gap: 4px; }
.notification-row-controls button { min-height: 32px; padding: 4px 7px; }
.notification-empty { color: var(--color-text-secondary); font-size: .84rem; line-height: 1.55; padding: var(--space-5) 0 var(--space-2); text-align: center; }
.mobile-break { display: none; }
.page { padding: var(--space-5) 0 56px; }

/* Compact intro */
.hero { padding: 4px 0 var(--space-5); }
.eyebrow { color: var(--color-brand); font-size: .78rem; font-weight: 750; letter-spacing: .02em; margin: 0 0 var(--space-2); }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.15rem); letter-spacing: -.055em; line-height: 1.3; margin: 0; }
.hero > p:last-child { color: var(--color-text-secondary); font-size: .88rem; margin: var(--space-3) 0 0; }
.deal-search { margin: 0 0 var(--space-4); }
.deal-search label { display: block; font-size: .8rem; font-weight: 750; margin-bottom: 6px; }
.deal-search > div { align-items: center; display: flex; gap: var(--space-2); }
.deal-search input[type="search"] { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-pill); color: var(--color-text); flex: 1; font: inherit; min-width: 0; padding: 10px 14px; }
.deal-search input[type="search"]:focus { border-color: var(--color-brand); outline: 2px solid rgb(0 98 65 / 18%); outline-offset: 1px; }
.deal-search button { background: var(--color-brand); border: 0; border-radius: var(--radius-pill); color: #fff; cursor: pointer; font: inherit; font-size: .86rem; font-weight: 750; padding: 10px 16px; }
.deal-search a { color: var(--color-text-secondary); font-size: .8rem; text-decoration: none; white-space: nowrap; }
.search-message { color: var(--color-text-secondary); font-size: .82rem; margin: var(--space-2) 0 0; }
.search-message strong { color: var(--color-brand-dark); }

/* Category navigation */
.category-nav { display: flex; gap: var(--space-2); margin: 0 calc(var(--space-2) * -1); overflow-x: auto; padding: 0 var(--space-2) var(--space-5); scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.category-nav a { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-pill); color: #435148; font-size: .86rem; padding: 8px 14px; text-decoration: none; white-space: nowrap; }
.category-nav a:hover { background: var(--color-brand-soft); border-color: #c9ddd2; }
.category-nav a[aria-current="page"] { background: var(--color-brand); border-color: var(--color-brand); color: #fff; font-weight: 700; }
.sort-nav { display: flex; gap: var(--space-2); margin: 0 0 var(--space-3); overflow-x: auto; scrollbar-width: none; }
.sort-nav a { border-bottom: 2px solid transparent; color: var(--color-text-secondary); font-size: .9rem; font-weight: 750; padding: 7px 4px; text-decoration: none; white-space: nowrap; }
.sort-nav a[aria-current="page"] { border-color: var(--color-brand); color: var(--color-brand-dark); }
.deal-summary-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-4); }
.deal-summary-chips a { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-pill); color: var(--color-text-secondary); font-size: .76rem; padding: 6px 10px; text-decoration: none; }
.deal-summary-chips a:hover, .deal-summary-chips a:focus-visible { background: var(--color-brand-soft); border-color: #c9ddd2; outline: none; }
.deal-summary-chips a[aria-current="page"] { background: var(--color-brand); border-color: var(--color-brand); color: #fff; font-weight: 700; }

/* Deal feed */
.section-heading { align-items: baseline; display: flex; justify-content: space-between; margin: 0 0 var(--space-3); }
.section-heading h2 { font-size: clamp(1.22rem, 3vw, 1.45rem); letter-spacing: -.04em; margin: 0; }
.section-heading > p { color: var(--color-text-secondary); font-size: .8rem; margin: 0; }
.deals { display: grid; gap: 10px; }
.deal-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); color: inherit; display: flex; gap: var(--space-3); min-width: 0; padding: var(--space-3); text-decoration: none; transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease; }
.deal-card:hover, .deal-card:focus-visible { border-color: #b8d6c7; box-shadow: 0 7px 20px rgb(23 33 28 / 8%); outline: none; transform: translateY(-2px); }
.deal-thumb { background: var(--color-surface-soft); border-radius: var(--radius-md); flex: 0 0 108px; height: 108px; overflow: hidden; }
.deal-thumb img, .detail-image img { display: block; height: 100%; object-fit: cover; width: 100%; }
.thumb-placeholder { align-items: center; color: #94a399; display: flex; flex-direction: column; font-size: 1.3rem; gap: var(--space-1); justify-content: center; }
.thumb-placeholder small { font-size: .66rem; font-weight: 600; }
.deal-card-body { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.card-top { align-items: center; display: flex; gap: var(--space-2); min-height: 18px; }
.category { color: var(--color-brand); font-size: .78rem; font-weight: 750; }
.group-badge { background: var(--color-brand-soft); border-radius: var(--radius-pill); color: var(--color-brand-dark); font-size: .68rem; font-weight: 700; padding: 3px 7px; }
.price-badge { background: #fff1eb; border-radius: var(--radius-pill); color: #a33d2d; font-size: .68rem; font-weight: 750; padding: 3px 7px; }
.hot-badge { background: #fdf0d8; border-radius: var(--radius-pill); color: #8b5a14; font-size: .68rem; font-weight: 750; padding: 3px 7px; }
.deal-card h2 { -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--color-text); display: -webkit-box; font-size: 1rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.42; margin: 3px 0 auto; overflow: hidden; }
.price-row { align-items: baseline; display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.price-row strong, .detail-price { color: var(--color-price); font-size: 1.3rem; font-weight: 800; letter-spacing: -.035em; }
.price-row span, .shipping { color: var(--color-text-secondary); font-size: .84rem; }
.unit-price { color: var(--color-text-secondary); font-size: .76rem; margin-top: 3px; }
.detail, .deal-meta { align-items: center; color: var(--color-text-secondary); display: flex; flex-wrap: wrap; font-size: .77rem; gap: 5px; margin-top: var(--space-2); }
.new-time { color: var(--color-brand); font-weight: 750; }
.empty { background: var(--color-surface); border: 1px dashed #d5d8d4; border-radius: var(--radius-lg); color: var(--color-text-secondary); padding: 32px; text-align: center; }
.load-more-wrap { display: flex; justify-content: center; margin: var(--space-5) 0 0; }
.load-more { background: var(--color-brand); border: 0; border-radius: var(--radius-pill); color: #fff; cursor: pointer; font: inherit; font-weight: 750; min-height: 46px; padding: 12px 24px; }
.load-more:hover, .load-more:focus-visible { background: var(--color-brand-dark); outline: none; }
.load-more:disabled { cursor: wait; opacity: .62; }
.load-more-error { color: var(--color-price); font-size: .84rem; margin: var(--space-2) 0 0; text-align: center; }
.new-deal-alert { align-items: center; background: var(--color-brand-dark); border: 1px solid rgb(255 255 255 / 25%); border-radius: var(--radius-md); bottom: var(--space-4); box-shadow: 0 10px 28px rgb(23 33 28 / 22%); color: #fff; display: flex; gap: var(--space-3); max-width: min(430px, calc(100vw - 32px)); padding: var(--space-3) var(--space-4); position: fixed; right: var(--space-4); z-index: 10; }
.new-deal-alert[hidden] { display: none; }
.new-deal-alert strong { font-size: .9rem; }
.new-deal-alert p { color: rgb(255 255 255 / 78%); font-size: .76rem; margin: 4px 0 0; }
.new-deal-alert button { background: #fff; border: 0; border-radius: var(--radius-pill); color: var(--color-brand-dark); cursor: pointer; font: inherit; font-size: .8rem; font-weight: 750; padding: 9px 12px; white-space: nowrap; }

/* Detail */
.back { color: var(--color-text-secondary); display: inline-block; font-size: .88rem; margin-bottom: var(--space-4); text-decoration: none; }
.back:hover, .back:focus-visible { color: var(--color-brand); }
.deal-detail { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: clamp(20px, 4vw, 38px); }
.deal-detail h1 { font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -.05em; line-height: 1.35; margin: var(--space-2) 0 var(--space-4); }
.detail-summary { align-items: flex-start; display: flex; gap: var(--space-4); margin-bottom: var(--space-4); }
.detail-copy { flex: 1; min-width: 0; }
.detail-image { align-items: center; background: var(--color-surface-soft); border-radius: var(--radius-md); display: flex; flex: 0 0 200px; height: 200px; justify-content: center; max-height: 240px; max-width: 240px; overflow: hidden; }
.detail-image img { height: auto; max-height: 100%; max-width: 100%; object-fit: contain; width: auto; }
.detail-price { font-size: clamp(1.55rem, 4vw, 1.85rem); }
.shipping { margin-top: var(--space-1); }
.deal-meta { border-bottom: 1px solid var(--color-border); margin: var(--space-4) 0 0; padding-bottom: var(--space-4); }
dl { border-top: 0; display: grid; grid-template-columns: 110px 1fr; margin: 0 0 var(--space-5); }
dt, dd { border-bottom: 1px solid var(--color-border); font-size: .88rem; margin: 0; padding: var(--space-3) 0; }
dt { color: var(--color-text-secondary); } dd { color: var(--color-text); }
.source-button { background: var(--color-brand); border-radius: var(--radius-pill); color: #fff; display: inline-block; font-size: .92rem; font-weight: 750; padding: 12px 18px; text-decoration: none; transition: background 170ms ease, transform 170ms ease; }
.source-button:hover, .source-button:focus-visible { background: var(--color-brand-dark); outline: none; transform: translateY(-1px); }
.same-products { margin-top: var(--space-4); }
.same-products h2 { font-size: 1.05rem; letter-spacing: -.03em; margin: 0 0 var(--space-2); }
.same-products ul { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); list-style: none; margin: 0; padding: 0; }
.same-products li { align-items: center; border-bottom: 1px solid var(--color-border); display: flex; gap: var(--space-2); justify-content: space-between; padding: var(--space-3); }
.same-products li:last-child { border-bottom: 0; }
.same-products li > a:first-child { align-items: baseline; color: var(--color-text); display: flex; flex: 1; flex-wrap: wrap; font-size: .84rem; gap: 7px; text-decoration: none; }
.same-products li > a:first-child span, .same-products time, .related-source { color: var(--color-text-secondary); font-size: .76rem; }
.same-products li strong { color: var(--color-price); }
.related-source { text-decoration: none; white-space: nowrap; }
.same-products li.is-lowest-current { background: #f2f8f4; }
.price-information { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin-top: var(--space-4); padding: var(--space-4); }
.price-info-heading { align-items: center; display: flex; gap: var(--space-2); justify-content: space-between; }
.price-information h2 { font-size: 1.05rem; letter-spacing: -.03em; margin: 0; }
.price-information > p { color: var(--color-text-secondary); font-size: .88rem; line-height: 1.55; margin: var(--space-3) 0 0; }
.price-information dl { margin: var(--space-3) 0; }
.price-information h3 { font-size: .9rem; margin: var(--space-4) 0 var(--space-2); }
.price-history { list-style: none; margin: 0; padding: 0; }
.price-history li { border-top: 1px solid var(--color-border); display: flex; font-size: .82rem; gap: var(--space-3); padding: 8px 0; }
.price-history time, .price-history span { color: var(--color-text-secondary); }
.price-history strong { color: var(--color-price); }
.price-history em { color: var(--color-brand); font-size: .72rem; font-style: normal; font-weight: 700; }
.price-graph { display: block; height: auto; margin: var(--space-3) 0 0; max-width: 340px; width: 100%; }
.price-graph line { stroke: var(--color-border); }
.price-graph polyline { fill: none; stroke: var(--color-brand); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.price-graph text { fill: var(--color-text-secondary); font-size: 8px; }
.not-found { padding: 48px 0; }

@media (min-width: 720px) { .deals { grid-template-columns: repeat(2, minmax(0, 1fr)); } .deal-card { min-height: 132px; } }
@media (max-width: 540px) {
  .header-inner, .page { width: min(100% - 24px, 1080px); }
  .header-inner { min-height: 58px; }
  .header-inner p { display: none; }
  .notification-panel { border-radius: 0 0 var(--radius-lg) var(--radius-lg); left: 0; max-height: min(70vh, 620px); right: 0; top: 58px; width: 100%; }
  .notification-actions { flex-wrap: wrap; }
  .notification-actions button:last-child { margin-left: 0; }
  .page { padding-top: 16px; }
  .hero { padding: 0 0 12px; }
  .hero h1 { font-size: 1.5rem; line-height: 1.32; }
  .hero h1 br { display: none; }
  .hero > p:last-child { margin-top: 6px; }
  .category-nav { padding-bottom: 14px; }
  .deal-card { gap: 11px; padding: 10px; }
  .deal-thumb { flex-basis: 88px; height: 88px; }
  .deal-card h2 { font-size: .95rem; }
  .price-row strong { font-size: 1.15rem; }
  .deal-search > div { flex-wrap: wrap; }
  .deal-search input[type="search"] { flex-basis: calc(100% - 68px); }
  .new-deal-alert { bottom: var(--space-3); left: var(--space-3); max-width: none; right: var(--space-3); }
  .detail-summary { align-items: flex-start; flex-direction: column; gap: var(--space-3); }
  .detail-image { flex-basis: 128px; height: 128px; width: 128px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
