/* Shortlist — clean, calm UI. Light + dark themes driven entirely by the tokens below. */

/* ---------- Tokens ---------- */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #eaedf1;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #14161a;
  --text-2: #475061;
  --text-3: #8a91a0;
  --accent: #3b5bdb;
  --accent-hover: #2f4ac0;
  --accent-tint: #edf1ff;
  --accent-ring: rgba(59, 91, 219, .22);
  --on-accent: #ffffff;
  --success: #138a4a;
  --success-tint: #e7f6ee;
  --danger: #d93a3f;
  --danger-tint: #fdecec;
  --warning: #c27803;
  --violet: #7c4ddb;
  --star: #f5a524;
  --img-bg: #ffffff;
  --overlay: rgba(16, 20, 28, .45);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px rgba(16, 24, 40, .04);
  --shadow-md: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -6px rgba(16, 24, 40, .10);
  --shadow-lg: 0 2px 6px rgba(16, 24, 40, .05), 0 24px 48px -12px rgba(16, 24, 40, .22);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono: 'Geist Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1014;
  --surface: #161a20;
  --surface-2: #1c2129;
  --surface-3: #242a33;
  --border: #262c35;
  --border-strong: #353c47;
  --text: #e8eaed;
  --text-2: #b1b7c2;
  --text-3: #7d8593;
  --accent: #5c7cfa;
  --accent-hover: #748ffc;
  --accent-tint: rgba(92, 124, 250, .14);
  --accent-ring: rgba(92, 124, 250, .32);
  --on-accent: #ffffff;
  --success: #3ccb7f;
  --success-tint: rgba(60, 203, 127, .13);
  --danger: #ff6b6f;
  --danger-tint: rgba(255, 107, 111, .13);
  --warning: #f5b544;
  --violet: #b49cff;
  --img-bg: #ffffff;
  --overlay: rgba(0, 0, 0, .6);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .2);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .4), 0 28px 56px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014;
    --surface: #161a20;
    --surface-2: #1c2129;
    --surface-3: #242a33;
    --border: #262c35;
    --border-strong: #353c47;
    --text: #e8eaed;
    --text-2: #b1b7c2;
    --text-3: #7d8593;
    --accent: #5c7cfa;
    --accent-hover: #748ffc;
    --accent-tint: rgba(92, 124, 250, .14);
    --accent-ring: rgba(92, 124, 250, .32);
    --on-accent: #ffffff;
    --success: #3ccb7f;
    --success-tint: rgba(60, 203, 127, .13);
    --danger: #ff6b6f;
    --danger-tint: rgba(255, 107, 111, .13);
    --warning: #f5b544;
  --violet: #b49cff;
    --img-bg: #ffffff;
    --overlay: rgba(0, 0, 0, .6);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .2);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, .4), 0 28px 56px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* Smooth colour change when toggling theme */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease !important;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14.5px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-ring); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { flex: none; display: block; }
.muted { color: var(--text-3); }
.mono { font-family: var(--font-mono); }

/* ---------- Layout ---------- */

.shell { max-width: 1200px; margin: 0 auto; padding: 0 32px 120px; }
.page { animation: pageIn .4s var(--ease-out) backwards; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px 32px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-hover)); color: var(--on-accent);
  box-shadow: 0 4px 12px -4px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .3s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Search */
.search { flex: 1; max-width: 460px; margin-left: 24px; position: relative; }
.search .icon.lead { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 44px 0 36px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.search .kbd-hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 5;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 64vh; overflow: auto;
  animation: popIn .18s var(--ease-out) backwards; transform-origin: top center;
}
.search-results a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; text-decoration: none; transition: background .12s; }
.search-results a:hover, .search-results a.active { background: var(--surface-2); }
.search-results img, .search-results .noimg { width: 40px; height: 40px; object-fit: contain; background: var(--img-bg); border-radius: 8px; border: 1px solid var(--border); flex: none; }
.search-results .t { font-size: 13.5px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results .m { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.search-empty { padding: 16px; color: var(--text-3); font-size: 13.5px; text-align: center; }

kbd {
  display: inline-block; min-width: 20px; padding: 1px 6px; text-align: center;
  font: 500 11px/18px var(--font-mono); color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px;
}

/* ---------- Typography ---------- */

.eyebrow { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: .01em; }
.display {
  font-family: var(--font-serif); font-weight: 400; letter-spacing: -.01em; line-height: 1.04; margin: 0;
}
.display em { font-style: italic; color: var(--accent); }
.section-title {
  --c: var(--accent);
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 48px 0 16px; padding: 9px 10px 9px 12px;
  border-radius: 14px; border: 1px solid color-mix(in srgb, var(--c) 18%, var(--border));
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 11%, var(--surface)) 0%, var(--surface) 62%);
  box-shadow: var(--shadow-xs);
}
.section-title h2 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.sh-icon {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent);
}
.sh-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.section-title .hint + .sh-actions { margin-left: 0; }
.sh-hide { color: var(--text-3); }
.sh-hide:hover { color: var(--text); }
.section-title .count {
  font-size: 12px; font-weight: 500; color: var(--text-2);
  background: var(--surface-3); padding: 2px 9px; border-radius: 999px;
}
.section-title .spacer { flex: 1; }
.section-title .hint { font-size: 12.5px; color: var(--text-3); margin-left: auto; }

/* ---------- Controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 4px 12px -4px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-tint); border-color: transparent; color: var(--danger); }
.btn.small { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 12px; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
  color: var(--text-3); cursor: pointer; transition: background .15s, color .15s, transform .12s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.danger:hover { background: var(--danger-tint); color: var(--danger); }

.theme-toggle { width: 36px; height: 36px; border-radius: 10px; color: var(--text-2); }
.theme-icon { position: relative; width: 17px; height: 17px; display: block; }
.theme-icon .icon { position: absolute; inset: 0; transition: transform .45s var(--ease-out), opacity .3s ease; }
.theme-icon.light .icon:last-child, .theme-icon.dark .icon:first-child { opacity: 0; transform: rotate(-90deg) scale(.4); }

.field { display: grid; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.form-grid { display: grid; gap: 16px; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a91a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input.mono { font-family: var(--font-mono); font-size: 13.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .12s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { font-size: 11.5px; opacity: .6; font-variant-numeric: tabular-nums; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px; margin-left: auto;
  background: var(--surface-3); border-radius: 10px;
}
.seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border: 0; background: transparent; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: background .2s var(--ease), color .2s, box-shadow .2s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 28px 0 20px; }

.spinner {
  width: 14px; height: 14px; display: inline-block; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.skeleton {
  display: block; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}

.notice {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; background: var(--danger-tint); color: var(--danger); animation: fadeUp .3s var(--ease-out) backwards;
}

/* ---------- Status, price, rating ---------- */

.status-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.shortlisted { background: var(--accent-tint); color: var(--accent); }
.status-pill.bought { background: var(--success-tint); color: var(--success); }
.status-pill.waiting { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.status-pill.returned { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.status-pill.dropped { background: var(--danger-tint); color: var(--danger); }
.prod-card .img .status-pill, .tt-img .status-pill { background: var(--surface); }
:is(.prod-card .img, .tt-img) .status-pill.shortlisted { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
:is(.prod-card .img, .tt-img) .status-pill.bought { background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
:is(.prod-card .img, .tt-img) .status-pill.waiting { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); }
:is(.prod-card .img, .tt-img) .status-pill.returned { background: color-mix(in srgb, var(--violet) 12%, var(--surface)); }
:is(.prod-card .img, .tt-img) .status-pill.dropped { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }

.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.price .now { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.price s { font-size: 13px; color: var(--text-3); }
.price .off { font-size: 12px; font-weight: 600; color: var(--success); background: var(--success-tint); padding: 1px 7px; border-radius: 6px; }
.price.big .now { font-size: 34px; letter-spacing: -.03em; }
.price.big s { font-size: 15px; }
.price.big .off { font-size: 13px; padding: 2px 8px; }
.price.none { font-size: 14px; color: var(--text-3); font-weight: 500; }
.price.big.none { font-size: 18px; }

.stars { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stars .stars-row { display: inline-flex; gap: 1px; color: var(--border-strong); }
.stars .stars-row .on { color: var(--star); }
.stars .n { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.noimg { display: grid; place-items: center; color: var(--text-3); width: 100%; height: 100%; opacity: .6; }

/* ---------- Home ---------- */

/* ---------- Home: hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr); align-items: center; gap: 24px;
  margin-top: 28px; padding: 60px 52px; border-radius: 32px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-bg .blob { position: absolute; width: 440px; height: 440px; border-radius: 50%; filter: blur(80px); opacity: .5; animation: blobDrift 20s ease-in-out infinite alternate; }
.hero-bg .b1 { background: var(--accent); left: -140px; top: -180px; }
.hero-bg .b2 { background: var(--violet); right: -120px; top: -60px; animation-duration: 24s; animation-delay: -6s; }
.hero-bg .b3 { background: #ec4899; left: 35%; bottom: -260px; opacity: .3; animation-duration: 28s; animation-delay: -12s; }
.hero-bg .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 0%, transparent 75%);
  opacity: .55;
}
:root[data-theme="dark"] .hero-bg .blob { opacity: .3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-bg .blob { opacity: .3; } }
@keyframes blobDrift { 50% { transform: translate(60px, 40px) scale(1.1); } 100% { transform: translate(-30px, 70px) scale(.95); } }

.hero-copy { min-width: 0; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 550;
  color: var(--text); background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(10px); box-shadow: var(--shadow-xs);
}
.hero-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-tint); animation: pulseDot 2.4s ease-in-out infinite; }
.hero-pill .sep { width: 1px; height: 12px; background: var(--border-strong); }
@keyframes pulseDot { 50% { box-shadow: 0 0 0 6px transparent; } }
.hero-title {
  margin: 20px 0 0; font-family: var(--font-sans); font-size: clamp(38px, 5vw, 64px); font-weight: 760;
  letter-spacing: -.048em; line-height: 1.02; color: var(--text); max-width: 15ch; text-wrap: balance;
}
.shine {
  background: linear-gradient(90deg, var(--accent), var(--violet), #ec4899, var(--violet), var(--accent)) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: 300% 0; } }
.hero-sub { color: var(--text-2); font-size: 16.5px; line-height: 1.55; max-width: 520px; margin: 18px 0 0; }

.add-card {
  max-width: 640px; margin: 30px 0 0; text-align: left; padding: 8px; border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(14px); box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow-sm);
  transition: box-shadow .25s, border-color .25s;
}
.add-card:focus-within { border-color: var(--accent); box-shadow: 0 24px 48px -20px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 0 4px var(--accent-ring); }
.paste-row { display: flex; gap: 8px; align-items: center; }
.paste-row .lead { margin-left: 10px; color: var(--accent); }
.paste-row input { flex: 1; height: 48px; border: 0; background: transparent; font-size: 15.5px; padding: 0 4px; min-width: 0; }
.paste-row input:focus { outline: none; }
.paste-row input::placeholder { color: var(--text-3); }
.paste-row .btn.primary { border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--violet)); border: 0; box-shadow: 0 8px 20px -8px var(--accent); }
.paste-hint { padding: 4px 12px 8px; font-size: 12.5px; color: var(--text-3); }
.paste-hint a { color: var(--accent); text-decoration: none; font-weight: 500; }
.paste-hint a:hover { text-decoration: underline; }
.add-card .notice { margin: 8px 6px 4px; }

.preview {
  display: grid; grid-template-columns: 132px 1fr; gap: 20px;
  margin: 8px 4px 4px; padding: 18px 12px 8px; border-top: 1px solid var(--border);
  animation: fadeUp .4s var(--ease-out) backwards;
}
.preview .thumb { width: 132px; height: 132px; background: var(--img-bg); border-radius: var(--radius); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; padding: 10px; }
.preview .thumb img { max-height: 100%; object-fit: contain; animation: fadeIn .4s ease backwards; }
.preview-fields { display: grid; gap: 12px; }
.preview-fields .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview .meta-line { font-size: 12.5px; color: var(--text-3); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.preview .actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding-top: 4px; }

/* Floating collage of your latest products */
.hero-art { position: relative; height: 360px; }
.ha-tile {
  position: absolute; display: grid; place-items: center; padding: 14px; border-radius: 24px; background: #fff;
  box-shadow: 0 24px 48px -20px rgba(15, 23, 42, .35), 0 0 0 1px rgba(15, 23, 42, .06);
  rotate: var(--r); animation: haFloat 6s ease-in-out infinite; animation-delay: calc(var(--d) * -1);
  transition: scale .35s var(--ease), box-shadow .35s;
}
.ha-tile img { width: 100%; height: 100%; object-fit: contain; }
.ha-tile:hover { scale: 1.06; z-index: 9; }
.ha-tile.t0 { --r: -6deg; width: 176px; height: 176px; left: 20%; top: 12%; z-index: 3; }
.ha-tile.t1 { --r: 8deg; width: 128px; height: 128px; left: 60%; top: 0; z-index: 2; }
.ha-tile.t2 { --r: 10deg; width: 116px; height: 116px; left: 0; top: 54%; z-index: 2; }
.ha-tile.t3 { --r: -8deg; width: 140px; height: 140px; left: 54%; top: 50%; z-index: 4; }
.ha-tile.t4 { --r: 5deg; width: 92px; height: 92px; left: 82%; top: 36%; z-index: 1; }
@keyframes haFloat { 50% { translate: 0 -12px; } }
.ha-chip {
  position: absolute; left: 2%; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px;
  border-radius: 16px; font-size: 12.5px; line-height: 1.3; color: var(--text); text-decoration: none;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(14px); box-shadow: var(--shadow-md); animation: haFloat 7s ease-in-out infinite -2s;
}
.ha-chip b { font-size: 15px; color: var(--success); margin-right: 6px; }
.ha-chip s { color: var(--text-3); }
.ha-chip-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--success); flex: none; }
.hero-art.empty { display: grid; place-items: center; }
.ha-orb {
  width: 160px; height: 160px; border-radius: 40px; display: grid; place-items: center; color: #fff; rotate: -8deg;
  background: linear-gradient(135deg, var(--accent), var(--violet)); box-shadow: 0 30px 60px -20px var(--accent); animation: haFloat 6s ease-in-out infinite;
}

/* Stat tiles */
.stat-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.stat-tile {
  position: relative; isolation: isolate; overflow: hidden; display: grid; align-content: start; padding: 18px 18px 16px; border-radius: 22px;
  color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s, border-color .3s;
  animation: fadeUp .5s var(--ease-out) backwards; animation-delay: calc(80ms + var(--i, 0) * 60ms);
}
.stat-tile::before {
  content: ''; position: absolute; z-index: -1; width: 160px; height: 160px; right: -60px; top: -70px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 22%, transparent); filter: blur(30px); transition: transform .5s var(--ease);
}
.stat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--c) 35%, var(--border)); }
.stat-tile:hover::before { transform: scale(1.4); }
.st-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.st-value { font-size: 36px; font-weight: 760; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.st-label { margin-top: 8px; font-size: 13.5px; font-weight: 600; }
.st-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Category cards: a coloured stage with product photos, then name + stats ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.cat-card {
  --h: 220;
  --tint: hsl(var(--h) 90% 95%);
  --tint2: hsl(calc(var(--h) + 45) 85% 90%);
  --ink: hsl(var(--h) 62% 40%);
  --glow: hsl(var(--h) 90% 72% / .5);
  position: relative; isolation: isolate; display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  padding: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s;
  animation: fadeUp .5s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 50ms);
}
:root[data-theme="dark"] .cat-card {
  --tint: hsl(var(--h) 38% 19%); --tint2: hsl(calc(var(--h) + 45) 42% 14%); --ink: hsl(var(--h) 85% 74%); --glow: hsl(var(--h) 80% 55% / .35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cat-card {
    --tint: hsl(var(--h) 38% 19%); --tint2: hsl(calc(var(--h) + 45) 42% 14%); --ink: hsl(var(--h) 85% 74%); --glow: hsl(var(--h) 80% 55% / .35);
  }
}
/* A gradient ring that fades in on hover */
.cat-card::after {
  content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, var(--ink), transparent 38%, transparent 62%, hsl(calc(var(--h) + 45) 70% 58%));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
.cat-card:hover { transform: translateY(-5px); border-color: transparent; box-shadow: 0 22px 44px -18px hsl(var(--h) 60% 35% / .45), var(--shadow-sm); }
.cat-card:hover::after { opacity: 1; }

.cc-stage {
  position: relative; height: 158px; overflow: hidden; border-radius: 16px;
  background: radial-gradient(110% 90% at 15% 0%, var(--tint) 0%, transparent 65%), linear-gradient(135deg, var(--tint), var(--tint2));
  box-shadow: inset 0 0 0 1px hsl(var(--h) 50% 50% / .08);
  transition: transform .5s var(--ease);
}
.cat-card:hover .cc-stage { transform: scale(1.015); }
.cc-stage::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, hsl(var(--h) 60% 45% / .2) 1px, transparent 1.5px) 0 0 / 14px 14px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%); mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.cc-glow {
  position: absolute; width: 150px; height: 150px; right: -40px; bottom: -70px; border-radius: 50%;
  background: var(--glow); filter: blur(32px); transition: transform .6s var(--ease);
}
.cat-card:hover .cc-glow { transform: translate(-30px, -14px) scale(1.25); }

/* Product photos fanned like cards in a hand; they spread on hover */
.cc-stack { position: absolute; left: 50%; top: 52%; translate: -50% -50%; display: flex; align-items: center; }
.cc-shot {
  position: relative; width: 84px; height: 84px; margin: 0 -14px; padding: 8px; border-radius: 18px; display: grid; place-items: center;
  background: #fff; box-shadow: 0 12px 24px -12px hsl(var(--h) 50% 20% / .55), 0 0 0 1px rgba(0, 0, 0, .05);
  transition: transform .5s var(--ease);
}
.cc-shot { overflow: hidden; }
.cc-shot img { width: 100%; height: 100%; object-fit: contain; }
.cc-stack.n1 .cc-shot { width: 108px; height: 108px; transform: rotate(-4deg); }
.cc-stack.n2 .cc-shot:nth-child(1) { transform: rotate(-8deg) translateY(4px); }
.cc-stack.n2 .cc-shot:nth-child(2) { transform: rotate(7deg); z-index: 1; }
.cc-stack.n3 .cc-shot:nth-child(1) { transform: rotate(-11deg) translateY(8px) scale(.9); }
.cc-stack.n3 .cc-shot:nth-child(2) { width: 100px; height: 100px; z-index: 2; }
.cc-stack.n3 .cc-shot:nth-child(3) { transform: rotate(11deg) translateY(8px) scale(.9); z-index: 1; }
.cat-card:hover .cc-stack.n1 .cc-shot { transform: rotate(0) scale(1.06); }
.cat-card:hover .cc-stack.n2 .cc-shot:nth-child(1) { transform: rotate(-12deg) translate(-12px, 2px); }
.cat-card:hover .cc-stack.n2 .cc-shot:nth-child(2) { transform: rotate(11deg) translateX(12px); }
.cat-card:hover .cc-stack.n3 .cc-shot:nth-child(1) { transform: rotate(-16deg) translate(-20px, 6px) scale(.9); }
.cat-card:hover .cc-stack.n3 .cc-shot:nth-child(2) { transform: translateY(-6px) scale(1.05); }
.cat-card:hover .cc-stack.n3 .cc-shot:nth-child(3) { transform: rotate(16deg) translate(20px, 6px) scale(.9); }

/* Empty category: a floating emoji and an invitation */
.cc-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; }
.cc-big { font-size: 56px; line-height: 1; filter: drop-shadow(0 12px 12px hsl(var(--h) 50% 25% / .3)); animation: ccFloat 4.5s ease-in-out infinite; }
@keyframes ccFloat { 50% { transform: translateY(-7px) rotate(-5deg); } }
.cc-hint {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; color: var(--ink); background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(4px); opacity: .85; transition: opacity .2s, transform .3s var(--ease);
}
.cat-card:hover .cc-hint { opacity: 1; transform: translateY(-2px); }
.cc-bought {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 650; color: var(--success); background: var(--surface); box-shadow: var(--shadow-xs);
}

.cc-body { position: relative; flex: 1; display: grid; align-content: start; gap: 5px; padding: 13px 9px 6px; }
.cc-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cat-card .name { flex: 1; min-width: 0; font-size: 17px; font-weight: 650; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-go {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--tint);
  opacity: 0; transform: translateX(-8px); transition: opacity .25s, transform .35s var(--ease);
}
.cat-card:hover .cc-go { opacity: 1; transform: none; }
.cc-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.cc-count { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-price { flex: none; font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.cat-card .sub-chips { margin-top: 6px; }

/* "New category / subcategory" card */
.cat-card.new {
  min-height: 236px; padding: 0; align-items: center; justify-content: center; gap: 12px; cursor: pointer;
  background: transparent; border: 1.5px dashed var(--border-strong); box-shadow: none; color: var(--text-3); font-weight: 600; font-size: 14px;
}
.cat-card.new::after { display: none; }
.cat-card.new:hover {
  color: var(--accent); border-color: var(--accent); transform: translateY(-3px); box-shadow: none;
  background: radial-gradient(80% 80% at 50% 40%, var(--accent-tint), transparent 75%);
}
.cat-card.new .plus {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2);
  border: 1px solid var(--border); transition: transform .4s var(--ease), background .25s, color .25s, box-shadow .25s;
}
.cat-card.new:hover .plus { transform: rotate(90deg) scale(1.06); background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 10px 22px -10px var(--accent); }
.cat-emoji {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  font-size: 22px; line-height: 1; background: var(--surface-2); border: 1px solid var(--border);
  transition: transform .35s var(--ease);
}
.cat-emoji.lg { width: 56px; height: 56px; font-size: 28px; border-radius: 14px; }
.cat-emoji.xl { width: 72px; height: 72px; font-size: 36px; border-radius: 18px; cursor: pointer; box-shadow: var(--shadow-sm); background: var(--surface); }
.cat-emoji.xl:hover { transform: scale(1.05) rotate(-4deg); }

/* Subcategories */
.sub-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.sub-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; font-weight: 500; color: var(--text-2);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sub-chip.more { color: var(--text-3); }
.sub-grid { margin-bottom: 4px; }
.in-sub {
  justify-self: start; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px;
  background: var(--accent-tint); color: var(--accent); font-size: 11px; font-weight: 600;
}
.seg.left { margin-left: 0; margin-right: 6px; }
.soft-note {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 28px; padding: 14px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); font-size: 13.5px;
}
.soft-note .icon { color: var(--accent); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 550; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Moving: drag and drop + picker */
.cat-card[draggable="true"], .prod-card[draggable="true"] { cursor: grab; }
.cat-card[draggable="true"]:active, .prod-card[draggable="true"]:active { cursor: grabbing; }
.cat-card.drop-over {
  border-color: var(--accent); background: var(--accent-tint); transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-ring);
}
.drop-hint {
  position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 6px;
  z-index: 4; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 12.5px; font-weight: 600;
  animation: popIn .15s var(--ease-out) backwards; pointer-events: none;
}
body.is-dragging .crumbs a { outline: 1.5px dashed var(--border-strong); outline-offset: 3px; border-radius: 6px; }
.crumbs a.drop-over { outline: 2px solid var(--accent); background: var(--accent-tint); color: var(--accent); }

/* ---------- Sort + reorder ---------- */
.toolbar-gap { flex: 1; }
.toolbar .seg { margin-left: 0; }
.sort-select {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); font-size: 13px;
}
.sort-select select { border: 0; background: transparent; font-size: 13px; font-weight: 500; color: var(--text); padding-right: 2px; cursor: pointer; }
.sort-select select:focus { outline: none; }
.sort-select:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.prod-grid { position: relative; }
.prod-grid.reordering .prod-card { animation: none; }
.prod-card.reorderable:hover { transform: none; }
.prod-card.reorderable .img img { transform: none !important; }
.prod-card.lifted {
  z-index: 20; cursor: grabbing; box-shadow: var(--shadow-lg), 0 0 0 2px var(--accent); transition: box-shadow .15s;
  will-change: transform;
}
.grip {
  position: absolute; top: 8px; right: 8px; z-index: 3; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.prod-grid.reordering .prod-card, .prod-grid.reordering .prod-card img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
.grip:active, .prod-card.lifted .grip { cursor: grabbing; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nudge-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.nudge-bar .pos { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nudge-bar .icon-btn:disabled { opacity: .3; cursor: default; }
.reorder-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 24px 0 18px; padding: 12px 14px;
  border-radius: var(--radius); background: var(--accent-tint); color: var(--text-2); font-size: 13.5px;
  animation: fadeUp .3s var(--ease-out) backwards;
}
.reorder-banner > .icon { color: var(--accent); }
.reorder-banner b { color: var(--text); }
.reorder-banner .btn { margin-left: auto; }

/* ---------- Tier list ---------- */
.tier-wrap { animation: fadeUp .4s var(--ease-out) backwards; }
.tier-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; flex-wrap: wrap; }
.saved-flash { display: inline-flex; align-items: center; gap: 4px; color: var(--success); font-weight: 600; animation: savedFlash 1.8s ease forwards; }
@keyframes savedFlash { 0% { opacity: 0; transform: translateY(3px); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }

.tier-board { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.tier-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; min-height: 170px; border-top: 1px solid var(--border); transition: background .15s; }
.tier-row:first-child { border-top: 0; }
.tier-row.over { background: var(--accent-tint); }
.tier-label {
  display: grid; place-items: center; padding: 8px; border: 0; cursor: pointer; text-align: center;
  font: 700 24px/1.1 var(--font-sans); letter-spacing: -.01em; word-break: break-word; transition: filter .15s;
}
.tier-label:hover { filter: brightness(1.06) saturate(1.1); }
.tier-label span { max-width: 100%; overflow-wrap: anywhere; }
.tier-label.demo { width: 72px; height: 72px; border-radius: 12px; font-size: 20px; flex: none; }
.tier-items { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; padding: 8px; min-height: 170px; position: relative; }
.tier-tools { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 6px; border-left: 1px solid var(--border); opacity: .55; transition: opacity .15s; }
.tier-row:hover .tier-tools { opacity: 1; }
.tier-tools .icon-btn { width: 28px; height: 28px; }
.tier-tools .icon-btn:disabled { opacity: .3; cursor: default; }

.tier-tile {
  position: relative; width: 132px; flex: none; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
  text-decoration: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); cursor: grab;
  transition: transform .18s var(--ease), box-shadow .18s, opacity .15s, border-color .18s;
  animation: popIn .3s var(--ease-out) backwards;
}
.tier-tile:hover { border-color: var(--border-strong); }
.tier-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tier-tile:active { cursor: grabbing; }
.tier-tile.dragging { opacity: .3; transform: scale(.95); }
/* Phones: no text selection, link preview or callout on press-and-hold */
.tier-tile { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }
/* The floating copy that follows your finger/mouse */
.tier-ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; margin: 0; pointer-events: none; animation: none;
  rotate: 3deg; scale: 1.06; box-shadow: var(--shadow-lg), 0 0 0 2px var(--accent); transition: none;
}
html.tier-dragging, html.tier-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.tt-img .status-pill { position: absolute; top: 5px; left: 5px; z-index: 1; height: 18px; padding: 0 6px; font-size: 10px; gap: 4px; box-shadow: var(--shadow-xs); }
.tt-img .status-pill i { width: 5px; height: 5px; }
.tier-tile.dropped .tt-img img { filter: grayscale(1); opacity: .5; }
.tier-tile.dropped .tt-title { opacity: .6; text-decoration: line-through; }
.tier-tile.ins-before::before, .ins-end {
  content: ''; position: absolute; top: 4px; bottom: 4px; left: -6px; width: 4px; border-radius: 4px; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring); z-index: 3;
}
.tier-tile.ins-before { overflow: visible; }
.ins-end { position: relative; left: 0; width: 4px; height: 152px; top: 0; flex: none; animation: fadeIn .1s ease; }
.tt-img {
  position: relative; height: 92px; flex: none; display: flex; align-items: center; justify-content: center; padding: 8px; overflow: hidden;
  background: var(--img-bg); border-bottom: 1px solid var(--border);
}
.tt-img img { max-width: 100%; max-height: 76px; width: auto; height: auto; object-fit: contain; pointer-events: none; }
.tt-img .noimg { height: 76px; }
.tt-cap { display: block; padding: 7px 8px 8px; color: var(--text); }
.tt-title {
  font-size: 11.5px; font-weight: 600; line-height: 1.3; min-height: 3.9em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
/* Price badge pinned to the photo corner: same spot on every tile, whatever the name length. */
.tt-price {
  position: absolute; left: 6px; bottom: 6px; height: 20px; padding: 0 7px; border-radius: 6px;
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums;
  background: rgba(17, 20, 26, .82); color: #fff; backdrop-filter: blur(4px); pointer-events: none;
}

.tier-pool {
  margin-top: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.tier-pool.over { border-color: var(--accent); background: var(--accent-tint); }
.pool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px 0; font-size: 13px; }
.pool-items { min-height: 120px; }
.tier-wrap.is-dragging .tier-items { outline: 1px dashed transparent; }

.tier-edit-preview { display: flex; align-items: flex-end; gap: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .12s var(--ease);
}
.swatch:hover { transform: scale(1.1); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.swatch.custom { position: relative; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Drop panel shown while dragging */
.drag-dock {
  position: fixed; top: 76px; right: 20px; bottom: 20px; z-index: 60; width: 270px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: dockIn .25s var(--ease-out) backwards;
}
@keyframes dockIn { from { opacity: 0; transform: translateX(16px); } }
.dd-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; font-size: 13px; font-weight: 600; color: var(--accent); border-bottom: 1px solid var(--border); }
.dd-list { flex: 1; overflow: auto; padding: 6px; display: grid; gap: 2px; align-content: start; }
.dd-row {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 9px;
  font-size: 13.5px; border: 1.5px dashed transparent; transition: background .12s, border-color .12s, transform .12s;
}
.dd-row:not(.invalid) { border-color: var(--border); }
.dd-row.over { background: var(--accent-tint); border-color: var(--accent); border-style: solid; color: var(--accent); font-weight: 600; transform: scale(1.02); }
.dd-row.invalid { opacity: .45; }
.dd-row .mr-icon { width: 20px; text-align: center; flex: none; }
.dd-row .mr-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-row .mr-tag { font-size: 11px; color: var(--text-3); background: var(--surface-3); padding: 2px 7px; border-radius: 5px; }

/* Product card: hover Move button, selection */
.card-act {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 550;
  box-shadow: var(--shadow-sm); cursor: pointer; opacity: 0; transform: translateY(-4px);
  transition: opacity .15s, transform .2s var(--ease), background .12s, color .12s;
}
.prod-card:hover .card-act, .card-act:focus-visible { opacity: 1; transform: none; }
.card-act:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.prod-card.selecting { cursor: pointer; }
.prod-card.selecting:hover { transform: none; }
.prod-card.selected { border-color: var(--accent); box-shadow: var(--shadow-sm), 0 0 0 3px var(--accent-ring); }
.pick {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  border: 2px solid var(--border-strong); background: var(--surface); color: var(--on-accent); transition: background .15s, border-color .15s;
}
.pick.on { background: var(--accent); border-color: var(--accent); }
.bulk-bar {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0; /* not transform: slideUp animates that */ z-index: 45; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: slideUp .3s var(--ease-out) backwards;
}
.bulk-bar .count { font-size: 13.5px; color: var(--text-2); margin-right: 6px; }
.bulk-bar .count b { color: var(--text); }

.move-list { display: grid; gap: 2px; max-height: 52vh; overflow: auto; padding: 4px; border: 1px solid var(--border); border-radius: 12px; }
.move-row {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 13.5px; text-align: left; cursor: pointer; transition: background .12s;
}
.move-row:hover:not(:disabled) { background: var(--surface-2); }
.move-row.sel { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.move-row:disabled { opacity: .45; cursor: not-allowed; }
.move-row .mr-icon { width: 20px; text-align: center; flex: none; }
.move-row .mr-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move-row .mr-tag { font-size: 11px; font-weight: 500; color: var(--text-3); background: var(--surface-3); padding: 2px 7px; border-radius: 5px; }
.move-row .mr-check { color: var(--accent); }

/* Recently updated: a swipeable rail */
.rail-wrap { position: relative; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 214px; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; padding: 6px 4px 18px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}
.rail::-webkit-scrollbar { display: none; }
.rail-card {
  scroll-snap-align: start; display: grid; gap: 10px; align-content: start; padding: 7px; border-radius: 22px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s, border-color .3s;
  animation: fadeUp .5s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 45ms);
}
.rail-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.rc-img { position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 18px; border-radius: 16px; overflow: hidden; background: var(--img-bg); border: 1px solid var(--border); }
.rc-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s var(--ease); }
.rail-card:hover .rc-img img { transform: scale(1.07); }
.rc-img .status-pill { position: absolute; top: 8px; left: 8px; height: 20px; padding: 0 7px; font-size: 10.5px; }
.rc-title { padding: 0 5px; font-size: 13.5px; font-weight: 550; line-height: 1.35; min-height: 2.7em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 5px 5px; font-size: 12px; }
.rc-foot b { font-size: 15.5px; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rc-foot .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-btn {
  position: absolute; top: 38%; z-index: 2; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity .2s, transform .2s var(--ease);
}
.rail-btn.prev { left: -16px; }
.rail-btn.next { right: -16px; }
.rail-wrap:hover .rail-btn { opacity: 1; }
.rail-btn:hover { transform: scale(1.08); }
@media (hover: none) { .rail-btn { display: none; } }

/* Bookmarklet card */
.footer-tip {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 64px; padding: 20px 22px; border-radius: 24px;
  font-size: 13.5px; color: var(--text-2);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 45%, color-mix(in srgb, var(--violet) 9%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
}
.ft-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, var(--accent), var(--violet)); box-shadow: 0 10px 22px -10px var(--accent); }
.ft-text { display: grid; gap: 2px; flex: 1 1 260px; }
.ft-text b { font-size: 15px; font-weight: 650; color: var(--text); }
.bookmarklet {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px; margin-left: auto; border-radius: 999px;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--violet)); text-decoration: none; font-weight: 600; font-size: 13.5px;
  box-shadow: 0 10px 24px -10px var(--accent); cursor: grab; transition: transform .2s var(--ease);
}
.bookmarklet:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .hero-bg .blob, .shine, .ha-tile, .ha-chip, .ha-orb, .hero-pill .dot { animation: none; }
}

/* ---------- Category page ---------- */

.crumbs { display: flex; gap: 6px; align-items: center; margin: 28px 0 0; font-size: 13px; color: var(--text-3); }
.crumbs a { text-decoration: none; transition: color .15s; }
.crumbs a:hover { color: var(--text); }
.crumbs .icon { opacity: .6; }
/* Category header: a card with the icon tile, label, title, hd-stat chips and actions.
   The glow, dot pattern and top line live on .hd-bg (clipped to the card), so the View box
   and ⋯ menu can still open past the card's edge. */
.cat-head {
  position: relative; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 28px;
  margin-top: 18px; padding: 28px 28px 26px;
  border-radius: 22px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
  animation: fadeUp .4s var(--ease-out) backwards;
}
.hd-bg {
  position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; pointer-events: none;
  background: radial-gradient(55% 130% at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
.hd-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 32%, transparent) 1px, transparent 1.5px) 0 0 / 16px 16px;
  -webkit-mask-image: linear-gradient(100deg, transparent 45%, #000 100%);
  mask-image: linear-gradient(100deg, transparent 45%, #000 100%);
  opacity: .7;
}
.hd-bg::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--violet)); }
.hd-main { display: flex; align-items: center; gap: 20px; min-width: 0; flex: 1 1 380px; }
.hd-icon {
  flex: none; width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; cursor: pointer;
  font-size: 36px; line-height: 1; padding: 0;
  background: linear-gradient(150deg, var(--surface) 10%, color-mix(in srgb, var(--accent) 14%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .25s var(--ease), box-shadow .2s;
}
.hd-icon:hover { transform: rotate(-5deg) scale(1.05); box-shadow: var(--shadow-md); }
.hd-text { min-width: 0; display: grid; gap: 4px; }
.hd-eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.hd-eyebrow .sep { font-weight: 500; text-transform: none; letter-spacing: 0; }
.hd-eyebrow a { color: var(--accent); text-decoration: none; text-transform: none; letter-spacing: 0; font-weight: 600; }
.hd-eyebrow a:hover { text-decoration: underline; }
.hd-title {
  margin: 0; font-family: var(--font-sans); font-size: clamp(26px, 3.1vw, 36px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.12; color: var(--text); overflow-wrap: anywhere;
}
.hd-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hd-stat {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hd-stat b { color: var(--text); font-weight: 650; }
.hd-stat .icon { color: var(--text-3); }
.hd-stat i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hd-stat.accent { color: var(--accent); background: var(--accent-tint); border-color: transparent; font-weight: 600; }
.hd-stat.success { color: var(--success); background: var(--success-tint); border-color: transparent; font-weight: 600; }
.hd-stat.success .icon { color: inherit; }
.hd-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hd-actions .btn { height: 40px; }
.hd-actions .btn.square { width: 40px; }

.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.prod-card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s, opacity .3s;
  animation: fadeUp .5s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 40ms);
}
.prod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
/* Rejected: greyed out, but the red label stays readable */
.prod-card.dropped .img img { filter: grayscale(1); opacity: .5; transition: filter .2s, opacity .2s; }
.prod-card.dropped .body { opacity: .6; transition: opacity .2s; }
.prod-card.dropped .title { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); }
.prod-card.dropped:hover .img img { filter: none; opacity: 1; }
.prod-card.dropped:hover .body { opacity: 1; }
.prod-card .img { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 22px; background: var(--img-bg); border-bottom: 1px solid var(--border); overflow: hidden; }
.prod-card .img img { max-height: 100%; object-fit: contain; transition: transform .5s var(--ease); }
.prod-card:hover .img img { transform: scale(1.05); }
.prod-card .img .status-pill { position: absolute; top: 12px; left: 12px; box-shadow: var(--shadow-xs); }
.prod-card .body { padding: 14px 16px 16px; display: grid; gap: 8px; flex: 1; align-content: start; }
.prod-card .store { font-size: 12px; font-weight: 500; color: var(--text-3); }
.prod-card .title { font-weight: 550; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-card .foot { display: flex; gap: 12px; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.prod-card .foot span { display: inline-flex; align-items: center; gap: 4px; }
.prod-card .foot .pro { color: var(--success); }
.prod-card .foot .con { color: var(--danger); }

.compare-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); animation: fadeUp .4s var(--ease-out) backwards; }
.compare { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.compare th { font-size: 12px; font-weight: 500; color: var(--text-3); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.compare td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; transition: background .12s; }
.compare tr:last-child td { border-bottom: 0; }
.compare tbody tr { cursor: pointer; }
.compare tbody tr:hover td { background: var(--surface-2); }
.compare .pimg { width: 44px; height: 44px; display: grid; place-items: center; background: var(--img-bg); border-radius: 8px; border: 1px solid var(--border); padding: 3px; overflow: hidden; }
.compare .pimg img { max-height: 100%; object-fit: contain; }
.compare .ptitle { max-width: 360px; font-weight: 550; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.compare .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare .best { color: var(--success); font-weight: 600; background: var(--success-tint); padding: 2px 8px; border-radius: 6px; }

.empty-state {
  text-align: center; padding: 64px 24px; margin-top: 24px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-3);
  animation: fadeUp .4s var(--ease-out) backwards;
}
.empty-state .art { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); box-shadow: var(--shadow-sm); }
.empty-state .big { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 4px; }

/* ---------- Category research ---------- */

.cat-research { animation: fadeUp .4s var(--ease-out) backwards; }
.cr-start {
  display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; padding: 18px 20px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface);
}
.cr-start-text { flex: 1 1 280px; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); }
.cr-start-text b { color: var(--text); font-size: 14.5px; font-weight: 600; }
.cr-start-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Notes, Look for, Avoid, Brands to avoid: as many columns as fit; hidden ones leave no gap. */
.cr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.cr-look { display: grid; }
.cr-notes {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 12px 14px 14px;
}
.cr-notes h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14.5px; font-weight: 600; }
.cr-notes h3 > .icon { color: var(--text-3); }
.cr-notes h3 .sh-hide { margin-left: auto; width: 28px; height: 28px; }
.cr-notes .notes { min-height: 132px; }
.cr-sources { margin-top: 22px; }
/* A lighter band for a sub-section inside a section. */
.sub-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 7px 8px 7px 12px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.sub-head > .icon { color: var(--violet); }
.sub-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.sub-head .count { font-size: 12px; color: var(--text-3); }
.sub-head .sh-hide { margin-left: auto; width: 28px; height: 28px; }

/* Brands to avoid */
.brands-col h3 .badge { background: var(--danger-tint); color: var(--danger); }
.brand-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px 8px 14px; }
.brand-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; color: var(--danger); background: var(--danger-tint);
}
.brand-reason { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); cursor: text; overflow-wrap: anywhere; }
.brand-reason.empty { color: var(--text-3); font-style: italic; }
.brand-row .icon-btn { opacity: .5; }
.brand-row:hover .icon-btn { opacity: 1; }
@media (hover: none) { .brand-row .icon-btn { opacity: 1; } }
.brand-reason-input { flex: 1; min-width: 120px; border: 0; border-bottom: 1px solid var(--accent); background: transparent; font-size: 13px; padding: 2px 0; color: var(--text); }
.brand-reason-input:focus { outline: none; }
.brand-row.inherited { opacity: .85; }
.brand-row.inherited .brand-reason { cursor: default; }
.brand-row .brand-reason.full { flex-basis: 100%; }
.brand-from { font-size: 11.5px; color: var(--text-3); text-decoration: none; white-space: nowrap; }
.brand-from:hover { color: var(--accent); text-decoration: underline; }
.brand-adder { align-items: flex-start; }
.brand-adder > .icon { margin-top: 3px; }
.ba-fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ba-fields input + input { font-size: 12.5px; }

/* Products from a brand to avoid */
.avoid-flag {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; justify-self: start; width: fit-content; height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 11px; font-weight: 650; color: var(--danger); background: var(--danger-tint);
}
.prod-card.avoided { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.prod-card.avoided .img { box-shadow: inset 0 -3px 0 var(--danger); }
.avoid-banner {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.45; color: var(--danger); background: var(--danger-tint);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}
.avoid-banner .icon { flex: none; margin-top: 1px; }
.avoid-banner a { color: inherit; opacity: .8; margin-left: 6px; font-size: 12.5px; }
.tier-tile.avoided { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.tt-avoid {
  position: absolute; top: 5px; right: 5px; z-index: 1; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  color: #fff; background: var(--danger); box-shadow: var(--shadow-xs);
}

/* View box: which sections show */
.view-wrap { position: relative; }
.btn.has-hidden { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--accent); }
.vw-n { margin-left: 2px; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); }
.view-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 290px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: popIn .16s var(--ease-out) backwards; transform-origin: top right; text-align: left;
}
.vp-presets { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 2px 10px; border-bottom: 1px solid var(--border); }
.vp-presets .chip { display: inline-flex; align-items: center; gap: 5px; }
.vp-group { padding-top: 8px; }
.vp-title { padding: 2px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.vp-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; transition: background .12s, opacity .15s; }
.vp-row:hover { background: var(--surface-2); }
.vp-row.off .vp-label, .vp-row.off .vp-icon { opacity: .5; }
.vp-icon { color: var(--text-3); display: grid; }
.vp-label { flex: 1; font-size: 13.5px; color: var(--text); }

/* ---------- Product page ---------- */

.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 550; background: var(--surface-3); color: var(--text-2); }
.tag.accent { background: var(--accent-tint); color: var(--accent); }

/* Header card */
.p-hero {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 36px; margin-top: 18px; padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-md);
  animation: fadeUp .45s var(--ease-out) backwards;
}
.p-hero-img {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 28px; overflow: hidden;
  background: var(--img-bg); border: 1px solid var(--border); border-radius: 16px;
}
.p-hero-img img { max-height: 100%; object-fit: contain; animation: zoomIn .6s var(--ease-out) backwards; transition: transform .5s var(--ease); }
.p-hero-img:hover img { transform: scale(1.04); }
.p-hero-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding-top: 4px; }
.p-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.p-chips .when { font-size: 12.5px; color: var(--text-3); margin-left: 2px; }
.p-title {
  margin: 0; font-size: clamp(20px, 2vw, 25px); font-weight: 600; line-height: 1.32; letter-spacing: -.02em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.p-rating { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-top: -6px; }
.p-price { display: flex; align-items: flex-end; gap: 10px 20px; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.p-price-meta { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; padding-bottom: 4px; min-width: 0; }
.p-price-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.field-inline { display: grid; gap: 8px; }
.p-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.p-actions .btn { height: 40px; padding: 0 16px; }
.btn.square { width: 40px; padding: 0; }


.status-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 12px; flex-wrap: wrap; }
.status-seg button {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
  border: 0; background: transparent; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: background .2s var(--ease), color .2s, box-shadow .2s;
}
.status-seg button i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: background .2s, box-shadow .2s; }
.status-seg button:hover { color: var(--text); }
.status-seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.status-seg button.on.considering i { background: var(--text-2); }
.status-seg button.on.shortlisted i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.status-seg button.on.bought i { background: var(--success); box-shadow: 0 0 0 3px var(--success-tint); }
.status-seg button.on.waiting i { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 18%, transparent); }
.status-seg button.on.returned i { background: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 18%, transparent); }
.status-seg button.on.dropped i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.bulk-status.off { opacity: .5; }

/* More-actions menu */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: popIn .16s var(--ease-out) backwards; transform-origin: top right;
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 13.5px; color: var(--text); text-align: left;
  transition: background .12s;
}
.menu button:hover { background: var(--surface-2); }
.menu button .icon { color: var(--text-3); }
.menu button.danger, .menu button.danger .icon { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-tint); }

/* Compact bar shown after the header card scrolls away */
.p-sticky {
  position: fixed; top: 63px; left: 0; right: 0; z-index: 25; pointer-events: none;
  opacity: 0; transform: translateY(-10px); transition: opacity .25s ease, transform .3s var(--ease-out);
}
.p-sticky.show { opacity: 1; transform: none; pointer-events: auto; }
.p-sticky-inner {
  max-width: 1200px; margin: 8px auto 0; padding: 7px 8px 7px 8px; display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md);
  width: calc(100% - 64px);
}
.p-sticky .thumb { width: 36px; height: 36px; flex: none; display: grid; place-items: center; padding: 3px; border-radius: 8px; background: var(--img-bg); border: 1px solid var(--border); overflow: hidden; }
.p-sticky .thumb img { max-height: 100%; object-fit: contain; }
.p-sticky .t { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sticky .pr { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-sticky-nav { display: flex; gap: 2px; margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--border); }
.p-sticky-nav button {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap;
  transition: background .12s, color .12s;
}
.p-sticky-nav button:hover { background: var(--surface-2); color: var(--text); }
.p-sticky-nav .n { font-size: 11.5px; color: var(--text-3); }

/* Body: main column + side panel */
.p-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; margin-top: 8px; }
.p-body.no-aside, .p-body.no-main { grid-template-columns: minmax(0, 1fr); }
.p-body.no-aside .p-aside, .p-body.no-main .p-main { display: none; }
.p-body.no-main .p-aside { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.p-main { min-width: 0; }
.p-section { scroll-margin-top: 130px; }
.p-section .section-title { margin-top: 36px; }
.p-aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 36px; min-width: 0; }

.side-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  animation: fadeUp .45s var(--ease-out) backwards;
}
.p-aside .side-card:nth-child(2) { animation-delay: 60ms; }
.p-aside .side-card:nth-child(3) { animation-delay: 120ms; }
.p-aside .side-card:nth-child(4) { animation-delay: 180ms; }
.side-head, .collapse-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; }
.ch-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--accent-tint); color: var(--accent); }
.ch-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ch-title { font-size: 14px; font-weight: 600; }
.ch-summary { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-summary b { color: var(--text); font-weight: 600; }

.price-card { padding-bottom: 14px; }
.price-card .chart { padding: 0 10px; }
.price-card .chart-empty { margin: 0 16px; }
.target-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 16px 0; padding-top: 12px; border-top: 1px solid var(--border); }
.target-row .target-input { flex: 1; min-width: 150px; }
.target-row .target-input input { width: 100%; }

/* Collapsible cards (notes, features, details) */
.collapse-head { border: 0; background: transparent; cursor: pointer; border-radius: var(--radius-lg); transition: background .15s; }
.collapse-head:hover { background: var(--surface-2); }
.collapsible.open .collapse-head { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.collapsible.open .ch-summary { display: none; }
.ch-chev { color: var(--text-3); transition: transform .3s var(--ease); }
.collapsible.open .ch-chev { transform: rotate(180deg); }
.collapse-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease-out); }
.collapsible.open .collapse-body { grid-template-rows: 1fr; }
.collapse-inner { overflow: hidden; min-height: 0; }
.collapse-inner > * { margin: 0 16px; }
.collapse-inner > :last-child { margin-bottom: 16px; }
.collapse-inner > .btn { margin-left: 16px; }

.features { margin: 0; padding: 0 0 0 18px; color: var(--text-2); font-size: 13px; line-height: 1.55; display: grid; gap: 8px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; min-width: 0; }
.facts a { color: var(--accent); text-decoration: none; }
.facts a:hover { text-decoration: underline; }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Notes (inside the collapsible card) */
.notes-wrap { position: relative; }
.notes {
  display: block; width: 100%; min-height: 150px; resize: vertical; padding: 12px 14px 30px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius);
  font-size: 14px; line-height: 1.6; transition: border-color .15s, box-shadow .15s, background .15s;
}
.notes::placeholder { color: var(--text-3); }
.notes:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.save-state { position: absolute; right: 12px; bottom: 9px; font-size: 11.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; }
.save-state.saved { color: var(--success); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

.spark { display: block; overflow: visible; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; animation: draw 1.2s var(--ease-out) backwards; }
.spark .area { fill: var(--accent-tint); stroke: none; animation: fadeIn 1s ease backwards .3s; }
.spark circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }

/* Pros & cons */
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pc-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.pc-col h3 { margin: 0; padding: 14px 18px; display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; border-bottom: 1px solid var(--border); }
.pc-col h3 .badge { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; }
.pc-col.pro h3 .badge { background: var(--success-tint); color: var(--success); }
.pc-col.con h3 .badge { background: var(--danger-tint); color: var(--danger); }
.pc-col h3 .n { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-3); }
.pc-col ul { list-style: none; margin: 0; padding: 6px 0; flex: 1; }
.pc-col li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px 8px 18px; animation: slideIn .3s var(--ease-out) backwards; transition: background .12s; }
.pc-col li:hover { background: var(--surface-2); }
.pc-col li .mark { margin-top: 3px; flex: none; }
.pc-col.pro li .mark { color: var(--success); }
.pc-col.con li .mark { color: var(--danger); }
.pc-col li .txt { flex: 1; cursor: text; line-height: 1.5; }
.pc-col li .icon-btn { width: 26px; height: 26px; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.pc-col li:hover .icon-btn { opacity: 1; }
.pc-col li input { flex: 1; height: 28px; border: 1px solid var(--accent); border-radius: 6px; background: var(--surface); padding: 0 8px; box-shadow: 0 0 0 3px var(--accent-ring); }
.pc-col li input:focus { outline: none; }
.pc-col .empty { padding: 14px 18px; color: var(--text-3); font-size: 13.5px; }
.pc-col .adder { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-top: 1px solid var(--border); background: var(--surface-2); transition: background .15s; }
.pc-col .adder:focus-within { background: var(--surface); }
.pc-col .adder .icon { color: var(--text-3); }
.pc-col .adder input { flex: 1; height: 44px; border: 0; background: transparent; }
.pc-col .adder input:focus { outline: none; }
.pc-col .adder input::placeholder { color: var(--text-3); }

/* ---------- Sources & screenshots ---------- */

.src-add {
  display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.src-add:focus-within { border-color: var(--accent); box-shadow: var(--shadow-sm), 0 0 0 4px var(--accent-ring); }
.src-add .icon { color: var(--text-3); }
.src-add input { flex: 1; min-width: 0; height: 38px; border: 0; background: transparent; font-size: 14.5px; }
.src-add input:focus { outline: none; }
.src-add input::placeholder { color: var(--text-3); }
.src-list { display: grid; gap: 16px; margin-top: 16px; }
.src-card {
  position: relative; padding: 16px 18px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: border-color .25s, box-shadow .25s, background .2s;
  animation: fadeUp .45s var(--ease-out) backwards;
}
.src-card.active { border-color: var(--accent); box-shadow: var(--shadow-sm), 0 0 0 4px var(--accent-ring); }
.src-card.over { border-color: var(--accent); background: var(--accent-tint); }
.src-card.unsorted { background: transparent; border-style: dashed; border-color: var(--border-strong); box-shadow: none; }
.src-card.unsorted.active { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.src-head { display: flex; gap: 14px; align-items: center; }
.src-thumb { flex: none; display: block; position: relative; border-radius: 10px; overflow: hidden; }
.src-thumb img { width: 112px; height: 63px; object-fit: cover; transition: transform .4s var(--ease); }
.src-thumb:hover img { transform: scale(1.06); }
.src-thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.src-icon {
  flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}
.src-card.unsorted .src-icon { color: var(--text-3); background: var(--surface-2); }
.src-titles { flex: 1; min-width: 0; }
.src-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.src-meta .sep { opacity: .5; }
.src-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px; font-size: 15.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; text-decoration: none;
}
a.src-title { transition: color .15s; }
a.src-title:hover { color: var(--accent); }
.src-title .icon { display: inline-block; vertical-align: -2px; margin-left: 4px; color: var(--text-3); }
.src-actions { display: flex; gap: 2px; align-items: center; flex: none; }
.src-actions .btn.target { margin-right: 6px; }
.src-actions .btn.target.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.src-actions .btn.target.on .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-out infinite; }
.src-note {
  display: block; width: 100%; margin-top: 12px; padding: 8px 12px; resize: none; overflow: hidden;
  border: 1px solid transparent; border-radius: 8px; background: var(--surface-2);
  font-size: 13.5px; line-height: 1.5; color: var(--text-2); transition: border-color .15s, background .15s, box-shadow .15s;
}
.src-note::placeholder { color: var(--text-3); }
.src-note:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); color: var(--text); }
.src-card .shots, .src-card .shots-full { margin-top: 16px; }

/* Supporting links under a source card */
.src-links { margin-top: 12px; display: grid; gap: 6px; }
.src-link { display: flex; align-items: center; gap: 4px; animation: slideIn .3s var(--ease-out) backwards; }
.src-link .icon-btn { flex: none; opacity: .5; transition: opacity .15s; }
.src-link:hover .icon-btn, .src-link .icon-btn:focus-visible { opacity: 1; }
@media (hover: none) { .src-link .icon-btn { opacity: 1; } }
.sl-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 7px 10px 7px 7px;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none;
  transition: border-color .15s, background .15s;
}
.sl-main:hover { border-color: var(--border-strong); background: var(--surface-2); }
.sl-thumb { flex: none; width: 64px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--surface-3); }
.sl-icon {
  flex: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}
.sl-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sl-title { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-go { flex: none; color: var(--text-3); }
.sl-add {
  display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px;
  border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--text-3); transition: border-color .15s, background .15s;
}
.sl-add:focus-within { border-style: solid; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.sl-add input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 13.5px; color: var(--text); padding: 6px 0; }
.sl-add input:focus { outline: none; }
.sl-add input::placeholder { color: var(--text-3); }
.src-empty {
  margin-top: 14px; padding: 20px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-3); font-size: 13.5px;
  transition: border-color .2s, background .2s, color .2s;
}
.src-empty b { color: var(--text); font-weight: 600; }
.src-empty:hover { border-color: var(--accent); color: var(--text-2); }
.src-card.active .src-empty { border-color: var(--accent); background: var(--accent-tint); color: var(--text-2); }

.src-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  color: var(--c, var(--text-3)); background: color-mix(in srgb, var(--c, #888) 14%, transparent);
}
.src-badge.small { height: 18px; font-size: 10.5px; padding: 0 6px; }

/* Screenshot tiles */
.shots { columns: 3 240px; column-gap: 14px; }
.shot {
  position: relative; break-inside: avoid; margin: 0 0 14px; padding: 6px 6px 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs);
  transition: box-shadow .25s var(--ease), border-color .25s, transform .25s var(--ease);
  animation: popIn .35s var(--ease-out) backwards;
}
.shot:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.shot[draggable="true"] { cursor: grab; }
.shot[draggable="true"]:active { cursor: grabbing; }
.shot-img { position: relative; cursor: zoom-in; border-radius: 8px; overflow: hidden; background: var(--img-bg); }
.shot-img.linked { cursor: pointer; }
.shot-img img { width: 100%; transition: transform .4s var(--ease), filter .3s; }
.shot-img:hover img { transform: scale(1.015); }
.link-pill {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 550;
  background: rgba(17, 20, 26, .78); color: #fff; backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .25s var(--ease), background .2s;
}
.shot-img.linked:hover .link-pill, .shot.full .link-pill { opacity: 1; transform: none; }
.shot-img.linked:hover .link-pill { background: var(--accent); }
.shot input { width: 100%; height: 32px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; color: var(--text-2); }
.shot input::placeholder { color: var(--text-3); }
.shot input:focus { outline: none; background: var(--surface-2); color: var(--text); }
.shot-link {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0 6px 6px;
  font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot-link:hover { text-decoration: underline; }
.shot-tools {
  position: absolute; top: 12px; right: 12px; display: flex; gap: 2px; padding: 3px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(-4px) scale(.96); transition: opacity .18s, transform .22s var(--ease);
}
.shot:hover .shot-tools, .shot:focus-within .shot-tools { opacity: 1; transform: none; }
.shot-tools .icon-btn { width: 28px; height: 28px; }

/* Full view: one after another, natural size capped at a readable width */
.shots-full { display: grid; gap: 28px; justify-items: center; }
.shot.full { width: fit-content; max-width: min(960px, 100%); min-width: min(420px, 100%); margin: 0; padding: 10px 10px 4px; }
.shot.full .shot-img { display: flex; justify-content: center; background: var(--surface-2); }
.shot.full .shot-img img { width: auto; max-width: 100%; max-height: 85vh; object-fit: contain; }
.shot.full .shot-img:hover img { transform: none; }
.shot.full input { font-size: 14.5px; height: 38px; }
.shot.full .shot-link { white-space: normal; word-break: break-all; }
.shot.full .shot-tools { opacity: 1; transform: none; top: 6px; right: 10px; }
.shot-count { font: 500 11.5px var(--font-mono); color: var(--text-3); padding: 2px 4px 8px; }

.paste-target {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: min(400px, calc(100vw - 48px));
  display: flex; gap: 10px; align-items: center; height: 42px; padding: 0 16px 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); cursor: pointer; font-size: 13px;
  animation: slideUp .4s var(--ease-out) backwards; transition: transform .2s var(--ease), border-color .2s;
}
.paste-target:hover { transform: translateY(-2px); border-color: var(--accent); }
.paste-target kbd { flex: none; }
.paste-target .arrow { color: var(--text-3); flex: none; }
.paste-target .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.paste-target .live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.8s ease-out infinite; }

/* ---------- Price tracking ---------- */

.small { font-size: 12.5px; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  border-radius: 10px; text-decoration: none; font-size: 13.5px; font-weight: 500; color: var(--text-2);
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.on { background: var(--accent-tint); color: var(--accent); }
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--success); color: #fff; font-size: 11px; font-weight: 650; animation: popIn .3s var(--ease-out) backwards;
}

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.down { color: var(--success); }
.delta.up { color: var(--danger); }
.delta.flat { color: var(--text-3); font-weight: 500; }
.delta .pct { font-weight: 500; opacity: .8; margin-left: 3px; }
.icon.flip { transform: rotate(180deg); }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong); transition: background .2s var(--ease); flex: none; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease-out); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .thumb { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.manual-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--success-tint); color: var(--success); font-size: 13px; font-weight: 550;
}
.track-row.head.manual span:last-child { visibility: hidden; }
.err { display: inline-flex; align-items: center; gap: 5px; color: var(--danger); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }

.chart { position: relative; width: 100%; }
.chart { min-width: 0; }
.chart svg { display: block; overflow: visible; cursor: crosshair; max-width: 100%; height: auto; }
.chart .tick line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .tick text, .chart .axis { font: 500 11px var(--font-sans); fill: var(--text-3); font-variant-numeric: tabular-nums; }
.chart .area { fill: var(--accent-tint); animation: fadeIn .8s ease backwards .2s; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-dasharray: 2000; animation: drawLong 1.4s var(--ease-out) backwards; }
@keyframes drawLong { from { stroke-dashoffset: 2000; } to { stroke-dashoffset: 0; } }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; transition: r .15s; }
.chart .pt.on { fill: var(--accent); }
.chart .guide { stroke: var(--text-3); stroke-dasharray: 2 3; }
.chart .target line { stroke: var(--success); stroke-width: 1.5; stroke-dasharray: 6 4; }
.chart .target text { font: 600 11px var(--font-sans); fill: var(--success); }
.chart-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; z-index: 2;
  display: grid; gap: 2px; padding: 8px 11px; border-radius: 10px; white-space: nowrap;
  background: var(--text); color: var(--bg); font-size: 12px; box-shadow: var(--shadow-lg);
  animation: fadeIn .12s ease backwards;
}
.chart-tip b { font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-tip span { opacity: .75; }
.chart-tip .delta.down { color: #4ade80; }
.chart-tip .delta.up { color: #ff8a8d; }
.chart-empty {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 96px; padding: 20px;
  color: var(--text-3); font-size: 13.5px; border: 1.5px dashed var(--border); border-radius: var(--radius); text-align: center;
}

.target-input {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-3); transition: border-color .15s, box-shadow .15s;
}
.target-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.target-input .cur { font-size: 13px; color: var(--text-2); }
.target-input input { width: 104px; border: 0; background: transparent; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.target-input input::-webkit-outer-spin-button, .target-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.target-input input:focus { outline: none; }
.target-input input::placeholder { color: var(--text-3); }
.hit-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--success-tint); color: var(--success); font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* Store logos and the top card's store prices */
.store-logo {
  flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 8px;
  background: #fff; border: 1px solid var(--border); font-weight: 700; line-height: 1;
}
.store-logo img { width: 70%; height: 70%; object-fit: contain; }
.store-logo.letter { border-color: transparent; }
.store-logo.add { background: var(--surface-2); border-style: dashed; border-color: var(--border-strong); color: var(--text-3); }
.store-prices { display: grid; gap: 10px; }
.sp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sp-head .link-btn { font-size: 12.5px; }
.sp-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-tile {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-width: 150px; padding: 8px 14px 8px 8px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none;
  font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease);
}
.sp-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.sp-tile.best { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); background: color-mix(in srgb, var(--success) 7%, var(--surface)); }
.sp-text { display: grid; gap: 1px; min-width: 0; }
.sp-store { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.sp-price { font-size: 16px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sp-price.muted { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.sp-badge { font-size: 10px; font-weight: 650; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); }
.sp-best {
  position: absolute; top: -8px; right: 8px; display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px;
  border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--success); box-shadow: var(--shadow-xs);
}
.sp-add { border-style: dashed; background: transparent; }
.of-line .store-logo { border-radius: 6px; }

/* Verdict picker */
.verdict { position: relative; margin-left: auto; }
.verdict-btn {
  --c: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  transition: background .15s, box-shadow .15s;
}
.verdict-btn:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 15%, transparent); }
.verdict-btn i, .vm-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.verdict-btn .icon { opacity: .7; }
.verdict-btn.shortlisted, .vm-item.shortlisted { --c: var(--accent); }
.verdict-btn.waiting, .vm-item.waiting { --c: var(--warning); }
.verdict-btn.bought, .vm-item.bought { --c: var(--success); }
.verdict-btn.returned, .vm-item.returned { --c: var(--violet); }
.verdict-btn.dropped, .vm-item.dropped { --c: var(--danger); }
.vm-item.considering { --c: var(--text-3); }
.verdict-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 270px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: popIn .16s var(--ease-out) backwards; transform-origin: top right;
}
.vm-title { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.vm-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .12s;
}
.vm-item:hover { background: var(--surface-2); }
.vm-item.on { background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.vm-item > .icon { margin-left: auto; color: var(--c); }
.vm-text { display: grid; gap: 1px; }
.vm-text b { font-size: 13.5px; font-weight: 600; }
.vm-text span { font-size: 12px; color: var(--text-3); }

/* Where to buy: the same product at other stores */
.cheaper-pill, .cheaper-at {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content; justify-self: start;
  color: var(--success); font-weight: 600; text-decoration: none;
}
.cheaper-pill { height: 24px; padding: 0 9px; border-radius: 999px; background: var(--success-tint); font-size: 12px; }
.cheaper-pill:hover { text-decoration: underline; }
.cheaper-at { font-size: 12px; }
.compare .cheaper-at { margin-top: 3px; font-size: 11.5px; justify-content: flex-end; width: auto; }
.offers-card { padding-bottom: 12px; scroll-margin-top: 130px; }
.offers { list-style: none; margin: 0 12px; padding: 0; display: grid; gap: 6px; }
.offer { padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; display: grid; gap: 4px; transition: border-color .15s, background .15s; }
.offer.best { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); background: color-mix(in srgb, var(--success) 6%, var(--surface)); }
.of-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.of-store { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-store:hover { color: var(--accent); }
.of-store .icon { flex: none; color: var(--text-3); }
.of-tag { flex: none; font-size: 10.5px; font-weight: 650; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); }
.of-tag.best { background: var(--success-tint); color: var(--success); }
.of-price { margin-left: auto; flex: none; font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.of-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--text-3); }
.of-sub .cheaper { color: var(--success); font-weight: 600; }
.of-sub .dearer { color: var(--danger); }
.of-sub .err { color: var(--danger); }
.of-note { flex-basis: 100%; color: var(--text-2); }
.of-actions { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.of-actions .btn { margin-left: auto; }
.of-actions .icon-btn { width: 28px; height: 28px; }
.of-edit { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px; margin-top: 4px; }
.of-edit .input { height: 32px; font-size: 13px; }
.of-edit-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }
.of-add {
  display: flex; align-items: center; gap: 8px; margin: 10px 12px 0; padding: 4px 4px 4px 12px;
  border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--text-3);
}
.of-add:focus-within { border-style: solid; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.of-add input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 13px; color: var(--text); padding: 6px 0; }
.of-add input:focus { outline: none; }
.to-go { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* Prices page */
.prices-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 40px; }
.prices-head h1 { font-size: clamp(38px, 5vw, 56px); }
.prices-sub { margin: 8px 0 0; color: var(--text-3); font-size: 14px; }
.prices-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prices-controls .interval { width: auto; min-width: 150px; }
.alerts-on { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--success); padding: 0 6px; }
.run-progress { display: grid; gap: 8px; margin-top: 18px; font-size: 13px; animation: fadeUp .3s var(--ease-out) backwards; }
.run-progress .bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.run-progress .bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s var(--ease); min-width: 6%; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
.stat {
  display: grid; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); animation: fadeUp .45s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 50ms);
}
.stat .label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.stat b { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat b.good { color: var(--success); }
.stat .sub { font-size: 12px; color: var(--text-3); }

.track-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.track-row {
  display: grid; grid-template-columns: 56px minmax(0, 2.3fr) minmax(110px, 1fr) minmax(130px, 1fr) minmax(150px, 1.1fr) minmax(84px, auto);
  gap: 18px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border);
  transition: background .15s, opacity .2s; animation: fadeUp .4s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 35ms);
}
.track-row:first-child { border-top: 0; }
.track-row:not(.head):hover { background: var(--surface-2); }
.track-row.head { padding-top: 10px; padding-bottom: 10px; background: var(--surface-2); font-size: 12px; font-weight: 500; color: var(--text-3); animation: none; }
.track-row.paused { opacity: .55; }
.track-row.paused:hover { opacity: .85; }
.track-row.hit { box-shadow: inset 3px 0 0 var(--success); }
.track-img { width: 56px; height: 56px; display: grid; place-items: center; padding: 4px; background: var(--img-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.track-img img { max-height: 100%; object-fit: contain; }
.track-main { min-width: 0; }
.track-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 550; font-size: 13.5px; line-height: 1.35; text-decoration: none; transition: color .15s; }
.track-title:hover { color: var(--accent); }
.track-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; font-size: 12px; color: var(--text-3); }
.track-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.track-meta .status-pill { height: 20px; font-size: 11px; padding: 0 8px; }
.track-price { display: grid; gap: 2px; justify-items: start; }
.track-price .now { font-size: 17px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.track-price .since { font-size: 11.5px; color: var(--text-3); }
.track-range { display: grid; gap: 6px; }
.range { display: grid; gap: 4px; }
.range-bar { position: relative; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--success-tint), var(--surface-3) 50%, var(--danger-tint)); }
.range-bar .marker { position: absolute; top: 50%; width: 12px; height: 12px; margin-left: -6px; transform: translateY(-50%); border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: var(--shadow-sm); transition: left .6s var(--ease); }
.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.track-target { display: grid; gap: 6px; justify-items: start; }
.track-target .target-input input { width: 84px; }
.track-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

.timeline { display: grid; gap: 8px; }
.tl-item {
  display: grid; grid-template-columns: 30px 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; animation: fadeUp .4s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 30ms);
}
.tl-item:hover { transform: translateX(3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.tl-dot.down { background: var(--success-tint); color: var(--success); }
.tl-dot.up { background: var(--danger-tint); color: var(--danger); }
.tl-item img, .tl-item .noimg { width: 44px; height: 44px; object-fit: contain; background: var(--img-bg); border-radius: 8px; border: 1px solid var(--border); padding: 3px; }
.tl-title { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.tl-line s { color: var(--text-3); }
.tl-line .icon { color: var(--text-3); }
.tl-when { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 48px 80px;
  background: rgba(8, 10, 14, .9); backdrop-filter: blur(6px); animation: fadeIn .2s ease backwards;
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); background: #fff; animation: zoomIn .3s var(--ease-out) backwards; }
.lightbox .cap { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 16px; color: #e8eaed; font-size: 14px; }
.lightbox .lb-src { font-weight: 600; }
.lightbox .counter { font: 500 12px var(--font-mono); color: #8a91a0; }
.lightbox .lb-link { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.lightbox .lb-link:hover { background: rgba(255, 255, 255, .2); }
.lightbox .nav {
  position: fixed; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08);
  color: #fff; cursor: pointer; transition: background .15s, transform .15s var(--ease);
}
.lightbox .nav:hover { background: rgba(255, 255, 255, .18); }
.lightbox .prev { left: 20px; }
.lightbox .next { right: 20px; }
.lightbox .close { top: 20px; right: 20px; transform: none; width: 40px; height: 40px; }

/* ---------- Modal ---------- */

.modal-back {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px;
  background: var(--overlay); backdrop-filter: blur(4px); animation: fadeIn .2s ease backwards;
}
.modal {
  width: min(480px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg);
  animation: modalIn .28s var(--ease-out) backwards;
}
.modal.wide { width: min(640px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 4px 24px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; flex: 1; }
.modal-body { padding: 14px 24px 8px; overflow: auto; }
.modal-body p { margin: 0; color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; }
.cat-preview { display: flex; gap: 14px; align-items: flex-end; }
.emoji-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin: 4px 0 8px; }
.emoji-grid button {
  height: 38px; font-size: 19px; border: 1px solid transparent; background: transparent; border-radius: 9px; cursor: pointer;
  transition: background .12s, transform .15s var(--ease), border-color .12s;
}
.emoji-grid button:hover { background: var(--surface-2); transform: scale(1.12); }
.emoji-grid button.on { border-color: var(--accent); background: var(--accent-tint); }
.source-picker { display: flex; gap: 8px; }
.source-picker .select { flex: 1; }
.source-picker .input { flex: 1; }
.shot-preview { max-height: 180px; width: 100%; object-fit: contain; background: var(--img-bg); border: 1px solid var(--border); border-radius: 10px; }

/* ---------- Toasts ---------- */

.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 10px 16px 10px 12px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .35s var(--ease-out) backwards;
}
.toast .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast.leaving { animation: toastOut .3s ease forwards; }
.toast.has-action { pointer-events: auto; padding-right: 8px; }
.toast-action {
  margin-left: 6px; height: 28px; padding: 0 12px; border-radius: 8px; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); font-weight: 650; font-size: 13px;
  transition: background .15s;
}
.toast-action:hover { background: color-mix(in srgb, var(--bg) 30%, transparent); }

/* Duplicate warning in the add preview */
.dup-warn {
  grid-column: 1 / -1; display: grid; gap: 8px; padding: 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
  animation: fadeUp .3s var(--ease-out) backwards;
}
.dup-warn.exact { background: var(--danger-tint); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.dw-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--warning); }
.dup-warn.exact .dw-head { color: var(--danger); }
.dw-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s;
}
.dw-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.dw-row > .icon { color: var(--text-3); flex: none; }
.dw-img { width: 44px; height: 44px; flex: none; display: grid; place-items: center; padding: 3px; border-radius: 8px; background: var(--img-bg); border: 1px solid var(--border); overflow: hidden; }
.dw-img img { max-height: 100%; object-fit: contain; }
.dw-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dw-title { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-meta { font-size: 12px; color: var(--text-3); }

/* ---------- Animations ---------- */

/* Opacity only: a transform here would make .page the containing block for fixed overlays (modals, lightbox). */
@keyframes pageIn { from { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.94); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-6px); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .shell, .topbar-inner { padding-left: 16px; padding-right: 16px; }
  .search { margin-left: 0; }
  .search .kbd-hint, .brand .name, .topbar .btn .lbl { display: none; }
  .pc-grid { grid-template-columns: 1fr; }
  .preview { grid-template-columns: 1fr; }
  .src-head { flex-wrap: wrap; }
  .src-actions { width: 100%; justify-content: flex-end; }
  .lightbox { padding: 56px 12px; }
  .lightbox .nav.prev, .lightbox .nav.next { top: auto; bottom: 16px; transform: none; }
  .paste-target { right: 12px; bottom: 12px; }
  .nav-link .lbl { display: none; }
  .nav-link { padding: 0 10px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .cat-head { padding: 20px 16px 16px; border-radius: 18px; gap: 16px; }
  .hd-main { gap: 14px; flex-basis: 100%; align-items: flex-start; }
  .hd-icon { width: 56px; height: 56px; font-size: 28px; border-radius: 16px; }
  .hd-title { font-size: 25px; }
  .hd-stats { margin-top: 6px; }
  .hd-stat { height: 26px; padding: 0 9px; font-size: 12px; }
  .hd-actions { width: 100%; justify-content: flex-start; }
  .hd-actions .btn.primary { flex: 1; justify-content: center; }
  .tier-row { grid-template-columns: 64px minmax(0, 1fr); }
  .tier-tools { display: none; }
  .tier-label { font-size: 18px; }
  .tier-tile { width: 104px; }
  .tt-img { height: 72px; }
  .tt-img img { max-height: 56px; }
  .tt-title { font-size: 11px; }
  .track-row { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px 14px; }
  .track-row.head { display: none; }
  .track-range { display: none; }
  .track-target { grid-column: 2 / 3; }
  .track-price { grid-column: 3; grid-row: 1; justify-items: end; }
  .track-actions { grid-column: 3; grid-row: 2; }
  .p-hero { grid-template-columns: 1fr; gap: 20px; padding: 16px; }
  .p-hero-img { max-width: 360px; width: 100%; justify-self: center; }
  .p-body { grid-template-columns: 1fr; }
  .p-aside { margin-top: 24px; }
  .p-sticky { top: 61px; }
  .p-sticky-inner { width: calc(100% - 24px); }
  .p-sticky .pr, .p-sticky .status-pill, .p-sticky-nav button:not(:last-child) { display: none; }
}

@media (max-width: 600px) {
  .paste-row { flex-wrap: wrap; }
  .paste-row input { flex-basis: calc(100% - 44px); }
  .paste-row .btn { width: 100%; }
  .src-add { flex-wrap: wrap; padding: 8px; }
  .src-add input { flex-basis: calc(100% - 32px); }
  .src-add .btn { width: 100%; }
}

/* Touch screens have no hover: keep the card's Move button visible. */
@media (hover: none) {
  .card-act { opacity: 1; transform: none; }
}

/* Phones: two product cards per row, tightened up. */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 44px 32px 36px; }
  .hero-art { height: 250px; max-width: 460px; width: 100%; justify-self: center; }
  .ha-tile.t0 { width: 130px; height: 130px; }
  .ha-tile.t1 { width: 100px; height: 100px; }
  .ha-tile.t2 { width: 90px; height: 90px; }
  .ha-tile.t3 { width: 110px; height: 110px; }
  .ha-tile.t4 { width: 72px; height: 72px; }
  .stat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .hero { margin-top: 16px; padding: 30px 18px 22px; border-radius: 24px; gap: 8px; }
  .hero-title { font-size: 36px; }
  .hero-sub { font-size: 15px; }
  .hero-art { height: 190px; }
  .ha-tile { padding: 9px; border-radius: 18px; }
  .ha-tile.t0 { width: 100px; height: 100px; }
  .ha-tile.t1 { width: 78px; height: 78px; }
  .ha-tile.t2 { width: 70px; height: 70px; }
  .ha-tile.t3 { width: 86px; height: 86px; }
  .ha-tile.t4 { display: none; }
  .ha-chip { font-size: 11.5px; padding: 8px 10px 8px 8px; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-tile { padding: 14px; border-radius: 18px; }
  .stat-tile:first-child { grid-column: 1 / -1; }
  .st-value { font-size: 28px; }
  .rail { grid-auto-columns: 160px; gap: 10px; }
  .bookmarklet { margin-left: 0; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cat-card { border-radius: 18px; padding: 5px; }
  .cc-stage { height: 112px; border-radius: 13px; }
  .cc-shot { width: 58px; height: 58px; margin: 0 -10px; padding: 5px; border-radius: 13px; }
  .cc-stack.n1 .cc-shot { width: 76px; height: 76px; }
  .cc-stack.n3 .cc-shot:nth-child(2) { width: 68px; height: 68px; }
  .cc-big { font-size: 40px; }
  .cc-hint { display: none; }
  .cc-body { padding: 10px 6px 4px; gap: 3px; }
  .cat-card .name { font-size: 14.5px; }
  .cc-go { display: none; }
  .cc-meta { flex-direction: column; gap: 1px; }
  .cc-count { font-size: 11.5px; }
  .cc-price { font-size: 12.5px; }
  .cat-card .sub-chips { display: none; }
  .cat-card.new { min-height: 180px; font-size: 13px; }
  .section-title .hint { display: none; }
  .section-title .hint + .sh-actions { margin-left: auto; }
  .section-title { margin-top: 36px; }
  .view-panel { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 75vh; overflow: auto; transform-origin: bottom center; }
  .cr-start { padding: 14px; }
  .bulk-bar { left: 12px; right: 12px; bottom: 12px; translate: none; flex-wrap: wrap; padding: 8px 8px 8px 14px; }
  .bulk-bar .count { flex: 1 1 auto; }
  .bulk-bar > .icon-btn { margin-left: auto; }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .prod-card { border-radius: 12px; }
  .prod-card .img { padding: 10px; }
  .prod-card .img .status-pill { top: 6px; left: 6px; height: 20px; font-size: 10.5px; padding: 0 7px; }
  .prod-card .body { padding: 9px 10px 10px; gap: 5px; }
  .prod-card .store { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prod-card .title { font-size: 12.5px; line-height: 1.35; }
  .prod-card .price { gap: 2px 6px; }
  .prod-card .price .now { font-size: 15px; }
  .prod-card .price s { font-size: 11px; }
  .prod-card .price .off { font-size: 10.5px; padding: 1px 5px; }
  .prod-card .stars .n { font-size: 11px; }
  .prod-card .foot { gap: 8px; font-size: 11px; padding-top: 7px; }
  .prod-card .in-sub { font-size: 10px; }
  .card-act { top: 6px; right: 6px; width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 8px; }
  .card-act .lbl { display: none; }
  .grip { top: 6px; right: 6px; width: 38px; height: 38px; }
  .pick { top: 6px; right: 6px; }
  .toolbar { gap: 6px; }
  .toolbar-gap { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Login (AUTH=supabase) ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.login {
  position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px 16px;
}
.login .hero-bg { position: fixed; }
.login-card {
  width: min(420px, 100%); display: grid; justify-items: center; text-align: center; gap: 6px; padding: 36px 30px 30px;
  border-radius: 28px; background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(18px); box-shadow: 0 30px 70px -30px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow-md);
  animation: fadeUp .5s var(--ease-out) backwards;
}
.login-mark {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 10px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--violet)); box-shadow: 0 14px 30px -12px var(--accent);
}
.login-card h1 { margin: 0; font-family: var(--font-sans); font-size: 26px; font-weight: 750; letter-spacing: -.035em; }
.login-sub { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.login-sub b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.login-form { width: 100%; display: grid; gap: 10px; }
.login-field {
  display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 14px; color: var(--text-3);
  background: var(--surface); border: 1px solid var(--border-strong); transition: border-color .15s, box-shadow .15s;
}
.login-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.login-field input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; color: var(--text); }
.login-field input:focus { outline: none; }
.login-code {
  height: 60px; width: 100%; border-radius: 14px; text-align: center; font-family: var(--font-mono); font-size: 28px; font-weight: 600;
  letter-spacing: .45em; padding-left: .45em; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  transition: border-color .15s, box-shadow .15s;
}
.login-code:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.login-code::placeholder { color: var(--border-strong); }
.login-btn { height: 50px; justify-content: center; border-radius: 14px; font-size: 15px; border: 0; background: linear-gradient(135deg, var(--accent), var(--violet)); box-shadow: 0 10px 24px -10px var(--accent); }
.login-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; }
.login-links .link-btn:disabled { color: var(--text-3); cursor: default; text-decoration: none; }
.login-error {
  width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  font-size: 13px; text-align: left; color: var(--danger); background: var(--danger-tint);
}
.login-foot { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--text-3); }

/* Account button in the top bar */
.account { position: relative; }
.account-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--violet)); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border);
}
.account-menu { min-width: 230px; }
.am-head { display: grid; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-size: 12px; }
.am-head b { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.login-mail { width: 64px; height: 64px; margin: 4px auto 6px; border-radius: 20px; display: grid; place-items: center; color: var(--accent); background: var(--accent-tint); }
.login-hint { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); text-align: center; }
