/* A22.2 — Ingredient watchlist + shared .sku-inci-card foundation.
   A22.3 (Ingredient Listing Changes) will piggyback on this file so
   both cards share visual DNA. Do NOT touch base.css — G1 owns it. */

:root {
  --warn-terracotta: #C97B5A;
  --diff-add: #7A9E7E;      /* reserved for A22.3 */
  --diff-remove: #B87454;   /* reserved for A22.3 */
  --sku-card-bg: #F5F1EB;
  --sku-card-border: #8B7355;
}

.sku-inci-card {
  background: var(--sku-card-bg);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(139, 115, 85, 0.08);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Header chrome pill (goes between search and locale switcher) --- */
.chrome-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--sku-card-border);
  background: transparent;
  color: var(--sku-card-border);
  font-family: Pretendard, sans-serif;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}
.chrome-pill:hover { background: rgba(139, 115, 85, 0.06); }
.chrome-pill--active {
  background: rgba(139, 115, 85, 0.10);
}
.chrome-pill__icon { width: 14px; height: 14px; }
.chrome-pill__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--sku-card-border);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

/* --- Modal --- */
.watchlist-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 520px;
  width: 92vw;
  background: #FFFDF9;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
.watchlist-modal::backdrop { background: rgba(30, 20, 10, 0.35); }
.watchlist-modal__form { padding: 20px 20px 16px; }
.watchlist-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.watchlist-modal__header h2 {
  font-family: Pretendard, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #3a2f24;
  margin: 0;
}
.watchlist-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--sku-card-border);
  padding: 4px 8px;
}
.watchlist-modal__group { margin: 14px 0; }
.watchlist-modal__group-title {
  font-family: Pretendard, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #3a2f24;
  margin: 0 0 8px;
}
.watchlist-modal__accordion > summary {
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
}
.watchlist-modal__accordion > summary::-webkit-details-marker { display: none; }
.watchlist-modal__accordion > summary::before { content: "▸ "; color: var(--sku-card-border); }
.watchlist-modal__accordion[open] > summary::before { content: "▾ "; }
.watchlist-modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.watchlist-modal__footer {
  margin-top: 16px;
  color: #7a6b5c;
  font-size: 12px;
  border-top: 1px solid rgba(139, 115, 85, 0.15);
  padding-top: 10px;
}

/* --- Chips (shared) --- */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(139, 115, 85, 0.35);
  background: transparent;
  font-family: Pretendard, sans-serif;
  font-size: 13px;
  color: #3a2f24;
  cursor: pointer;
}
.chip--active {
  background: rgba(139, 115, 85, 0.15);
  border-color: var(--sku-card-border);
  color: #3a2f24;
  font-weight: 500;
}
.chip--match {
  cursor: default;
  background: rgba(201, 123, 90, 0.08);
  border-color: var(--warn-terracotta);
  color: #6a3a24;
}

/* --- SKU banner --- */
.watchlist-banner {
  border-left: 4px solid var(--warn-terracotta);
  background: linear-gradient(
    to right,
    rgba(201, 123, 90, 0.08),
    var(--sku-card-bg) 30%
  );
}
.watchlist-banner__header {
  margin: 0 0 10px;
  font-weight: 500;
  color: #6a3a24;
  font-size: 14px;
}
.watchlist-banner__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.watchlist-banner__expander {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--sku-card-border);
  font-family: Pretendard, sans-serif;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
}

/* --- First-visit hint (under SKU ingredient list) --- */
.watchlist-hint {
  display: inline-block;
  margin-top: 6px;
  color: var(--sku-card-border);
  font-size: 12px;
  text-decoration: underline dotted;
  cursor: pointer;
}

@media (max-width: 480px) {
  .watchlist-modal { width: 96vw; }
  .watchlist-modal__form { padding: 16px 14px; }
  .chip { min-height: 36px; padding: 8px 12px; }
}


/* --- A22.3: formulation timeline (positioning-safe) -----------------
   D013 review notes: NEITHER chip uses a green/red palette. Both share
   the neutral base .chip foreground; the ＋/− glyph carries direction.
   chip-remove gets strikethrough as a color-independent affordance.

   Post-review fixes:
   * override inherited `cursor: pointer` and `min-height: 32px` from the
     base .chip class — the formulation chips are non-interactive; a hand
     cursor implies false affordance and the forced 32px height wastes
     vertical space in the compact timeline row layout.
   * add ≤480px stacking so long INCI tokens don't crowd the middle
     column on mobile (iPhone 393px inner-width ≈ 369px).
-------------------------------------------------------------------- */
.formulation-timeline .formulation-hint {
  font-size: 12px;
  margin: -4px 0 12px;
}
.formulation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.formulation-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid rgba(139, 115, 85, 0.10);
}
.formulation-row:first-child { border-top: none; }
.formulation-date {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--sku-card-border);
}
.formulation-delta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.formulation-delta .chip {
  /* Override inherited watchlist-chip interactivity/sizing. */
  cursor: default;
  min-height: 0;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.5;
  color: inherit;
  background: rgba(139, 115, 85, 0.08);
  border: 1px solid rgba(139, 115, 85, 0.18);
}
.formulation-delta .chip-remove {
  text-decoration: line-through;
  text-decoration-color: rgba(139, 115, 85, 0.5);
  color: var(--muted, #6b6459);
}
.formulation-more { margin-top: 10px; font-size: 12px; }
.formulation-footnote {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted, #6b6459);
  border-top: 1px dashed rgba(139, 115, 85, 0.18);
  padding-top: 8px;
}

@media (max-width: 480px) {
  .formulation-row {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
  .formulation-date { font-size: 12px; }
}
