/* ==========================================================================
   ShelfEdge — design tokens
   ========================================================================== */

:root {
  --font-sans: ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, monospace;

  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  --background: #f7f8fa;
  --foreground: #22283a;
  --surface: #f1f3f7;
  --card: #ffffff;
  --card-foreground: #22283a;
  --popover: #ffffff;
  --popover-foreground: #22283a;
  --primary: #3b6fd4;
  --primary-foreground: #f7f8fa;
  --brand-soft: #e8f0fc;
  --secondary: #eef0f4;
  --secondary-foreground: #3a4256;
  --muted: #eef0f4;
  --muted-foreground: #6b7288;
  --accent: #eef2f8;
  --accent-foreground: #3d4f7c;
  --destructive: #c23b2e;
  --destructive-foreground: #f7f8fa;
  --success: #2a9a5c;
  --success-foreground: #f7f8fa;
  --success-soft: #e6f6ec;
  --warning: #d4a017;
  --warning-soft: #fbf3d6;
  --border: #e4e6ec;
  --input: #e4e6ec;
  --ring: #3b6fd4;

  --chart-1: #3b6fd4;
  --chart-2: #2a9a5c;
  --chart-3: #d4a017;

  --sidebar: #f8f9fb;
  --sidebar-accent: #e8f0fc;
  --sidebar-accent-foreground: #3d4f7c;

  --shadow-card: 0 1px 2px rgba(30, 36, 56, 0.05), 0 1px 3px rgba(30, 36, 56, 0.06);
  --shadow-lift: 0 10px 30px -12px rgba(30, 36, 56, 0.18);
  --shadow-pop: 0 12px 28px -8px rgba(30, 36, 56, 0.22);
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--border);
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-size: inherit;
  font-weight: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
}

button {
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Icons are hydrated from `js/icons.js` into this placeholder. */
.icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon-lg {
  width: 1.125rem;
  height: 1.125rem;
}

/* ==========================================================================
   Typography helpers
   ========================================================================== */

.title-xl {
  font-size: clamp(1.75rem, 8vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.title-lg {
  font-size: clamp(1.5rem, 6.5vw, 1.875rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.title-md {
  font-size: 1.5rem;
  font-weight: 600;
}

.title-sm {
  font-size: 1.125rem;
  font-weight: 600;
}

.title-xs {
  font-weight: 600;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

.muted {
  color: var(--muted-foreground);
}

.text-foreground {
  color: var(--foreground);
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.mono {
  font-family: var(--font-mono);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.strike {
  text-decoration: line-through;
}

.medium {
  font-weight: 500;
}

.semibold {
  font-weight: 600;
}

.success-text {
  color: var(--success);
}

.primary-text {
  color: var(--primary);
}

.link {
  font-weight: 500;
  color: var(--primary);
}

.link:hover {
  text-decoration: underline;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.page {
  min-height: 100vh;
  background-color: var(--background);
}

.page-surface {
  min-height: 100vh;
  background-color: var(--surface);
}

.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.container-narrow {
  width: 100%;
  max-width: 48rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.row-between {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.row-baseline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.spacer {
  margin-left: auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.divide > * + * {
  border-top-width: 1px;
}

.separator {
  height: 1px;
  background-color: var(--border);
  border: 0;
  margin-block: 1.25rem;
}

.separator-flex {
  flex: 1;
  height: 1px;
  background-color: var(--border);
  border: 0;
}

/* Spacing scale used across pages. */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-14 { margin-top: 3.5rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* ==========================================================================
   App shell — sidebar, topbar, content
   ========================================================================== */

.app {
  display: flex;
  min-height: 100vh;
  background-color: #f5f6f8;
}

.sidebar {
  display: none;
  width: 15.5rem;
  flex-direction: column;
  flex: none;
  border-right: 1px solid #eceef2;
  background-color: #fff;
  padding: 1.25rem 0.85rem;
}

.sidebar-head {
  padding: 0 0.5rem 1.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background-color 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.sidebar-link.is-active {
  background-color: #111827;
  color: #fff;
}

.sidebar-foot {
  margin-top: auto;
  border: 0;
  border-radius: 1rem;
  background-color: #f7f8fa;
  padding: 0.85rem;
  font-size: 0.875rem;
}

.app-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 3.5rem;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #eceef2;
  background-color: rgba(245, 246, 248, 0.92);
  backdrop-filter: blur(8px);
  padding-inline: 1rem;
}

.topbar-search {
  position: relative;
  display: none;
  flex: 1;
  max-width: 24rem;
}

.topbar-search .icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

.topbar-search .input {
  height: 2.25rem;
  padding-left: 2rem;
  background-color: var(--surface);
  font-size: 0.875rem;
}

.icon-button {
  position: relative;
  border-radius: var(--radius-md);
  padding: 0.5rem;
  color: var(--muted-foreground);
  transition: background-color 0.15s, color 0.15s;
}

.icon-button:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.icon-button .dot {
  position: absolute;
  right: 0.375rem;
  top: 0.375rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background-color: var(--destructive);
}

.content {
  flex: 1;
  padding: 1.75rem 1.25rem 3rem;
}

/* ==========================================================================
   Logo
   ========================================================================== */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-md);
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* ==========================================================================
   Card
   ========================================================================== */

.card {
  border-width: 1px;
  border-radius: var(--radius-xl);
  background-color: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-card);
}

.card-pad {
  padding: 1.25rem;
}

.card-pad-lg {
  padding: 1.25rem;
}

.card-head {
  border-bottom-width: 1px;
  padding: 1rem 1.25rem;
}

.card-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border-bottom-width: 1px;
  padding: 0.75rem 1rem;
}

.card-ring {
  box-shadow: var(--shadow-card), 0 0 0 2px var(--primary);
}

.card-brand {
  border-width: 1px;
  border-radius: var(--radius-xl);
  background-color: var(--brand-soft);
  padding: 1.25rem;
}

.panel {
  border-width: 1px;
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  padding: 1rem;
}

/* ==========================================================================
   Button
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.35rem;
  padding-inline: 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  background-color: #111827;
  color: #fff;
  transition: background-color 0.15s, color 0.15s, opacity 0.15s;
}

.btn:hover {
  background-color: #1f2937;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-outline {
  background-color: var(--background);
  color: var(--foreground);
  border-width: 1px;
  border-color: var(--input);
}

.btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-danger {
  background-color: var(--background);
  color: var(--destructive);
  border-width: 1px;
  border-color: color-mix(in oklab, var(--destructive) 35%, transparent);
}

.btn-danger:hover {
  background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}

.btn-sm {
  height: 2rem;
  padding-inline: 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  height: 2.75rem;
  padding-inline: 1.5rem;
  font-size: 1rem;
}

.btn-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Badge
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius-md);
  border-width: 1px;
  border-color: transparent;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.badge-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  background-color: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.badge-pill {
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
}

.badge-success {
  background-color: var(--success-soft);
  color: var(--success);
}

.badge-warning {
  background-color: var(--warning-soft);
  color: var(--warning);
}

.badge-brand {
  background-color: var(--brand-soft);
  color: var(--primary);
}

.badge-muted {
  background-color: var(--muted);
  color: var(--muted-foreground);
}

/* ==========================================================================
   Form controls
   ========================================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}

.input {
  display: block;
  width: 100%;
  height: 2.25rem;
  border-width: 1px;
  border-color: var(--input);
  border-radius: var(--radius-md);
  background-color: var(--background);
  padding-inline: 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: var(--muted-foreground);
}

.input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 22%, transparent);
}

.input-uppercase {
  text-transform: uppercase;
}

.input-with-icon {
  position: relative;
}

.input-with-icon > .icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.input-with-icon > .input {
  padding-left: 2rem;
}

/* --- Switch --------------------------------------------------------------- */

.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 2rem;
  height: 1.15rem;
  border-radius: 9999px;
  background-color: color-mix(in oklab, var(--foreground) 22%, transparent);
  padding: 2px;
  transition: background-color 0.15s;
}

.switch::after {
  content: "";
  width: calc(1.15rem - 4px);
  height: calc(1.15rem - 4px);
  border-radius: 9999px;
  background-color: var(--background);
  box-shadow: 0 1px 2px oklch(0.25 0.03 255 / 0.25);
  transition: transform 0.15s;
}

.switch[aria-checked="true"] {
  background-color: var(--primary);
}

.switch[aria-checked="true"]::after {
  transform: translateX(calc(2rem - 1.15rem));
}

/* --- Checkbox ------------------------------------------------------------- */

.checkbox {
  display: grid;
  place-items: center;
  flex: none;
  width: 1rem;
  height: 1rem;
  border-width: 1px;
  border-color: var(--input);
  border-radius: var(--radius-sm);
  background-color: var(--background);
  color: transparent;
  transition: background-color 0.15s, border-color 0.15s;
}

.checkbox .icon {
  width: 0.75rem;
  height: 0.75rem;
  stroke-width: 3;
}

.checkbox[aria-checked="true"] {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

/* --- Slider --------------------------------------------------------------- */

.slider {
  --slider-fill: 0%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 1rem;
  background: none;
  cursor: pointer;
}

.slider::-webkit-slider-runnable-track {
  height: 0.375rem;
  border-radius: 9999px;
  background: linear-gradient(
    to right,
    var(--primary) var(--slider-fill),
    var(--muted) var(--slider-fill)
  );
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  margin-top: -0.3125rem;
  border-radius: 9999px;
  border: 1px solid var(--primary);
  background-color: var(--background);
  box-shadow: var(--shadow-card);
}

.slider::-moz-range-track {
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--muted);
}

.slider::-moz-range-progress {
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--primary);
}

.slider::-moz-range-thumb {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 9999px;
  border: 1px solid var(--primary);
  background-color: var(--background);
}

/* --- Progress ------------------------------------------------------------- */

.progress {
  height: 0.5rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background-color: var(--muted);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background-color: var(--primary);
}

/* --- Native select (used for server-side filter forms) -------------------- */

.select-native {
  appearance: none;
  display: block;
  width: 100%;
  height: 2.25rem;
  border-width: 1px;
  border-color: var(--input);
  border-radius: var(--radius-md);
  background-color: var(--background);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7f8c' 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 0.625rem center;
  background-size: 1rem;
  padding: 0 2rem 0 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.select-native:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 22%, transparent);
}

/* --- Tabs ----------------------------------------------------------------- */

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius-lg);
  background-color: var(--muted);
  padding: 0.1875rem;
}

.tab {
  border-radius: var(--radius-md);
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background-color 0.15s, color 0.15s;
}

.tab.is-active {
  background-color: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-card);
}

/* --- Flash messages and validation errors --------------------------------- */

.alert {
  border-width: 1px;
  border-radius: var(--radius-md);
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
}

.alert-error {
  border-color: color-mix(in oklab, var(--destructive) 35%, transparent);
  background-color: color-mix(in oklab, var(--destructive) 8%, transparent);
  color: var(--destructive);
}

.alert-info {
  margin-bottom: 1.25rem;
  border-color: color-mix(in oklab, var(--primary) 30%, transparent);
  background-color: color-mix(in oklab, var(--primary) 7%, transparent);
  color: var(--primary);
}

.alert-warning {
  border-color: color-mix(in oklab, var(--warning) 40%, transparent);
  background-color: color-mix(in oklab, var(--warning) 10%, transparent);
  color: color-mix(in oklab, var(--warning) 75%, black);
}

.alert ul {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field-error {
  font-size: 0.75rem;
  color: var(--destructive);
}

.sidebar-link.is-locked {
  color: var(--muted-foreground);
}

.sidebar-link.is-locked svg:last-child {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.7;
}

/* --- Pagination ----------------------------------------------------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border-top-width: 1px;
  padding: 0.75rem 1rem;
}

.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* --- Empty state ---------------------------------------------------------- */

.empty {
  padding: 3rem 1.25rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* --- Avatar --------------------------------------------------------------- */

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: var(--brand-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ==========================================================================
   Table
   ========================================================================== */

.table-scroll {
  overflow-x: auto;
}

.table th {
  background-color: color-mix(in oklab, var(--surface) 60%, transparent);
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-align: left;
  white-space: nowrap;
  border-bottom-width: 1px;
}

.table td {
  padding: 0.75rem;
  border-bottom-width: 1px;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom-width: 0;
}

.table tbody tr:hover {
  background-color: color-mix(in oklab, var(--surface) 70%, transparent);
}

.table .col-right {
  text-align: right;
}

.table .col-product {
  min-width: 22rem;
  width: 38%;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 0.35rem 0.5rem;
  color: inherit;
  text-decoration: none;
}

.match-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.match-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.match-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  font-size: 0.5625rem;
  font-weight: 800;
  color: #fff;
}

.match-logo.is-amazon { background: #ff9900; }
.match-logo.is-tesco { background: #00539f; }

.match-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7.5rem;
  height: 7.5rem;
  overflow: hidden;
  background: #fff;
}

.match-thumb {
  width: 7.5rem;
  height: 7.5rem;
  max-width: 7.5rem;
  max-height: 7.5rem;
  object-fit: contain;
}

.match-frame.is-empty {
  background: var(--surface);
}

.match-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  max-width: 9rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
}

.match-price {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.match-price .was {
  margin-left: 0.25rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: line-through;
}

.match-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 3.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-foreground);
  font-size: 0.7rem;
}

.product-thumb {
  width: 3rem;
  height: 3rem;
  max-width: 3rem;
  max-height: 3rem;
  flex: none;
  border-width: 1px;
  border-radius: var(--radius-md);
  background-color: var(--surface);
  object-fit: contain;
  padding: 0.25rem;
}

/* ==========================================================================
   Stat cards
   ========================================================================== */

.stat-value {
  margin-top: 0.4rem;
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-grid .card {
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.35rem 1.4rem;
}

.stat-grid .card > .btn {
  margin-top: auto;
}

.stat-grid {
  display: grid;
  gap: 1rem;
}

/* ==========================================================================
   Landing page
   ========================================================================== */

.landing-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom-width: 1px;
  background-color: rgba(247, 248, 250, 0.92);
  backdrop-filter: blur(8px);
}

.landing-header .container {
  display: flex;
  height: 3.5rem;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.landing-header .logo {
  min-width: 0;
}

.landing-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.landing-nav a:hover {
  color: var(--foreground);
}

.hero {
  padding-block: 2.5rem 2rem;
  text-align: center;
}

.hero h1 {
  max-width: 48rem;
  margin-inline: auto;
}

.hero p {
  max-width: 42rem;
  margin-inline: auto;
}

.hero-badge {
  white-space: normal;
  max-width: 100%;
  height: auto;
  line-height: 1.35;
  text-wrap: balance;
}

.landing-cta-short {
  display: inline;
}

.landing-cta-full {
  display: none;
}

.landing-actions {
  gap: 0.4rem;
  flex-shrink: 0;
}

.cta-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
}

.cta-row .btn {
  width: 100%;
  height: auto;
  min-height: 2.75rem;
  padding-block: 0.7rem;
  white-space: normal;
}

.capacity-banner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 56rem;
  margin-inline: auto;
  padding: 1rem;
  border-width: 1px;
  border-radius: 1rem;
  background-color: var(--card);
  text-align: left;
  box-shadow: var(--shadow-card);
}

.capacity-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.capacity-title {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-transform: uppercase;
  text-wrap: balance;
}

.capacity-dot {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: var(--destructive);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--destructive) 18%, transparent);
}

.capacity-sub {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.45;
}

.capacity-meter {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
}

.capacity-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.capacity-track {
  margin-top: 0.5rem;
  height: 0.375rem;
  overflow: hidden;
  border-radius: 9999px;
  background-color: var(--muted);
}

.capacity-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background-color: var(--destructive);
}

.browser {
  overflow: hidden;
  border-width: 1px;
  border-radius: var(--radius-xl);
  background-color: var(--card);
  box-shadow: var(--shadow-lift);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-bottom-width: 1px;
  background-color: var(--surface);
  padding: 0.625rem 0.75rem;
  min-width: 0;
}

.browser-bar .text-xs {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-bar .dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
}

.browser-stats {
  display: grid;
  gap: 1px;
  background-color: var(--border);
}

.browser-stats > div {
  background-color: var(--card);
  padding: 1rem 1.15rem;
  text-align: left;
}

.section {
  padding-block: 2.75rem;
}

.section-surface {
  border-block-width: 1px;
  background-color: var(--surface);
  padding-block: 2.75rem;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  background-color: var(--brand-soft);
  color: var(--primary);
}

.price {
  font-size: clamp(1.5rem, 7vw, 1.875rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.price span {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted-foreground);
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.check-list li {
  display: flex;
  gap: 0.5rem;
}

.check-list .icon {
  margin-top: 0.125rem;
  color: var(--success);
}

.landing-footer {
  border-top-width: 1px;
  padding-block: 1.5rem;
}

.landing-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ==========================================================================
   Auth / onboarding
   ========================================================================== */

.auth {
  display: grid;
  min-height: 100vh;
}

.auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.auth-form > div {
  width: 100%;
  max-width: 24rem;
  margin-inline: auto;
}

.auth-aside {
  display: none;
  flex-direction: column;
  justify-content: center;
  border-left-width: 1px;
  background-color: var(--surface);
  padding-inline: 4rem;
}

.auth-aside blockquote {
  max-width: 28rem;
  font-size: 1.25rem;
  line-height: 1.7;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-block: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.onboarding-header {
  border-bottom-width: 1px;
  background-color: var(--background);
}

.onboarding-header .container-narrow {
  display: flex;
  height: 4rem;
  align-items: center;
}

.store-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.15s;
}

.store-row:hover {
  background-color: var(--surface);
}

/* ==========================================================================
   Charts
   ========================================================================== */

.chart {
  position: relative;
  width: 100%;
}

.history-chart {
  min-height: 18rem;
}

.chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid line {
  stroke: var(--border);
  stroke-dasharray: 3 3;
}

.chart-axis text {
  font-size: 12px;
  fill: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.chart-legend i {
  width: 0.875rem;
  height: 0;
  border-top: 2px solid currentColor;
}

.chart-tooltip {
  position: absolute;
  z-index: 10;
  min-width: 9rem;
  border-width: 1px;
  border-radius: 8px;
  background-color: var(--popover);
  padding: 0.5rem 0.625rem;
  font-size: 12px;
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  transform: translate(-50%, -100%);
  transition: opacity 0.1s;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-tooltip dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.125rem 0.75rem;
  margin-top: 0.25rem;
}

.chart-tooltip dd {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 379px) {
  .landing-signin {
    display: none;
  }
}

@media (min-width: 640px) {
  .container {
    padding-inline: 1.5rem;
  }

  .landing-header .container {
    height: 4rem;
    gap: 1.5rem;
  }

  .card-pad-lg {
    padding: 1.5rem;
  }

  .auth-form {
    padding-inline: 4rem;
  }

  .sm-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sm-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    padding-block: 4rem 3.5rem;
  }

  .hero-badge {
    white-space: nowrap;
  }

  .landing-cta-short {
    display: none;
  }

  .landing-cta-full {
    display: inline;
  }

  .cta-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .cta-row .btn {
    width: auto;
    height: 2.75rem;
    padding-block: 0;
    white-space: nowrap;
  }

  .capacity-banner {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
  }

  .capacity-copy {
    flex: 1 1 16rem;
  }

  .capacity-title {
    align-items: center;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
  }

  .capacity-meter {
    flex: 1 1 14rem;
    max-width: 22rem;
  }

  .capacity-meta {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
  }

  .section,
  .section-surface {
    padding-block: 4rem;
  }

  .browser-stats > div {
    padding: 1.5rem;
  }
}

@media (min-width: 768px) {
  .landing-nav,
  .topbar-search {
    display: flex;
  }

  .hero {
    padding-block: 5rem 4rem;
  }

  .hero h1 {
    font-size: 3.75rem;
  }

  .section,
  .section-surface {
    padding-block: 5rem;
  }

  .md-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .sidebar,
  .auth-aside {
    display: flex;
  }

  .mobile-logo {
    display: none;
  }

  .topbar {
    padding-inline: 2rem;
  }

  .content {
    padding: 2rem;
  }

  .auth,
  .lg-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lg-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lg-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .lg-cols-sidebar {
    grid-template-columns: 20rem minmax(0, 1fr);
  }

  .lg-span-2 {
    grid-column: span 2;
  }
}

@media (min-width: 1280px) {
  .xl-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Store page — phone first, desktop in the app shell */
@media (max-width: 1023px) {
  .app.is-instore .sidebar,
  .app.is-instore .topbar {
    display: none;
  }

  .app.is-instore .content {
    padding: calc(0.75rem + env(safe-area-inset-top)) 1rem calc(1.5rem + env(safe-area-inset-bottom));
  }
}

.store-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.store-back,
.store-maps {
  flex: 0 0 auto;
  padding-top: 0.2rem;
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: none;
}

.store-head-main {
  flex: 1;
  min-width: 0;
}

.store-name {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 650;
}

.store-aside-copy {
  display: none;
}

.store-scan-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 3.15rem;
  margin-top: 1rem;
  border: 0;
  border-radius: 0.85rem;
  background: var(--primary);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
}

.store-result {
  margin-top: 0.85rem;
}

.store-list {
  margin-top: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--card, var(--background));
}

.product-row.is-result {
  border-color: var(--primary);
}

.product-row-main {
  display: flex;
  gap: 0.75rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.product-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted-foreground);
  font-weight: 650;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-copy {
  min-width: 0;
  flex: 1;
}

.product-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.product-row-actions {
  display: flex;
  gap: 0.5rem;
}

.product-row-actions .btn,
.product-row-actions form {
  flex: 1;
}

.product-row-actions form .btn {
  width: 100%;
}

.store-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.25rem;
}

.store-pager a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.scan-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
}

.scan-sheet[hidden] {
  display: none;
}

.scan-video,
#html5-qr-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

#html5-qr-live video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-overlay-ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.scan-close {
  pointer-events: auto;
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top));
  left: 1rem;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-weight: 600;
}

.scan-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(78vw, 22rem);
  height: 7.5rem;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 0.75rem;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
}

.scan-hint {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 0.95rem;
}

.scan-fallback {
  pointer-events: auto;
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: calc(4.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  .store-page {
    max-width: 68rem;
  }

  .store-head {
    align-items: center;
    margin-bottom: 0.25rem;
  }

  .store-name {
    font-size: 1.6rem;
  }

  .store-back {
    display: none;
  }

  .store-desk {
    display: grid;
    grid-template-columns: 20rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.25rem;
  }

  .store-aside {
    position: sticky;
    top: 1.25rem;
    padding: 1.15rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--card);
    box-shadow: var(--shadow-card);
  }

  .store-scan-btn {
    margin-top: 0;
  }

  .store-aside-copy {
    display: block;
    margin-top: 0.7rem;
    font-size: 0.82rem;
    color: var(--muted-foreground);
  }

  .store-list {
    margin-top: 0;
    gap: 0.55rem;
  }

  .product-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
  }

  .product-row-main {
    flex: 1;
    min-width: 0;
  }

  .product-row-actions {
    flex: 0 0 auto;
    width: 11.5rem;
  }

  .product-title {
    -webkit-line-clamp: 1;
  }

  .scan-sheet {
    background: oklch(0.2 0.02 258 / 0.55);
  }

  .scan-video,
  #html5-qr-live {
    inset: auto;
    top: 50%;
    left: 50%;
    width: min(28rem, 92vw);
    height: min(34rem, 80vh);
    transform: translate(-50%, -50%);
    border-radius: 1rem;
    overflow: hidden;
  }

  .scan-reticle {
    width: 16rem;
  }

  .scan-close {
    top: calc(50% - min(17rem, 40vh) - 2.4rem);
    left: 50%;
    transform: translateX(-50%);
  }

  .scan-hint,
  .scan-fallback {
    left: 50%;
    right: auto;
    width: min(28rem, 92vw);
    transform: translateX(-50%);
  }

  .scan-hint {
    bottom: calc(50% - min(17rem, 40vh) - 2.1rem);
    color: #fff;
    text-shadow: 0 1px 8px #000;
  }

  .scan-fallback {
    bottom: calc(50% - min(12rem, 28vh));
  }
}

/* Theme — product research / in-store */
.intel-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.intel-search .input,
.intel-search .select-native {
  flex: 1 1 12rem;
  min-width: 0;
}

.pill-row,
.scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--foreground);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
}

.pill.is-active,
.pill:hover {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.intel-stat {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  color: inherit;
  text-decoration: none;
}

.intel-stat.is-active {
  background: #eef4ff;
  border-color: #d5e2fb;
}

.lead-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.lead-card,
.research-hero,
.scan-store {
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.lead-card {
  padding: 1rem;
}

.lead-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.lead-card-top,
.research-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.lead-copy,
.research-head-copy {
  min-width: 0;
  flex: 1;
}

.lead-title {
  margin: 0;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #fff;
}

.lead-thumb.is-sm {
  flex-basis: 40px;
  width: 40px;
  height: 40px;
}

.lead-thumb.is-lg {
  flex-basis: 72px;
  width: 72px;
  height: 72px;
}

.lead-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lead-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.research-hero .lead-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-metrics .eyebrow {
  margin-bottom: 0.2rem;
}

.lead-foot {
  margin-top: 0.75rem;
}

.lead-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.verdict {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
}

.verdict-buy {
  background: #e6f6ec;
  color: #17803d;
}

.verdict-investigate {
  background: #fbf3d6;
  color: #9a7408;
}

.verdict-skip {
  background: #fdecec;
  color: #b42318;
}

.verdict-buy::before,
.verdict-investigate::before,
.verdict-skip::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
}

.scan-page,
.research,
.intel {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

.opp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.store-pick {
  position: relative;
}

.store-pick > summary {
  list-style: none;
  min-width: 10rem;
}

.store-pick > summary::-webkit-details-marker {
  display: none;
}

.store-pick-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 30;
  width: min(22rem, 88vw);
  max-height: 22rem;
  overflow: auto;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--shadow-lift);
}

.store-pick-presets {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.store-pick-presets a {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.78rem;
  text-decoration: none;
}

.store-pick-presets a.is-active,
.store-pick-presets a:hover {
  background: #111827;
  color: #fff;
}

.store-pick-list {
  display: flex;
  flex-direction: column;
}

.store-pick-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.45rem 0.2rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.store-pick-list label + label {
  border-top: 1px solid #f0f1f4;
}

.store-pick-list input {
  margin-top: 0.2rem;
}

.opp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 1.6rem;
}

.opp-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: #98a2b3;
}

.opp-sort a {
  color: #667085;
  text-decoration: none;
}

.opp-sort a.is-active,
.opp-sort a:hover {
  color: #111827;
  font-weight: 650;
}

.opp-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.15rem 1.2rem 1rem;
}

.opp-card .lead-metrics .tabular {
  font-size: 1.05rem;
  font-weight: 650;
}

.opp-card .verdict {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.opp-spark {
  margin-top: 1rem;
}

.opp-spark svg {
  display: block;
  width: 100%;
  height: 7rem;
  margin-top: 0.35rem;
}

.opp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  margin-top: 0.85rem;
}

.opp-meta span + span::before {
  content: "· ";
  color: #d0d5dd;
}

.lead-grid.is-research {
  align-items: stretch;
}

.lead-grid.is-research > .card {
  grid-column: 1 / -1;
}

.scan-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 11rem;
  margin-top: 1.15rem;
  border: 0;
  border-radius: 1rem;
  background: #111827;
  color: #fff;
  cursor: pointer;
}

.scan-hero span {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scan-hero small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.scan-type-box {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.scan-hits {
  display: flex;
  flex-direction: column;
}

.scan-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
}

.scan-hit-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.research-dl {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.research-dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.research-dl dt {
  color: var(--muted-foreground);
}

.research-dl dd {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.research-checks {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.research-checks li::before {
  content: "✓ ";
  color: var(--success);
}

.research-buy {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.1rem 1.2rem;
  border-radius: 1rem;
  background: #e8f8ee;
}

@media (min-width: 768px) {
  .lead-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-hero .lead-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .lead-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dash-hello {
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.dash-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.15rem;
  padding: 0.55rem;
  border: 1px solid #eceef2;
  border-radius: 999px;
  background: #fff;
}

.dash-search .input {
  flex: 1 1 14rem;
  border: 0;
  background: transparent;
  min-width: 0;
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}

.brief-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding: 1.35rem 1.5rem;
  border-radius: 1.15rem;
  background: #111827;
  color: #fff;
  text-decoration: none;
}

.brief-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86efac;
}

.brief-title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-weight: 650;
}

.brief-sub {
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.brief-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 2.4rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: #22c55e;
  color: #052e16;
  font-weight: 700;
  font-size: 0.875rem;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.15rem;
}

.dash-kpi {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid #eceef2;
  border-radius: 1rem;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.dash-kpi-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.dash-kpi-value {
  margin-top: 0.35rem;
  font-size: 1.55rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.dash-kpi-note {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.dash-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
  align-items: start;
}

.dash-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.line-list {
  display: flex;
  flex-direction: column;
}

.line-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid #f0f1f4;
  color: inherit;
  text-decoration: none;
}

.line-copy {
  min-width: 0;
  flex: 1;
}

.line-copy .medium {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-money {
  text-align: right;
  flex: 0 0 auto;
}

.line-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #111827;
}

.jump-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.jump-card {
  display: block;
  padding: 0.9rem;
  border: 1px solid #eceef2;
  border-radius: 0.9rem;
  background: #f8f9fb;
  color: inherit;
  text-decoration: none;
}

@media (min-width: 900px) {
  .dash-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dash-split {
    grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.9fr);
  }
}
