/*
 * Glowmeter base stylesheet — W-WEB-16 (2026-07-22)
 * Modern K-tech typography (Pretendard-only) + coral accent.
 * Preserves every class name from Day-1..W-WEB-15 templates.
 * Rollback path: /home/oyspy/backups/w-web-16-*/base.css.orig
 */

:root {
  --bg: #fafaf9;
  --paper: #ffffff;
  --ink: #171512;
  --ink-soft: #3d3833;
  --muted: #78716c;
  --muted-2: #a8a29e;
  --line: #eeece7;
  --line-strong: #dcd8cf;
  --accent: #e0533d;
  --accent-deep: #b13f2d;
  --accent-soft: #fce9e4;
  --good: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system,
    BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR',
    sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: 'ss03', 'ss04';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }

.wrap { max-width: 960px; margin: 0 auto; padding: 24px 24px 56px; }

/* SEO P1 #15 (2026-07-24): visually-hidden helper for search-engine /
   screen-reader-only headings (e.g. the invisible <h1> on the home page
   that keeps W-WEB-13 "webapp-first" visual layout intact but still
   provides a single topical H1 for crawlers). WCAG "visually-hidden"
   pattern — accessible-name preserved, no visual footprint. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---- Header ---- */
header.site {
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 4px 0 14px; margin-bottom: 20px;
}
header.site .brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: -.03em; font-size: 19px;
  color: var(--ink); text-decoration: none;
}
header.site .brand:hover { color: var(--ink); }
header.site .brand-dot {
  display: inline-block; width: 9px; height: 9px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex-shrink: 0;
}
header.site .tagline { display: none; }
header.site .site-search {
  flex: 1; max-width: 360px; margin-left: 4px;
}
header.site .site-search input {
  width: 100%; padding: 8px 14px;
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 8px; font: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
header.site .site-search input::placeholder {
  color: var(--muted-2); font-weight: 400;
}
header.site .site-search input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
header.site .locale-switcher {
  margin-left: auto; display: flex; gap: 3px; align-items: center;
}
header.site .deals-link-nav,
header.site .watchlist-link {
  padding: 6px 11px; border-radius: 6px;
  font-size: 13px; font-weight: 600; letter-spacing: -.01em;
  color: var(--muted); background: transparent;
  border: 0; text-decoration: none;
  transition: all .1s;
  display: inline-flex; align-items: center; gap: 4px;
}
header.site .deals-link-nav:hover,
header.site .watchlist-link:hover {
  color: var(--accent); background: var(--accent-soft);
}
header.site .nav-icon { color: var(--accent); font-weight: 700; }
header.site .loc-group {
  display: inline-flex; margin-left: 6px;
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 2px;
}
.loc-link {
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
  color: var(--muted); background: transparent;
  border: 0; text-decoration: none;
  transition: all .1s;
}
.loc-link:hover { color: var(--ink); }
.loc-link.active { background: var(--ink); color: var(--paper); }

/* ---- Typography ---- */
h1 {
  font-size: 26px; line-height: 1.25; margin: 0 0 4px;
  letter-spacing: -.02em; font-weight: 800;
}
.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.muted { color: var(--muted); }
.strike {
  color: var(--muted-2); text-decoration: line-through;
  font-weight: 500;
}
code {
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: 12.5px;
  background: var(--line); color: var(--ink);
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: -.005em;
}

/* ---- Card (generic) ---- W-WEB-18 (2026-07-22): visibility bump */
.card {
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 20px; margin: 20px 0;
  box-shadow: 0 1px 2px rgba(23, 21, 18, .04);
}
.card h2 {
  font-size: 16px; font-weight: 700; letter-spacing: -.015em;
  margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.card p { margin: 0 0 10px; letter-spacing: -.005em; }
.card p:last-child { margin-bottom: 0; }

/* ---- Section headers (used by trending + drops) ---- */
.section-title {
  font-size: 22px; font-weight: 800;
  letter-spacing: -.028em; color: var(--ink);
  margin: 0 0 4px; line-height: 1.25;
}
.section-sub {
  display: block; font-size: 12.5px; font-weight: 500;
  color: var(--muted); letter-spacing: -.005em;
  margin-top: 3px;
}

/* ---- Trending grid + card ---- */
.trending-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.trending-title { display: flex; flex-direction: column; }
.trending-title .section-sub { margin-top: 3px; }
.trending-controls {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
}
.trending-controls .sort-label {
  color: var(--muted); font-weight: 500;
}
.trending-controls select {
  padding: 6px 10px; border: 1px solid var(--line-strong);
  background: var(--paper); border-radius: 6px;
  font: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--ink); cursor: pointer;
}
.trending-controls select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
/* Legacy .deals-link inside sort selector (kept safe if any template still uses it) */
.trending-controls .deals-link {
  padding: 5px 10px; border: 1px solid var(--accent);
  border-radius: 6px; color: var(--accent); text-decoration: none;
  font-weight: 600; font-size: 12.5px;
}
.trending-controls .deals-link:hover { background: var(--accent); color: white; }

.trending-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) { .trending-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .trending-grid { grid-template-columns: repeat(2, 1fr); } }

.sku-card {
  display: flex; flex-direction: column;
  padding: 14px 14px 12px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink); text-decoration: none;
  min-height: 158px;
  box-shadow: 0 1px 2px rgba(23, 21, 18, .04);
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.sku-card:hover {
  border-color: var(--ink); transform: translateY(-2px);
  box-shadow: 0 6px 20px -6px rgba(23, 21, 18, .18);
  color: var(--ink);
}
.sku-brand {
  font-size: 11px; font-weight: 700; letter-spacing: -.005em;
  color: var(--muted); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sku-name {
  font-size: 13.5px; font-weight: 500;
  color: var(--ink); line-height: 1.4;
  margin: 0 0 auto; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}
.sku-price-row {
  display: flex; align-items: baseline; gap: 6px;
  margin-top: 12px; flex-wrap: wrap;
}
.sku-price {
  font-size: 20px; font-weight: 800; letter-spacing: -.03em;
  color: var(--ink); line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}
.sku-strike {
  font-size: 12px; color: var(--muted-2); font-weight: 500;
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}
.sku-badges {
  display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px;
}
.sku-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: -.005em;
  text-decoration: none; border: 0;
}
.badge-fake_sale   { color: #991b1b; background: #fee2e2; }
.badge-true_low    { color: #14532d; background: #dcfce7; }
.badge-normal_sale { color: #1e3a8a; background: #dbeafe; }
.badge-90d-low     { color: #92400e; background: #fef3c7; }

/* ---- A34.a-turn1 (2026-07-24): cross-merchant delta chip ----
   Small muted comparison badge below .sku-badges on trending cards
   (also reused on .sku-priceline of the SKU detail page). Rendered
   only when the SKU has recent Naver-shop coverage (~50% of trending
   in KR, per prod snapshot). Three tones:
    --good    → OY is CHEAPER (green)     (cross_delta_pct < 0)
    --neutral → parity 0-5%    (muted grey)
    --bad     → OY is >5% more expensive (red) */
.sku-cross {
  display: inline-flex; align-items: center;
  margin-top: 6px; padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: -.005em;
  font-variant-numeric: tabular-nums;
  align-self: flex-start;
}
.sku-cross--good    { color: var(--good); background: #dcfce7; }
.sku-cross--neutral { color: var(--muted); background: var(--line); }
.sku-cross--bad     { color: var(--bad); background: #fee2e2; }

.sku-meta {
  font-size: 11px; color: var(--muted); font-weight: 500;
  margin-top: 6px; letter-spacing: -.005em;
}

/* ---- Ext promo banner ---- */
.ext-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; margin: 0 0 24px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 13.5px;
  position: relative; overflow: hidden;
}
.ext-banner::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent);
}
/* .ext-tag — new marker; .ext-icon kept for back-compat */
.ext-banner .ext-tag,
.ext-banner .ext-icon {
  display: inline-flex; align-items: center; flex-shrink: 0;
  padding: 3px 8px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase;
}
.ext-banner .ext-copy { flex: 1; color: var(--ink-soft); font-weight: 500; }
.ext-banner .ext-copy strong { color: var(--ink); font-weight: 700; }
.ext-banner .ext-cta {
  font-size: 12.5px; font-weight: 600; letter-spacing: -.01em;
  color: var(--accent); padding: 6px 12px;
  border: 1px solid var(--accent); border-radius: 6px;
  flex-shrink: 0;
  transition: all .1s;
}
.ext-banner .ext-cta:hover { background: var(--accent); color: white; }
.ext-banner .ext-dismiss {
  background: none; border: 0; color: var(--muted-2);
  font-size: 20px; line-height: 1; cursor: pointer;
  padding: 4px 6px; border-radius: 4px; flex-shrink: 0;
}
.ext-banner .ext-dismiss:hover { color: var(--ink); background: var(--line); }

/* ---- Drops preview (below trending on home) ---- */
.drops-preview { margin: 32px 0 0; }
.drops-preview-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px; flex-wrap: wrap; gap: 6px;
}
.drops-preview-header .section-title { margin: 0; }
.see-all-link {
  font-size: 12.5px; font-weight: 600; letter-spacing: -.01em;
  color: var(--accent);
}
.see-all-link:hover { color: var(--accent-deep); }
.drops-preview-list {
  list-style: none; padding: 0; margin: 0;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--paper); overflow: hidden;
  box-shadow: 0 1px 2px rgba(23, 21, 18, .04);
}
.drops-preview-list li + li { border-top: 1px solid var(--line); }
.drops-preview-item {
  display: grid; grid-template-columns: 68px 1fr auto;
  gap: 14px; align-items: center; padding: 14px 18px;
  color: var(--ink); text-decoration: none;
  transition: background .1s;
}
.drops-preview-item:hover { background: var(--bg); color: var(--ink); }
.drops-pct {
  font-size: 19px; font-weight: 800; letter-spacing: -.03em;
  color: var(--bad); text-align: center;
  font-variant-numeric: tabular-nums;
}
.drops-meta {
  display: flex; flex-direction: column; min-width: 0; gap: 2px;
}
.drops-meta .drops-brand {
  font-size: 11px; font-weight: 700; letter-spacing: -.005em;
  color: var(--muted); text-transform: none;
}
.drops-meta .drops-name {
  font-size: 14px; font-weight: 500; color: var(--ink);
  letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drops-price {
  text-align: right; font-size: 15px; font-weight: 700;
  color: var(--ink); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.drops-price strong { color: var(--ink); font-weight: 800; }
.drops-price .strike {
  font-size: 12px; font-weight: 500;
  color: var(--muted-2);
  margin-left: 6px;
}

/* ---- Live activity + footer ---- */
.live-activity {
  font-size: 12.5px; padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line); color: var(--ink-soft);
}
footer.prov {
  margin-top: 40px; padding: 18px 22px;
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 10px; font-size: 13px; font-weight: 500;
  color: var(--ink-soft); letter-spacing: -.005em;
  box-shadow: 0 1px 2px rgba(23, 21, 18, .04);
}
footer.prov .row { margin: 4px 0; line-height: 1.7; }
footer.prov strong {
  color: var(--ink); font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.015em;
}
.footnote { color: var(--muted); font-size: 11px; margin-top: 12px; }
.prov-footer { font-size: 12px; }

/* ---- SKU detail page ---- */
.sku-top { margin-bottom: 18px; }
.sku-title {
  font-size: 24px; font-weight: 800; letter-spacing: -.025em;
  margin: 0 0 8px; line-height: 1.2;
}
.sku-title-brand {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: -.005em; color: var(--muted);
  margin-bottom: 4px;
}
.sku-title-name-kor {
  display: block; font-weight: 800; color: var(--ink);
  letter-spacing: -.02em;
}
.sku-title-name-en {
  font-size: 14px; color: var(--muted); font-weight: 500;
  margin-top: 3px; letter-spacing: -.005em;
}
.sku-priceline {
  display: flex; gap: 12px; align-items: baseline;
  flex-wrap: wrap; margin-top: 10px;
}
.sku-price-now {
  font-size: 26px; font-weight: 800; letter-spacing: -.03em;
  color: var(--ink); font-variant-numeric: tabular-nums lining-nums;
}
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: -.005em;
  border: 0; text-transform: none;
}
.badge-good { background: #dcfce7; color: #14532d; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-bad  { background: #fee2e2; color: #991b1b; }
.fake-sale-banner {
  display: block; padding: 12px 14px; margin: 12px 0;
  font-size: 13px; font-weight: 500; letter-spacing: -.005em;
  border-radius: 8px;
}

.hero-grid {
  display: grid; gap: 14px;
  grid-template-columns: 1.4fr 1fr;
}
@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero-chart canvas { width: 100% !important; height: 220px !important; }

.inci-list {
  list-style: decimal inside; margin: 0; padding: 0;
  font-size: 13.5px;
}
.inci-item { padding: 5px 0; border-bottom: 1px dotted var(--line); }
.inci-item:last-child { border-bottom: 0; }
.inci-token {
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: 12.5px; color: var(--ink); letter-spacing: -.005em;
}
.inci-fn { color: var(--muted); margin-left: 6px; font-size: 11px; }
.inci-allergen { background: #fef3c7; border-radius: 3px; padding: 2px 4px; }
.inci-flag {
  color: var(--bad); font-size: 11px; margin-left: 6px;
  font-weight: 700;
}

.merchant-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.merchant-table th, .merchant-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  text-align: left; letter-spacing: -.005em;
}
.merchant-table th {
  font-size: 11px; font-weight: 700; letter-spacing: -.005em;
  color: var(--muted); text-transform: none;
}
.merchant-table td.num, .merchant-table th.num {
  text-align: right; font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.kv {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 5px 14px; font-size: 13px; margin: 0;
}
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 500; }

/* ---- Chart timeframe toggle (W-WEB-06 + W-WEB-18 visibility) ---- */
.chart-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.chart-window-toggle {
  display: inline-flex; gap: 0;
  background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 8px;
  overflow: hidden; padding: 3px;
  box-shadow: inset 0 1px 2px rgba(23, 21, 18, .04);
}
.chart-window-toggle .win-btn {
  background: transparent; border: 0;
  padding: 5px 12px; margin: 0 1px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700;
  color: var(--muted); border-radius: 5px;
  letter-spacing: -.005em;
  transition: all .1s;
}
.chart-window-toggle .win-btn:hover { color: var(--ink); background: var(--paper); }
.chart-window-toggle .win-btn.active {
  background: var(--ink); color: var(--paper);
  box-shadow: 0 1px 2px rgba(23, 21, 18, .15);
}
.chart-meta {
  text-align: right; font-size: 12px; font-weight: 500;
  color: var(--muted); margin-top: 6px;
  letter-spacing: -.005em;
}

/* ---- Deals page ---- W-WEB-18 visibility bump */
.deals-tabs {
  display: inline-flex; gap: 0;
  border: 1px solid var(--line-strong); border-radius: 8px;
  overflow: hidden; margin: 12px 0 8px; padding: 3px;
  background: var(--bg);
  box-shadow: inset 0 1px 2px rgba(23, 21, 18, .04);
}
.deals-tabs .deals-tab {
  padding: 6px 14px; margin: 0 1px; border-radius: 6px;
  text-decoration: none; color: var(--muted);
  font-size: 13px; font-weight: 700; letter-spacing: -.005em;
  transition: all .1s;
}
.deals-tabs .deals-tab:hover { color: var(--ink); background: var(--paper); }
.deals-tabs .deals-tab.active {
  background: var(--ink); color: var(--paper);
  box-shadow: 0 1px 2px rgba(23, 21, 18, .15);
}
.deals-caveat {
  font-size: 13px; margin: 10px 0 14px;
  color: var(--ink-soft); font-weight: 500;
}
.deals-grid { display: grid; gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .deals-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .deals-grid { grid-template-columns: 1fr; } }
.deals-grid .deal-card { position: relative; }
.deal-pct {
  position: absolute; top: 10px; right: 10px;
  background: var(--bad); color: white;
  padding: 3px 8px; border-radius: 4px;
  font-weight: 800; font-size: 12px; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.deal-baseline {
  color: var(--muted); font-size: 11px; font-weight: 500;
  margin-top: 2px;
}

/* ---- Search results (typeahead) ---- */
.search-results {
  max-width: 620px; margin: 0 auto 14px;
}
.search-results-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 4px 16px -4px rgba(23, 21, 18, .12);
}
.search-result-item {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: background .1s;
}
.search-result-item:last-child { border-bottom: 0; }
.search-result-item:hover { background: var(--bg); }
.sr-brand {
  font-size: 11px; font-weight: 700; letter-spacing: -.005em;
  color: var(--muted); margin-bottom: 2px;
}
.sr-name {
  font-size: 14px; font-weight: 500; color: var(--ink);
  letter-spacing: -.01em;
}
.sr-price {
  font-size: 14px; font-weight: 700; letter-spacing: -.015em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.search-empty {
  padding: 14px; color: var(--muted); font-size: 13px;
  text-align: center; font-weight: 500;
}

/* ---- Other page shells (watchlist / offline / cross-merchant) ---- */
.watchlist-page, .offline-notice, .cross-merchant, .hero-inci,
.hero-chart-empty, .identifiers {
  color: var(--ink-soft);
}
