/* ===========================================================================
   watchlist.css — the /watchlist page.

   THEMING — light-only, same reasoning as price-insights.css: nopturnia.com
   has no dark mode anywhere in css/, so a dark block here would render one dark
   page in a light site. Every colour derives from the site's own --v2-* tokens;
   the semantic status colours match price-insights.css's --pi-* values exactly,
   so a "cheaper than usual" green means the same thing on a blog card and here.

   Namespaced `wl-` throughout — this page loads blog-v2.css, which owns generic
   names, and `body.blog-v2 a` is a high-specificity selector that captures any
   anchor. Interactive controls here are <button>s for that reason.
   ========================================================================= */

:root {
  --wl-good: #15803d;
  --wl-good-soft: #dcfce7;
  --wl-good-ink: #166534;
  --wl-warn: #b45309;
  --wl-warn-soft: #fef6e6;
  --wl-muted: #94a3b8;
  --wl-hairline: var(--v2-hairline, #e2e8f0);
  --wl-brand: var(--v2-brand, #1d4ed8);
  --wl-brand-soft: var(--v2-brand-soft, #3b82f6);
  --wl-card: var(--v2-card, #fff);
  --wl-ink: var(--v2-ink, #0f172a);
  --wl-ink-soft: var(--v2-ink-soft, #64748b);
  --wl-secondary: var(--v2-secondary, #f1f5f9);
}

.wl-main {
  max-width: 940px;
  margin: 0 auto;
  padding: 32px 16px 72px;
}

/* ------------------------------------------------------------------ header */

.wl-head {
  margin-bottom: 28px;
}

.wl-eyebrow {
  font-family: var(--v2-mono, monospace);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wl-brand);
  margin: 0 0 8px;
}

.wl-title {
  font-family: var(--v2-display, sans-serif);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--wl-ink);
  margin: 0 0 10px;
}

.wl-sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--wl-ink-soft);
  margin: 0;
  max-width: 62ch;
}

/* -------------------------------------------------------------- the cards */

.wl-list {
  display: grid;
  gap: 14px;
}

.wl-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--wl-card);
  border: 1px solid var(--wl-hairline);
  border-radius: var(--v2-r-xl, 14px);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wl-card:hover {
  border-color: var(--wl-brand-soft);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

/* A paused watch is still listed — it just stops claiming to be doing
   anything. Dimming beats hiding: hidden rows read as data loss. */
.wl-card.wl-paused {
  opacity: 0.62;
}

.wl-thumb {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wl-secondary);
  border-radius: var(--v2-r-lg, 10px);
  overflow: hidden;
}

.wl-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.wl-body {
  min-width: 0;
}

.wl-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--wl-ink);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wl-prices {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.wl-now {
  font-family: var(--v2-display, sans-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--wl-ink);
}

.wl-was {
  font-size: 13px;
  color: var(--wl-ink-soft);
}

/* The movement pill. Rendered ONLY when there is movement to report — never a
   "0%" and never an up-arrow dressed as good news. */
.wl-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.wl-delta.down {
  color: var(--wl-good-ink);
  background: var(--wl-good-soft);
}

.wl-delta.up {
  color: var(--wl-warn);
  background: var(--wl-warn-soft);
}

.wl-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--wl-ink-soft);
  margin-bottom: 12px;
}

.wl-spark {
  display: block;
  flex: 0 0 auto;
}

.wl-note {
  font-size: 12.5px;
  color: var(--wl-ink-soft);
}

.wl-note.wl-stale {
  color: var(--wl-warn);
}

/* -------------------------------------------------------------- controls */

.wl-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.wl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--v2-r-md, 8px);
  border: 1px solid var(--wl-hairline);
  background: var(--wl-card);
  color: var(--wl-ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wl-btn:hover {
  border-color: var(--wl-brand-soft);
  color: var(--wl-brand);
}

.wl-btn:focus-visible {
  outline: 2px solid var(--wl-brand-soft);
  outline-offset: 2px;
}

.wl-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

.wl-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.wl-btn-amz {
  border-color: var(--wl-brand);
  background: var(--wl-brand);
  color: #fff;
  text-decoration: none;
}

.wl-btn-amz:hover {
  background: var(--wl-brand-soft);
  border-color: var(--wl-brand-soft);
  color: #fff;
}

/* The threshold picker. A native <select> on purpose: it is a one-line control
   that has to work on every mobile keyboard and screen reader on the site. */
.wl-pct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--wl-ink-soft);
}

.wl-pct select {
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: var(--v2-r-md, 8px);
  border: 1px solid var(--wl-hairline);
  background: var(--wl-card);
  color: var(--wl-ink);
  cursor: pointer;
}

.wl-pct select:focus-visible {
  outline: 2px solid var(--wl-brand-soft);
  outline-offset: 1px;
}

.wl-target {
  font-family: var(--v2-mono, monospace);
  font-size: 12.5px;
  color: var(--wl-ink-soft);
}

/* ------------------------------------------------------------ empty state */

/* NEVER RENDER A ZERO — the empty watchlist is an invitation, not a count of
   nothing. Same rule as MIN_USES_TO_SHOW on /tools. */
.wl-empty {
  text-align: center;
  padding: 48px 20px 56px;
  border: 1px dashed var(--wl-hairline);
  border-radius: var(--v2-r-2xl, 18px);
  background: var(--wl-card);
}

.wl-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--wl-secondary);
  color: var(--wl-brand);
}

.wl-empty-icon svg {
  width: 28px;
  height: 28px;
}

.wl-empty h2 {
  font-family: var(--v2-display, sans-serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--wl-ink);
  margin: 0 0 8px;
}

.wl-empty p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--wl-ink-soft);
  margin: 0 auto 24px;
  max-width: 46ch;
}

.wl-empty-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  max-width: 640px;
  margin: 0 auto 26px;
  text-align: left;
}

.wl-tile {
  padding: 14px;
  border-radius: var(--v2-r-lg, 10px);
  background: var(--wl-secondary);
}

/* Scoped under .wl-empty on purpose: the `.wl-empty p` rule above is (0,1,1)
   and would otherwise win over a bare `.wl-tile-t` (0,1,0), pushing a 24px
   margin between a tile's heading and its own body text. */
.wl-empty .wl-tile-t {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--wl-ink);
  margin: 0 0 4px;
}

.wl-empty .wl-tile-d {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--wl-ink-soft);
  margin: 0;
}

.wl-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--v2-r-md, 8px);
  background: var(--wl-brand);
  color: #fff;
  text-decoration: none;
}

.wl-empty-cta:hover {
  background: var(--wl-brand-soft);
  color: #fff;
}

/* --------------------------------------------------------- load / failure */

.wl-status {
  text-align: center;
  padding: 40px 20px;
  color: var(--wl-ink-soft);
  font-size: 14.5px;
}

.wl-skeleton {
  height: 128px;
  border-radius: var(--v2-r-xl, 14px);
  background: linear-gradient(90deg, var(--wl-secondary) 25%, #e9eef5 50%, var(--wl-secondary) 75%);
  background-size: 200% 100%;
  animation: wl-shimmer 1.3s ease-in-out infinite;
}

@keyframes wl-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wl-skeleton {
    animation: none;
  }
}

.wl-footnote {
  margin-top: 26px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--wl-ink-soft);
  text-align: center;
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 560px) {
  .wl-card {
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 14px;
  }

  .wl-thumb {
    width: 72px;
    height: 72px;
  }

  .wl-now {
    font-size: 19px;
  }

  /* The row of controls wraps to full-width targets rather than shrinking
     below the 44px tap minimum. */
  .wl-actions .wl-btn {
    padding: 9px 12px;
  }
}
