/* ============================================================
   Design tokens — calm, professional, Linear/Vercel/Stripe vibe
   Light first; dark via [data-theme="dark"]
   ============================================================ */

:root {
  /* Surfaces — warm Claude palette, cream over white */
  --bg: #f4f3ee;
  /* warm_light */
  --bg-elevated: #ffffff;
  /* white */
  --bg-card: #ffffff;
  --bg-sunken: oklch(0.94 0.008 75);
  --bg-hover: oklch(0.93 0.01 70);
  --bg-active: oklch(0.9 0.012 65);

  /* Borders */
  --border: oklch(0.88 0.008 65);
  --border-strong: oklch(0.78 0.01 60);
  /* warm_gray family */
  --border-subtle: oklch(0.92 0.006 70);

  /* Text — warm dark, never pure black */
  --text-primary: oklch(0.27 0.014 45);
  --text-secondary: oklch(0.47 0.012 50);
  --text-tertiary: oklch(0.6 0.01 55);
  --text-quaternary: oklch(0.72 0.008 60);
  --text-inverse: oklch(0.98 0.005 60);

  /* Accent — Claude orange #c15f3c */
  --accent: oklch(0.585 0.122 38);
  --accent-hover: oklch(0.52 0.13 38);
  --accent-active: oklch(0.48 0.13 38);
  --accent-text: #ffffff;
  --accent-subtle: oklch(0.95 0.03 50);
  --accent-subtle-hover: oklch(0.93 0.04 48);
  --accent-border: oklch(0.85 0.06 45);
  --accent-soft-text: oklch(0.48 0.12 38);

  /* Status colors — tuned to harmonize with warm orange */
  --success: oklch(0.58 0.09 155);
  --success-subtle: oklch(0.95 0.025 145);
  --success-text: oklch(0.42 0.08 155);
  --success-border: oklch(0.86 0.04 150);

  --warning: oklch(0.7 0.13 85);
  --warning-subtle: oklch(0.96 0.04 85);
  --warning-text: oklch(0.5 0.11 75);
  --warning-border: oklch(0.88 0.06 85);

  --danger: oklch(0.52 0.16 18);
  --danger-subtle: oklch(0.96 0.025 25);
  --danger-text: oklch(0.45 0.14 22);
  --danger-border: oklch(0.86 0.05 22);

  /* Neutral pill (gray) */
  --neutral-subtle: oklch(0.94 0.006 65);
  --neutral-text: oklch(0.46 0.01 55);
  --neutral-border: oklch(0.86 0.008 65);

  /* Reddit orange — slightly distinct from accent so source labels read */
  --reddit: oklch(0.66 0.18 42);

  /* Shadows — warm-toned, never gray */
  --shadow-xs: 0 1px 2px oklch(0.3 0.04 45 / 0.05);
  --shadow-sm: 0 1px 3px oklch(0.3 0.04 45 / 0.06), 0 1px 2px oklch(0.3 0.04 45 / 0.04);
  --shadow-md: 0 4px 12px oklch(0.3 0.04 45 / 0.08), 0 1px 3px oklch(0.3 0.04 45 / 0.05);
  --shadow-lg: 0 12px 32px oklch(0.3 0.04 45 / 0.12), 0 4px 12px oklch(0.3 0.04 45 / 0.06);
  --shadow-focus: 0 0 0 3px oklch(0.585 0.122 38 / 0.2);

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-2xl: 18px;
  --r-full: 999px;

  /* Spacing scale (use direct px in code, this is for reference) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 56px;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: oklch(0.16 0.005 50);
  --bg-elevated: oklch(0.2 0.006 50);
  --bg-card: oklch(0.205 0.006 50);
  --bg-sunken: oklch(0.14 0.005 50);
  --bg-hover: oklch(0.235 0.007 50);
  --bg-active: oklch(0.27 0.008 50);

  --border: oklch(0.27 0.008 50);
  --border-strong: oklch(0.34 0.009 50);
  --border-subtle: oklch(0.24 0.007 50);

  --text-primary: oklch(0.96 0.003 50);
  --text-secondary: oklch(0.72 0.005 50);
  --text-tertiary: oklch(0.58 0.006 50);
  --text-quaternary: oklch(0.45 0.006 50);
  --text-inverse: oklch(0.18 0.005 50);

  --accent: oklch(0.72 0.13 38);
  --accent-hover: oklch(0.78 0.13 38);
  --accent-active: oklch(0.68 0.13 38);
  --accent-text: oklch(0.18 0.02 38);
  --accent-subtle: oklch(0.28 0.05 38);
  --accent-subtle-hover: oklch(0.32 0.06 38);
  --accent-border: oklch(0.38 0.07 38);
  --accent-soft-text: oklch(0.84 0.11 38);

  --success: oklch(0.7 0.11 165);
  --success-subtle: oklch(0.26 0.04 165);
  --success-text: oklch(0.82 0.1 165);
  --success-border: oklch(0.34 0.05 165);

  --warning: oklch(0.78 0.13 75);
  --warning-subtle: oklch(0.28 0.05 75);
  --warning-text: oklch(0.86 0.12 75);
  --warning-border: oklch(0.4 0.07 75);

  --danger: oklch(0.7 0.15 25);
  --danger-subtle: oklch(0.28 0.05 25);
  --danger-text: oklch(0.82 0.13 25);
  --danger-border: oklch(0.38 0.08 25);

  --neutral-subtle: oklch(0.24 0.005 50);
  --neutral-text: oklch(0.72 0.005 50);
  --neutral-border: oklch(0.32 0.006 50);

  --shadow-xs: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.3), 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35), 0 1px 3px oklch(0 0 0 / 0.2);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4), 0 4px 12px oklch(0 0 0 / 0.25);
  --shadow-focus: 0 0 0 3px oklch(0.72 0.13 38 / 0.3);
}

/* ============================================================
     Reset & base
     ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.005em;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: oklch(0.585 0.122 38 / 0.25);
}

/* Hide scrollbars but keep scroll */
.scroll {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scroll::-webkit-scrollbar-track {
  background: transparent;
}

.scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.scroll::-webkit-scrollbar-thumb:hover {
  background: var(--text-quaternary);
}

/* ============================================================
     App layout
     ============================================================ */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
  background: var(--bg);
}

.main-col {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  min-width: 0;
  position: relative;
  /* Clip the off-screen .detail-panel (translateX(100%)) — without this it
       sits outside the viewport but still adds a horizontal scrollbar, so the
       "closed" panel becomes visible by scrolling right. */
  overflow: hidden;
}

.main-content {
  overflow-y: auto;
  min-height: 0;
  position: relative;
}

/* ============================================================
     Sidebar
     ============================================================ */

.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 8px;
  min-width: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
  margin-bottom: 8px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--accent-text);
  font-weight: 700;
  font-size: 13px;
}

.logo-name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-quaternary);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
  position: relative;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item[aria-current="page"] {
  background: var(--bg-active);
  color: var(--text-primary);
}

.nav-item[aria-current="page"] .nav-icon {
  color: var(--accent);
}

.nav-icon {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--bg-active);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}

.nav-item[aria-current="page"] .nav-badge {
  background: var(--accent-subtle);
  color: var(--accent-soft-text);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-md);
}

.user-card:hover {
  background: var(--bg-hover);
  cursor: pointer;
}

.user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 4px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, oklch(0.7 0.08 268), oklch(0.55 0.12 268));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 10.5px;
  color: var(--text-tertiary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
     Topbar
     ============================================================ */

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.profile-selector-wrap {
  position: relative;
}

.profile-selector-wrap.is-open {
  z-index: 91;
}

.profile-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms var(--ease);
  position: relative;
  min-width: 0;
}

.profile-selector:hover {
  background: var(--bg-hover);
}

.profile-mark {
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 10.5px;
  color: white;
  flex-shrink: 0;
}

.profile-mark-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
  background: var(--bg-card);
}

.profile-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.topbar-spacer {
  flex: 1;
}

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

@media (max-width: 640px) {
  .topbar {
    padding: 0 14px;
    gap: 8px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .scan-summary-mini {
    display: none;
  }

  .profile-name {
    max-width: 120px;
  }
}

/* ============================================================
     Buttons
     ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease), transform 120ms var(--ease);
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.16), var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary:active {
  background: var(--accent-active);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--r-md);
}

.btn-sm {
  padding: 4px 9px;
  font-size: 12.5px;
  gap: 5px;
}

.btn-lg {
  padding: 9px 16px;
  font-size: 14px;
}

/* ============================================================
     Pills / badges
     ============================================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill-neutral {
  background: var(--neutral-subtle);
  color: var(--neutral-text);
  border-color: var(--neutral-border);
}

.pill-accent {
  background: var(--accent-subtle);
  color: var(--accent-soft-text);
  border-color: var(--accent-border);
}

.pill-success {
  background: var(--success-subtle);
  color: var(--success-text);
  border-color: var(--success-border);
}

.pill-warning {
  background: var(--warning-subtle);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.pill-danger {
  background: var(--danger-subtle);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* ============================================================
     Cards
     ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-body {
  padding: 18px;
}

/* ============================================================
     Page chrome
     ============================================================ */

.page {
  padding: 28px 32px 80px;
  max-width: 1180px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 4px 0 0;
  line-height: 1.5;
}

/* ============================================================
     Summary cards (stat tiles)
     ============================================================ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-delta-up {
  color: var(--success-text);
}

.stat-delta-down {
  color: var(--danger-text);
}

/* ============================================================
     Filter bar (opportunities)
     ============================================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-sunken);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  min-width: 220px;
  flex: 1;
  max-width: 380px;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}

.search-input:focus-within {
  background: var(--bg-elevated);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-focus);
}

.search-input input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 13px;
  min-width: 0;
}

.search-input svg {
  color: var(--text-tertiary);
}

.search-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease), border-color 120ms var(--ease);
}

.search-filter-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.search-filter-btn.is-active {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-soft-text);
}

.chip-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
  position: relative;
}

.chip-select:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chip-select-label {
  color: var(--text-tertiary);
  margin-right: 2px;
  font-weight: 400;
}

.chip-select-value {
  font-weight: 500;
}

.chip-select.is-active {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
  color: var(--accent-soft-text);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  min-width: 180px;
  z-index: 50;
  animation: pop-in 140ms var(--ease-out);
}

.dropdown-menu .item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
}

.dropdown-menu .item:hover {
  background: var(--bg-hover);
}

.dropdown-menu .item .check {
  width: 14px;
  color: var(--accent);
}

.dropdown-menu .item.is-selected {
  font-weight: 500;
}

.dropdown-menu .sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 2px;
}

.search-filter-menu {
  right: 0;
  left: auto;
  min-width: 164px;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================
     Opportunity card (feed)
     ============================================================ */

/* ---------- Opportunity row — editorial list, matches Today's Brief ---------- */
.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: opp-row;
}

/* Standalone editorial card (used in opportunities feed) */
.opp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px 18px;
  cursor: pointer;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), box-shadow 140ms var(--ease), transform 140ms var(--ease);
  position: relative;
  box-shadow: var(--shadow-xs);
}
.opp-card:hover {
  background: var(--bg-sunken);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.opp-card.is-selected {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border), var(--shadow-sm);
}
.opp-card.is-dimmed { opacity: 0.55; }

.opp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.opp-sub {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.opp-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-quaternary);
}

.opp-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.opp-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.012em;
  line-height: 1.4;
  margin: 0 0 8px;
  text-wrap: pretty;
}

.opp-why {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 12px;
  text-wrap: pretty;
}

.opp-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.opp-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.opp-footer-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-right: auto;
  flex-wrap: wrap;
}
.opp-footer-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Density variants for the standalone card */
.feed.density-spacious .opp-card { padding: 20px 22px; }
.feed.density-spacious .opp-title { font-size: 16px; }
.feed.density-compact .opp-card { padding: 12px 14px; }
.feed.density-compact .opp-title { font-size: 14px; margin-bottom: 6px; }
.feed.density-compact .opp-why {
  font-size: 12.5px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed.density-compact .opp-tags { margin-bottom: 8px; }
.feed.density-compact .opp-footer { padding-top: 8px; }

/* Legacy editorial row layout (still used by FeedSkeleton) */
.opp-row {
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  gap: 14px;
  align-items: start;
  padding: 14px 8px;
  margin: 0 -8px;
  border-top: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  cursor: pointer;
  background: transparent;
  transition: background 140ms var(--ease);
  position: relative;
  counter-increment: opp-row;
}

.feed > .opp-row:first-child {
  border-top: 0;
}

.opp-row:hover {
  background: var(--bg-sunken);
}

.opp-row:hover .opp-row-arrow svg {
  transform: translate(2px, -2px);
  color: var(--accent);
}

.opp-row.is-selected {
  background: var(--accent-subtle);
}

.opp-row.is-dimmed {
  opacity: 0.55;
}

.opp-row-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-quaternary);
  letter-spacing: 0.04em;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

.opp-row-num::before {
  content: counter(opp-row, decimal-leading-zero);
}

.opp-row-body {
  min-width: 0;
}

.opp-row-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}

.opp-row-kicker>* {
  white-space: nowrap;
}

.opp-row-tag {
  font-weight: 600;
  letter-spacing: 0.08em;
}

.opp-row-tag.tier-high {
  color: var(--success-text);
}

.opp-row-tag.tier-med {
  color: var(--warning-text);
}

.opp-row-tag.tier-low {
  color: var(--text-tertiary);
}

.opp-row-tag.tier-new {
  color: var(--accent-soft-text);
}

.opp-row-sub {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.opp-row-sep {
  color: var(--text-quaternary);
}

.opp-row-ago {
  color: var(--text-tertiary);
}

.opp-row-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.012em;
  line-height: 1.4;
  text-wrap: pretty;
  margin: 0 0 6px;
}

.opp-row-reason-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 10px;
  margin: 0 0 8px;
  border-radius: var(--r-full);
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.opp-row-reason-pill svg {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.opp-row-reason-pill span {
  min-width: 0;
  text-wrap: pretty;
}

.opp-row-foot {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.opp-row-foot-sep {
  color: var(--text-quaternary);
}

.opp-row-arrow {
  padding-top: 4px;
  color: var(--text-quaternary);
}

.opp-row-arrow svg {
  transition: transform 180ms var(--ease-out), color 180ms var(--ease);
}

/* Score block: % + tier pill (still used in detail panel / dashboard pills) */
.score-block {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.score-pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Density variants — adjust row padding + title size */
.feed.density-spacious .opp-row {
  padding-top: 18px;
  padding-bottom: 18px;
}

.feed.density-spacious .opp-row-title {
  font-size: 16px;
}

.feed.density-compact .opp-row {
  padding-top: 10px;
  padding-bottom: 10px;
}

.feed.density-compact .opp-row-title {
  font-size: 14px;
  margin-bottom: 4px;
}

.feed.density-compact .opp-row-kicker {
  margin-bottom: 3px;
}

@media (max-width: 720px) {
  .feed {
    padding: 6px 12px 10px;
  }

  .opp-row {
    grid-template-columns: 30px 1fr 20px;
    gap: 10px;
  }

  .opp-row-kicker {
    font-size: 10.5px;
    gap: 6px;
  }

  .opp-row-title {
    font-size: 14px;
  }
}

/* New indicator */
.opp-new-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  flex-shrink: 0;
}

.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: background 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease-out);
}

.feedback-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.feedback-btn.is-active.positive {
  background: var(--success-subtle);
  color: var(--success-text);
  border-color: var(--success-border);
}

.feedback-btn.is-active.negative {
  background: var(--danger-subtle);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.feedback-btn.feedback-pop {
  animation: feedback-pop 360ms var(--ease-out);
}

@keyframes feedback-pop {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

/* ============================================================
     Forms
     ============================================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label .optional {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-quaternary);
}

.field-help {
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin: 0;
}

.input,
.textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
  font-family: inherit;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-quaternary);
}

.input:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}

.field-error-text {
  font-size: 12px;
  color: var(--danger-text);
  margin-top: 2px;
}

.input.has-error,
.textarea.has-error {
  border-color: var(--danger);
}

.input.has-error:focus,
.textarea.has-error:focus {
  box-shadow: 0 0 0 3px oklch(0.58 0.16 25 / 0.15);
}

/* Tag input */
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 8px;
  min-height: 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  align-items: center;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}

.tag-input:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.tag-input input {
  flex: 1;
  min-width: 100px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  padding: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 4px 3px 9px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.tag .x {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  border-radius: var(--r-xs);
  cursor: pointer;
}

.tag .x:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}

.tag.tag-accent {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-soft-text);
}

/* Toggle / switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background 160ms var(--ease);
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 160ms var(--ease);
  box-shadow: var(--shadow-xs);
}

.switch input:checked+.switch-slider {
  background: var(--accent);
}

.switch input:checked+.switch-slider::before {
  transform: translateX(16px);
}

.switch input:focus-visible+.switch-slider {
  box-shadow: var(--shadow-focus);
}

/* Range slider */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  outline: none;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: white;
  border: 2px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: white;
  border: 2px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

/* ============================================================
     Onboarding scaffold
     ============================================================ */

.onboard-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow-x: clip;
  max-width: 100%;
}

.onboard-topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.onboard-stepper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong);
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
}

.step-dot.is-done {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-soft-text);
}

.step-dot.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.step-line {
  width: 26px;
  height: 1px;
  background: var(--border-strong);
}

.onboard-body {
  flex: 1;
  overflow-x: clip;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 36px 32px 80px;
  max-width: 100%;
}

.onboard-body.is-welcome {
  padding: 0;
}

.onboard-panel {
  width: 100%;
  max-width: 680px;
}

.onboard-header {
  margin-bottom: 28px;
}

.onboard-eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-soft-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.onboard-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0 0 8px;
  text-wrap: balance;
}

.onboard-subtitle {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.55;
  max-width: 520px;
}

.onboard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.onboard-actions .spacer {
  flex: 1;
}

.onboard-actions .small-note {
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* ============================================================
     Welcome / empty state
     ============================================================ */

.welcome {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  background:
    radial-gradient(ellipse 600px 360px at 50% 5%, var(--accent-subtle) 0%, transparent 70%),
    var(--bg);
}

.welcome-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  display: grid;
  place-items: center;
  color: var(--accent-text);
  margin-bottom: 22px;
  box-shadow: 0 8px 24px oklch(0.52 0.14 268 / 0.18), inset 0 1px 0 oklch(1 0 0 / 0.18);
}

.welcome h1 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 12px;
  max-width: 700px;
  text-wrap: balance;
  line-height: 1.15;
}

.welcome p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 0 28px;
  line-height: 1.6;
  text-wrap: pretty;
}

.welcome-ctas {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.welcome-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin-bottom: 56px;
  padding: 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
}

.welcome-trust svg {
  color: var(--success);
}

.welcome-preview {
  width: 100%;
  max-width: 560px;
  position: relative;
  pointer-events: none;
}

.welcome-preview .label {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-quaternary);
  margin-bottom: 10px;
  text-align: left;
}

/* ============================================================
     Detail panel (slide-in)
     ============================================================ */

.detail-overlay {
  position: absolute;
  inset: 0;
  background: oklch(0 0 0 / 0.32);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}

.detail-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.profile-creator-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.18 0.01 260 / 0.42);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  z-index: 80;
}

.profile-creator-shell {
  position: fixed;
  inset: 28px;
  z-index: 90;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-creator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-card) 88%, transparent);
}

.profile-creator-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.profile-creator-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.profile-creator-body {
  flex: 1;
  overflow: auto;
  padding: 8px;
}

.profile-creator-flow {
  min-height: 100%;
}

.profile-creator-flow-setup {
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-creator-flow>.screen-enter {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.profile-creator-flow-setup>.screen-enter {
  justify-content: center;
}

.profile-creator-flow-setup>.screen-enter>.ob2-describe {
  width: min(100%, 760px);
}

@media (max-width: 720px) {
  .profile-creator-flow-setup {
    align-items: flex-start;
  }

  .profile-creator-flow-setup>.screen-enter {
    justify-content: flex-start;
    min-height: auto;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .profile-creator-flow-setup>.screen-enter>.ob2-describe {
    margin-top: 0;
    padding-left: 16px;
    padding-right: 16px;
  }
}

.profile-creator-flow-map {
  padding: 12px 0 24px;
}

.profile-creator-flow-map>.screen-enter>.ob2-radar {
  width: min(100%, 920px);
  margin-top: 0;
  margin-bottom: 0;
}

.profile-creator-status {
  width: min(calc(100% - 40px), 920px);
  margin: 12px auto 0;
  border-radius: 10px;
  font-size: 13px;
}

.profile-creator-status-error {
  padding: 10px 12px;
  border: 1px solid var(--danger-border);
  background: var(--danger-subtle);
  color: var(--danger-text);
}

.profile-creator-status-pending {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .profile-creator-shell {
    inset: 12px;
    border-radius: 18px;
  }

  .profile-creator-header {
    padding: 14px 16px;
  }
}

.detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(560px, 88%);
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 70;
  transform: translateX(100%);
  transition: transform 280ms var(--ease-out);
  display: flex;
  flex-direction: column;
}

.detail-panel.is-open {
  transform: translateX(0);
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 22px 28px;
}

.detail-section {
  margin-bottom: 22px;
}

.detail-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.detail-section h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0 0 6px;
  line-height: 1.35;
  text-wrap: pretty;
}

.thread-excerpt {
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  position: relative;
}

.thread-excerpt .quote-mark {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 28px;
  color: var(--border-strong);
  line-height: 1;
  font-family: serif;
  pointer-events: none;
}

.warning-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.warning-item {
  display: flex;
  gap: 8px;
  padding: 9px 12px;
  background: var(--warning-subtle);
  border: 1px solid var(--warning-border);
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--warning-text);
  line-height: 1.5;
}

.warning-item svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.detail-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: var(--bg);
}

/* ============================================================
     Notifications / settings rows
     ============================================================ */

.settings-section {
  margin-bottom: 28px;
}

.settings-section-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.settings-section-desc {
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin: 0 0 12px;
  line-height: 1.5;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.row:last-child {
  border-bottom: none;
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.row-desc {
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.5;
}

/* ============================================================
     Scans table
     ============================================================ */

.scan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.scan-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scan-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.scan-table tr:last-child td {
  border-bottom: none;
}

.scan-table tr:hover td {
  background: var(--bg-hover);
}

.scan-table .num {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ============================================================
     Empty/loading/error states
     ============================================================ */

.skel {
  background: linear-gradient(90deg,
      var(--bg-sunken) 0%,
      var(--bg-hover) 50%,
      var(--bg-sunken) 100%);
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: skel-shimmer 1.4s infinite linear;
}

@keyframes skel-shimmer {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

.empty-state,
.error-state {
  text-align: center;
  padding: 48px 32px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-xl);
  background: var(--bg-card);
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  margin: 0 auto 14px;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  max-width: 380px;
  margin: 0 auto 16px;
  line-height: 1.6;
}

.error-state .empty-icon {
  background: var(--danger-subtle);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

/* ============================================================
     Toasts
     ============================================================ */

.toast-stack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 10px 14px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text-primary);
  animation: toast-in 220ms var(--ease-out);
  pointer-events: auto;
}

.toast-text {
  flex: 1;
  min-width: 0;
}

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.toast-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toast.is-leaving {
  animation: toast-out 200ms var(--ease) forwards;
}

.toast .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ============================================================
     Mobile preview section
     ============================================================ */

.mobile-stage {
  padding: 28px 32px 80px;
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  justify-content: center;
  background:
    radial-gradient(ellipse 700px 400px at 50% 0%, var(--accent-subtle) 0%, transparent 70%),
    var(--bg);
}

.mobile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mobile-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============================================================
     Map review checklist boxes
     ============================================================ */

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.map-grid .card-full {
  grid-column: 1 / -1;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* ============================================================
     Profile selector dropdown
     ============================================================ */

.profile-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 90;
  padding: 4px;
  animation: pop-in 140ms var(--ease-out);
}

.profile-pop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: oklch(0.16 0.01 260 / 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.profile-pop .item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 13px;
}

.profile-pop .item:hover {
  background: var(--bg-hover);
}

.profile-pop .item.is-active {
  background: var(--accent-subtle);
}

.profile-pop .meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.profile-pop .sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 2px;
}

.profile-pop .item.add-new {
  color: var(--accent-soft-text);
  font-weight: 500;
}

/* ============================================================
     Utilities
     ============================================================ */
.row-flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.col-flex {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spacer {
  flex: 1;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.text-mute {
  color: var(--text-tertiary);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

/* Subtle slide on screen change. Avoid opacity:0 in keyframes so the
     element stays visible even if animations are paused (background tab,
     reduced-motion, etc.). */
.screen-enter {
  animation: screen-in 320ms var(--ease-out) both;
}

@keyframes screen-in {
  from {
    transform: translateY(6px);
  }

  to {
    transform: translateY(0);
  }
}

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

/* ============================================================
     Welcome v2 — animated 3-stage flow demo
     ============================================================ */

.welcome-v2 {
  padding: 56px 32px 72px;
  background:
    radial-gradient(ellipse 720px 420px at 50% 0%, var(--accent-subtle) 0%, transparent 65%),
    radial-gradient(ellipse 480px 280px at 50% 100%, oklch(0.55 0.1 165 / 0.06) 0%, transparent 70%),
    var(--bg);
  position: relative;
}

.welcome-login {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease);
}

.welcome-login svg {
  color: var(--text-tertiary);
}

.welcome-login:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.welcome-login:hover svg {
  color: var(--accent);
}

.welcome-login:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

@media (max-width: 640px) {
  .welcome-login {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }
}

.welcome-v2 h1 {
  font-size: 30px;
  letter-spacing: -0.028em;
  margin-bottom: 14px;
  max-width: 620px;
}

.welcome-v2>p {
  margin-bottom: 36px;
  max-width: 500px;
}

.welcome-mark--breathe {
  animation: mark-breathe 4.5s ease-in-out infinite;
}

.welcome-mark--breathe::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  background: var(--accent);
  opacity: 0;
  filter: blur(18px);
  animation: mark-halo 4.5s ease-in-out infinite;
  z-index: -1;
}

.welcome-mark {
  position: relative;
}

@keyframes mark-breathe {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes mark-halo {

  0%,
  100% {
    opacity: 0.12;
  }

  50% {
    opacity: 0.28;
  }
}

/* The flow demo container */
.flow-demo {
  position: relative;
  width: 100%;
  max-width: 580px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 18px;
  text-align: left;
  margin-bottom: 36px;
  padding: 4px 6px 4px 0;
}

/* The vertical rail with 3 nodes + traveling pulse */
.flow-rail {
  position: relative;
  width: 28px;
  display: flex;
  justify-content: center;
}

.flow-rail-line {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(to bottom,
      var(--border-strong) 0%,
      var(--border-strong) 100%);
  border-radius: 1px;
}

.flow-rail-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(to bottom,
      var(--accent) 0%,
      var(--accent) 100%);
  border-radius: 1px;
  transition: height 700ms var(--ease-out);
}

.flow-rail--p1 .flow-rail-line::after {
  height: 50%;
}

.flow-rail--p2 .flow-rail-line::after,
.flow-rail--p3 .flow-rail-line::after {
  height: 100%;
}

.flow-rail-node {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  transition: all 320ms var(--ease-out);
  z-index: 2;
}

.flow-rail-node.n1 {
  top: 6px;
}

.flow-rail-node.n2 {
  top: calc(50% - 7px);
}

.flow-rail-node.n3 {
  bottom: 6px;
}

.flow-rail-node.is-on {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-subtle);
}

/* Traveling pulse that runs down the rail each cycle */
.flow-rail-pulse {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(0.5px);
  box-shadow: 0 0 12px var(--accent);
  opacity: 0;
  animation: flow-pulse 8s var(--ease-out) forwards;
  z-index: 3;
  pointer-events: none;
}

@keyframes flow-pulse {
  0% {
    top: 12px;
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  50% {
    top: calc(50% - 4px);
    opacity: 1;
  }

  95% {
    top: calc(100% - 16px);
    opacity: 1;
  }

  100% {
    top: calc(100% - 16px);
    opacity: 0;
  }
}

.flow-stages {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.flow-stage {
  opacity: 0.42;
  transition: opacity 360ms var(--ease-out);
}

.flow-stage.is-active {
  opacity: 1;
}

.flow-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.flow-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-soft-text);
  letter-spacing: 0.05em;
  padding: 2px 6px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-xs);
}

.flow-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
}

/* Stage 1: typewriter input */
.flow-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-primary);
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  box-shadow: var(--shadow-xs);
  text-wrap: pretty;
}

.flow-stage.is-active .flow-input {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-subtle), var(--shadow-xs);
}

.flow-input-text {
  white-space: pre-wrap;
}

.flow-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: -3px;
  animation: flow-blink 900ms steps(2, start) infinite;
}

@keyframes flow-blink {
  to {
    visibility: hidden;
  }
}

/* Stage 2: chip cloud */
.flow-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 38px;
}

.flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(6px) scale(0.95);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
  box-shadow: var(--shadow-xs);
}

.flow-chip.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.flow-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.flow-chip-more {
  background: var(--bg-sunken);
  font-family: var(--font-sans);
  color: var(--text-tertiary);
  border-style: dashed;
}

.flow-chip-more .flow-chip-dot {
  display: none;
}

/* Stage 3: surfaced mini cards */
.flow-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-mini {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out);
}

.flow-mini.is-in {
  opacity: 1;
  transform: translateY(0);
}

.flow-mini-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.flow-mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.flow-mini-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.flow-mini-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-quaternary);
}

.flow-mini-tier {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--r-full);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.flow-mini-tier.tier-high {
  background: var(--success-subtle);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.flow-mini-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.4;
  text-wrap: pretty;
  margin-bottom: 4px;
}

.flow-mini-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* Live tag */
.flow-pulse-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--success-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out);
}

.flow-pulse-tag.is-in {
  opacity: 1;
  transform: translateX(0);
}

.flow-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px oklch(0.55 0.1 165 / 0.18);
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.75;
  }
}

/* ============================================================
     Dashboard v2 — breathing room + better stats / subreddit
     ============================================================ */

.page-v2 {
  padding: 36px 58px 96px;
  max-width: 1220px;
}

.page-header-v2 {
  margin-bottom: 28px;
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.page-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px oklch(0.55 0.1 165 / 0.18);
}

.page-v2 .page-title {
  font-size: 28px;
  letter-spacing: -0.028em;
}

.page-v2 .page-subtitle {
  font-size: 14.5px;
  margin-top: 6px;
}

.page-subtitle-strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Scan summary pill — sits beneath the dashboard subtitle and tells the
   user what the latest scan actually did, separate from the inbox state. */
.scan-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid transparent;
  max-width: 720px;
}
.scan-summary strong { color: var(--text-primary); font-weight: 600; }
.scan-summary-neutral {
  background: color-mix(in oklab, var(--surface-2) 78%, transparent);
  border-color: color-mix(in oklab, var(--border) 80%, transparent);
  color: var(--text-secondary);
}
.scan-summary-positive {
  background: color-mix(in oklab, oklch(0.7 0.13 165) 14%, transparent);
  border-color: color-mix(in oklab, oklch(0.7 0.13 165) 35%, transparent);
  color: color-mix(in oklab, oklch(0.55 0.13 165) 65%, var(--text-primary));
}
@media (prefers-color-scheme: dark) {
  .scan-summary-positive {
    color: color-mix(in oklab, oklch(0.82 0.12 165) 70%, var(--text-primary));
  }
}

/* Miniature scan-summary — the positive variant docked into the topbar in
   place of the old "Last scan" meta. Sleeker: tighter padding, smaller
   type, single-line. */
.scan-summary-mini {
  margin-top: 0;
  margin-left: 6px;
  padding: 4px 10px;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1.3;
  border-radius: 7px;
  max-width: 280px;
  white-space: nowrap;
}
.scan-summary-mini strong { font-weight: 600; }

.stat-grid-v2 {
  gap: 14px;
  margin-bottom: 28px;
}

.stat-v2 {
  padding: 18px 20px 20px;
  border-radius: var(--r-2xl);
  position: relative;
  overflow: hidden;
}

.stat-v2 .stat-value {
  font-size: 32px;
  letter-spacing: -0.035em;
}

.stat-v2 .stat-label {
  margin-bottom: 12px;
  color: var(--text-tertiary);
}

.stat-v2 .stat-meta {
  margin-top: 10px;
}

.stat-accent {
  background:
    linear-gradient(180deg, var(--accent-subtle) 0%, var(--bg-card) 80%);
  border-color: var(--accent-border);
}

.stat-accent::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, oklch(0.52 0.14 268 / 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.stat-accent .stat-label {
  color: var(--accent-soft-text);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.dash-card .card-header {
  padding: 16px 22px;
}

.dash-feed {
  padding: 14px 16px 16px;
}

.dash-feed .feed {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.dash-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-header-v2 {
  padding: 16px 20px;
}

/* ──────────────────────────────────────────────────────────
   Fresh state — no scans yet.
   Blurs the dashboard's stat-grid + dash-grid behind a glass
   card prompting "Run your first scan", so the user lands on
   a clear next action instead of empty zeroes.
   ────────────────────────────────────────────────────────── */
.dash-fresh-wrap {
  position: relative;
}

.dash-fresh-wrap.is-fresh .dash-fresh-content {
  filter: blur(14px) saturate(1.05);
  -webkit-filter: blur(14px) saturate(1.05);
  transform: scale(1.01);
  transform-origin: 50% 0%;
  pointer-events: none;
  user-select: none;
  opacity: 0.82;
  transition: filter 360ms ease, opacity 360ms ease, transform 360ms ease;
}

.dash-fresh-wrap:not(.is-fresh) .dash-fresh-content {
  filter: none;
  -webkit-filter: none;
  transform: none;
  opacity: 1;
  transition: filter 240ms ease, opacity 240ms ease, transform 240ms ease;
}

.fresh-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding: 24px;
  pointer-events: none;
  overflow: hidden;
  animation: freshOverlayIn 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes freshOverlayIn {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.fresh-overlay-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  animation: freshOrbFloat 14s ease-in-out infinite alternate;
}

.fresh-overlay-orb-a {
  width: 360px;
  height: 360px;
  left: 8%;
  top: 4%;
  background: radial-gradient(circle, var(--accent-subtle-hover) 0%, transparent 70%);
}

.fresh-overlay-orb-b {
  width: 420px;
  height: 420px;
  right: 6%;
  bottom: -8%;
  background: radial-gradient(circle, oklch(0.7 0.13 268 / 0.35) 0%, transparent 70%);
  animation-delay: -7s;
}

@keyframes freshOrbFloat {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(20px, -16px, 0) scale(1.08); }
}

.fresh-overlay-card {
  position: relative;
  pointer-events: auto;
  max-width: 480px;
  width: 100%;
  padding: 32px 32px 26px;
  text-align: center;
  border-radius: var(--r-2xl, 18px);
  background: color-mix(in oklab, var(--bg-elevated) 78%, transparent);
  border: 1px solid color-mix(in oklab, var(--text-primary) 12%, transparent);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  box-shadow:
    0 1px 0 color-mix(in oklab, #fff 30%, transparent) inset,
    0 30px 60px -20px oklch(0.2 0.02 260 / 0.35),
    0 12px 24px -12px oklch(0.2 0.02 260 / 0.25);
  animation: freshCardIn 620ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

[data-theme="dark"] .fresh-overlay-card,
.dark .fresh-overlay-card {
  background: color-mix(in oklab, var(--bg-elevated) 70%, transparent);
  box-shadow:
    0 1px 0 color-mix(in oklab, #fff 8%, transparent) inset,
    0 30px 60px -20px #000a,
    0 12px 24px -12px #0008;
}

@keyframes freshCardIn {
  0%   { opacity: 0; transform: translateY(14px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.fresh-overlay-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  margin: 0 auto 18px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-soft-text);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  text-transform: none;
}

.fresh-overlay-badge svg {
  color: var(--accent);
  animation: freshSparkle 2.8s ease-in-out infinite;
}

@keyframes freshSparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50%      { transform: scale(1.15) rotate(8deg); opacity: 1; }
}

.fresh-overlay-title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(180deg,
    var(--text-primary) 0%,
    color-mix(in oklab, var(--text-primary) 70%, var(--accent) 30%) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fresh-overlay-desc {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.fresh-overlay-desc strong {
  color: var(--text-primary);
  font-weight: 600;
}

.fresh-overlay-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 12px;
  box-shadow:
    0 8px 24px -8px color-mix(in oklab, var(--accent) 55%, transparent),
    0 2px 6px -2px color-mix(in oklab, var(--accent) 40%, transparent),
    0 0 0 1px color-mix(in oklab, #fff 14%, transparent) inset;
  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.fresh-overlay-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 14px 32px -10px color-mix(in oklab, var(--accent) 65%, transparent),
    0 4px 10px -3px color-mix(in oklab, var(--accent) 45%, transparent),
    0 0 0 1px color-mix(in oklab, #fff 18%, transparent) inset;
}

.fresh-overlay-cta:active:not(:disabled) {
  transform: translateY(0);
}

.fresh-overlay-cta:disabled {
  opacity: 0.75;
  cursor: progress;
}

.fresh-overlay-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--accent-text) 35%, transparent);
  border-top-color: var(--accent-text);
  animation: freshSpin 720ms linear infinite;
}

@keyframes freshSpin {
  to { transform: rotate(360deg); }
}

.fresh-overlay-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.fresh-overlay-foot-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.fresh-overlay-foot-item svg {
  opacity: 0.7;
}

.fresh-overlay-foot-sep {
  opacity: 0.4;
}

@media (max-width: 640px) {
  .fresh-overlay-card {
    padding: 26px 22px 22px;
  }
  .fresh-overlay-title {
    font-size: 24px;
  }
  .fresh-overlay-desc {
    font-size: 13px;
  }
  .dash-fresh-wrap.is-fresh .dash-fresh-content {
    filter: blur(10px) saturate(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fresh-overlay,
  .fresh-overlay-card,
  .fresh-overlay-orb,
  .fresh-overlay-badge svg {
    animation: none;
  }
  .dash-fresh-wrap.is-fresh .dash-fresh-content {
    transition: none;
  }
}

/* By Subreddit panel v2 */
.sub-bd {
  overflow: hidden;
}

.sub-bd-foot-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.sub-bd-list {
  padding: 14px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sub-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: sub-row-in 520ms var(--ease-out) backwards;
}

@keyframes sub-row-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sub-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-avatar {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.18);
}

.sub-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.sub-count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.sub-new-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px 1px 5px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-full);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-soft-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sub-new-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.sub-track {
  height: 8px;
  background: var(--bg-sunken);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}

.sub-bar {
  height: 100%;
  display: flex;
  border-radius: var(--r-full);
  overflow: hidden;
  transform-origin: left center;
  animation: sub-bar-fill 700ms var(--ease-out) backwards;
}

@keyframes sub-bar-fill {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.sub-bar-seg {
  height: 100%;
  display: block;
}

.sub-bar-seg+.sub-bar-seg {
  border-left: 1.5px solid var(--bg-card);
}

.sub-bar-seg.tier-high {
  background: var(--success-text);
}

.sub-bar-seg.tier-med {
  background: var(--warning-text);
}

.sub-bar-seg.tier-low {
  background: var(--text-quaternary);
}

[data-theme="dark"] .sub-bar-seg.tier-high {
  background: var(--success-text);
}

[data-theme="dark"] .sub-bar-seg.tier-med {
  background: var(--warning-text);
}

[data-theme="dark"] .sub-bar-seg.tier-low {
  background: var(--text-quaternary);
}

.sub-bd-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
}

.sub-bd-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.sub-bd-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.sub-bd-swatch.tier-high {
  background: var(--success-text);
}

.sub-bd-swatch.tier-med {
  background: var(--warning-text);
}

.sub-bd-swatch.tier-low {
  background: var(--text-quaternary);
}

[data-theme="dark"] .sub-bd-swatch.tier-med {
  background: var(--warning-text);
}

[data-theme="dark"] .sub-bd-swatch.tier-low {
  background: var(--text-quaternary);
}

/* Activity list v2 */
.activity-list {
  padding: 6px 0;
}

.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-text {
  min-width: 0;
}

.activity-title {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.45;
}

.activity-time {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Trust card v2 */
.trust-card {
  background:
    linear-gradient(180deg, oklch(0.55 0.1 165 / 0.06) 0%, var(--bg-card) 70%);
  border-color: var(--success-border);
}

[data-theme="dark"] .trust-card {
  background:
    linear-gradient(180deg, oklch(0.55 0.1 165 / 0.12) 0%, var(--bg-card) 80%);
}

.trust-card-body {
  padding: 18px 20px 16px;
}

.trust-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.trust-card-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.trust-card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.trust-card-link {
  margin-top: 10px;
  padding: 4px 0;
  color: var(--accent-soft-text);
}

/* Compact down at narrow widths */
@media (max-width: 960px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid-v2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
     User card logout button
     ============================================================ */

.user-logout {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.user-logout:hover {
  background: var(--bg-active);
  color: var(--danger);
}

/* ============================================================
     Login / Auth screen
     ============================================================ */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(ellipse 700px 400px at 50% 0%, var(--accent-subtle) 0%, transparent 65%),
    var(--bg);
  position: relative;
}

.auth-theme {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.auth-theme:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 6px 0 0;
}

.auth-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0 0 8px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field>span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.auth-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 38px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-tertiary);
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}

.auth-input:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.auth-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  padding: 0;
}

.auth-input input::placeholder {
  color: var(--text-quaternary);
}

.auth-link {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-sep {
  position: relative;
  text-align: center;
  margin: 4px 0;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-quaternary);
}

.auth-sep::before,
.auth-sep::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 28px);
  height: 1px;
  background: var(--border);
}

.auth-sep::before {
  left: 0;
}

.auth-sep::after {
  right: 0;
}

.auth-demo {
  justify-content: center;
}

.auth-foot {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
}

.auth-trust svg {
  color: var(--success);
}


/* ──────────────────────────────────────────────────────────────────
     Onboarding v2 — describe → analyze → radar
     ────────────────────────────────────────────────────────────────── */

.ob2-describe {
  max-width: 640px;
  margin: 32px auto 0;
  padding: 0 20px;
}

.ob2-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.ob2-eyebrow svg {
  color: var(--success);
}

.ob2-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-subtle);
}

.ob2-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0 0 10px;
  line-height: 1.18;
}

.ob2-sub {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 560px;
}

.ob2-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02), 0 8px 24px rgba(0, 0, 0, 0.04);
}

.ob2-segmented {
  position: relative;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-full);
  margin-bottom: 18px;
}

.ob2-seg {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: transparent;
  border: 0;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: color 160ms var(--ease);
}

.ob2-seg.is-on {
  color: var(--text-primary);
}

.ob2-seg svg {
  color: inherit;
}

.ob2-seg-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 4px);
  background: var(--bg-card);
  border-radius: var(--r-full);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: transform 220ms var(--ease);
}

.ob2-seg-thumb.is-right {
  transform: translateX(100%);
}

.ob2-input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ob2-url {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px 4px 4px 12px;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.ob2-url:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.ob2-url-prefix {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
  user-select: none;
}

.ob2-url-input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  font-size: 14.5px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  outline: none;
}

.ob2-textarea {
  width: 100%;
  resize: vertical;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  line-height: 1.5;
  outline: none;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.ob2-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.ob2-input-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  padding: 0 2px;
}

.ob2-input-hint svg {
  color: var(--accent);
}

.ob2-input-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--danger-text, var(--text-primary));
  background: var(--danger-subtle, var(--bg-sunken));
  border: 1px solid var(--danger-border, var(--border));
  border-radius: var(--r-md);
  padding: 8px 10px;
  margin-top: 12px;
}

.ob2-input-error svg {
  color: var(--danger, var(--text-primary));
  flex-shrink: 0;
}

.ob2-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.ob2-card-foot .spacer {
  flex: 1;
}

@media (max-width: 720px) {
  .ob2-describe {
    margin-top: 12px;
    padding-bottom: max(120px, env(safe-area-inset-bottom));
  }

  .ob2-title {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .ob2-sub {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .ob2-card {
    padding: 16px;
  }

  .ob2-card-foot {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .ob2-card-foot .spacer {
    display: none;
  }

  .ob2-card-foot .btn {
    width: 100%;
    justify-content: center;
  }
}

.ob2-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 0;
}

.ob2-link:hover {
  color: var(--text-primary);
}

.ob2-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
}

.ob2-trust svg {
  color: var(--success);
}


/* ── Analyzing transition ─────────────────────────────────────────── */

.ob2-analyzing {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 460px;
  margin: 80px auto 0;
  text-align: center;
  padding: 0 20px;
}

.ob2-analyze-orb {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  margin-bottom: 22px;
}

.ob2-orb-pulse {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: ob2OrbPulse 2s var(--ease-out) infinite;
}

.ob2-orb-pulse--2 {
  animation-delay: 1s;
}

@keyframes ob2OrbPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.5;
  }

  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.ob2-analyze-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ob2-analyze-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 22px;
}

.ob2-analyze-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 18px;
  width: min(100%, 320px);
}

.ob2-analyze-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-quaternary);
  transition: color 160ms var(--ease);
}

.ob2-analyze-step.is-active {
  color: var(--text-primary);
}

.ob2-analyze-step.is-done {
  color: var(--text-secondary);
}

.ob2-step-dot {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  color: var(--text-quaternary);
}

.ob2-analyze-step.is-active .ob2-step-dot {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.ob2-analyze-step.is-done .ob2-step-dot {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-subtle, transparent);
}

@keyframes ob2-step-spin {
  to {
    transform: rotate(360deg);
  }
}

.ob2-step-spinner {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  box-sizing: border-box;
  animation: ob2-step-spin 700ms linear infinite;
}

.ob2-step-ring {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--border-strong) 80%, transparent);
  box-sizing: border-box;
}


/* ── Radar review ─────────────────────────────────────────────────── */

.ob2-radar {
  max-width: 920px;
  margin: 24px auto 60px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.ob2-radar-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ob2-radar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 24px;
}

.ob2-radar-title-row .ob2-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  margin: 0;
}

.ob2-radar-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-left: 24px;
  flex-shrink: 0;
}

.ob2-radar-head-secondary,
.ob2-radar-head-cta {
  flex-shrink: 0;
}

.ob2-radar-head-secondary {
  min-width: 36px;
  padding-inline: 10px;
}

.ob2-product {
  display: flex;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 18px 20px;
}

.ob2-product-mark {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-active));
  color: var(--accent-text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  display: grid;
  place-items: center;
}

.ob2-product-mark-image {
  object-fit: contain;
  padding: 8px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, white 12%);
  border: 1px solid var(--border-subtle);
}

.ob2-product-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ob2-product-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ob2-product-name {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  padding: 4px 0;
  outline: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 120ms var(--ease);
}

.ob2-product-name:hover,
.ob2-product-name:focus {
  border-bottom-color: var(--border-strong);
}

.ob2-extract-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-soft-text);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 3px 7px;
  border-radius: var(--r-full);
}

.ob2-extract-tag svg {
  color: var(--accent);
}

.ob2-product-pitch {
  position: relative;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 6px 28px 6px 0;
  border-radius: var(--r-md);
  cursor: text;
  border: 1px solid transparent;
}

.ob2-product-pitch:hover {
  border-color: var(--border-subtle);
  background: var(--bg-sunken);
}

.ob2-product-pitch-edit {
  width: 100%;
  border: 1px solid var(--accent);
  background: var(--bg-elevated);
  font: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  border-radius: var(--r-md);
  padding: 6px 8px;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.ob2-inline-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  padding: 2px;
  border-radius: 4px;
  opacity: 1;
  cursor: pointer;
}

.ob2-product-url {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.ob2-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 720px) {
  .ob2-grid-2 {
    grid-template-columns: 1fr;
  }

  .ob2-radar-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .ob2-radar-head-actions {
    width: 100%;
  }

  .ob2-radar-head-secondary,
  .ob2-radar-head-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: 12px;
    white-space: nowrap;
  }

  .ob2-radar-head-secondary {
    width: auto;
  }

  .ob2-radar-head-cta {
    width: 100%;
  }
}

.ob2-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ob2-section-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ob2-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-primary);
}

.ob2-section-title svg {
  color: var(--text-tertiary);
}

.ob2-section-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-top: 2px;
}

.ob2-customer-text {
  position: relative;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 6px 28px 6px 0;
  border-radius: var(--r-md);
  cursor: text;
  border: 1px solid transparent;
}

.ob2-customer-text:hover {
  border-color: var(--border-subtle);
  background: var(--bg-sunken);
}

.ob2-customer-text-edit {
  width: 100%;
  border: 1px solid var(--accent);
  background: var(--bg-elevated);
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: var(--r-md);
  padding: 6px 8px;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.ob2-sub-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.ob2-sub-label-hint {
  margin-left: 6px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-quaternary);
}

/* ── Chip editor ─────────────────────────────────────────────────── */

.ob2-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px;
  cursor: text;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}

.ob2-chips:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.ob2-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 4px 3px 8px;
  border-radius: var(--r-full);
  background: var(--neutral-subtle, var(--bg-sunken));
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.ob2-chip.is-accent {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-soft-text);
}

.ob2-chip.is-mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.ob2-chip-x {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
}

.ob2-chip-x:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.ob2-chip-input {
  flex: 1;
  min-width: 80px;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
}

.ob2-chip-input.is-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ── Subreddit radar ─────────────────────────────────────────────── */

.ob2-radar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
}

.ob2-radar-section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
  align-items: center;
}

.ob2-radar-section-head> :first-child {
  flex: 1;
}

.ob2-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 140ms var(--ease);
}

.ob2-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.ob2-sublist {
  display: flex;
  flex-direction: column;
}

.ob2-subrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--border-subtle);
  transition: opacity 140ms var(--ease);
}

.ob2-subrow:first-child {
  border-top: 0;
}

.ob2-subrow.is-off {
  opacity: 0.45;
}

.ob2-sub-toggle {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  padding: 4px;
  cursor: pointer;
}

.ob2-sub-toggle-track {
  display: inline-block;
  position: relative;
  width: 28px;
  height: 16px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  transition: background 160ms var(--ease);
}

.ob2-sub-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 180ms var(--ease);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ob2-subrow:not(.is-off) .ob2-sub-toggle-track {
  background: var(--accent);
}

.ob2-subrow:not(.is-off) .ob2-sub-toggle-knob {
  transform: translateX(12px);
}

.ob2-sub-signal {
  flex-shrink: 0;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  padding: 2px;
}

.ob2-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}

.ob2-bar {
  display: block;
  width: 3px;
  background: var(--border-strong);
  border-radius: 1px;
}

.ob2-bar:nth-child(1) {
  height: 5px;
}

.ob2-bar:nth-child(2) {
  height: 9px;
}

.ob2-bar:nth-child(3) {
  height: 13px;
}

.ob2-bars-high .ob2-bar.is-on {
  background: var(--success, var(--accent));
}

.ob2-bars-medium .ob2-bar.is-on {
  background: var(--accent);
}

.ob2-bars-low .ob2-bar.is-on {
  background: var(--warning, var(--text-tertiary));
}

.ob2-sub-main {
  flex: 1;
  min-width: 0;
}

.ob2-sub-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ob2-sub-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.ob2-sub-members {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.ob2-sub-tier {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-full);
  border: 1px solid;
}

.ob2-sub-tier-high {
  color: var(--success-text, var(--success));
  background: var(--success-subtle, transparent);
  border-color: var(--success-border, var(--success));
}

.ob2-sub-tier-medium {
  color: var(--accent-soft-text);
  background: var(--accent-subtle);
  border-color: var(--accent-border);
}

.ob2-sub-tier-low {
  color: var(--text-tertiary);
  background: var(--bg-sunken);
  border-color: var(--border-subtle);
}

.ob2-sub-note {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
  line-height: 1.45;
}

.ob2-sub-remove {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  padding: 6px;
  color: var(--text-quaternary);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 120ms var(--ease);
}

.ob2-sub-remove:hover {
  color: var(--danger, var(--text-primary));
  background: var(--danger-subtle, var(--bg-hover));
}

.ob2-subrow-add {
  border-top: 1px dashed var(--border-strong);
  background: var(--bg-sunken);
  border-radius: var(--r-md);
  padding: 8px 10px;
}

.ob2-add-leading {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
}

.ob2-add-input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  border-radius: var(--r-md);
  outline: none;
}

.ob2-add-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.ob2-sublist-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 6px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.ob2-sublist-empty svg {
  color: var(--text-quaternary);
}


/* ── Signals meta + tune cards ───────────────────────────────────── */

.ob2-signals-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}

.ob2-signals-meta-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ob2-signals-meta-title svg {
  color: var(--accent);
}

.ob2-signals-meta-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}

.ob2-tune {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 720px) {
  .ob2-tune {
    grid-template-columns: 1fr;
  }
}

.ob2-tune-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ob2-tune-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ob2-tune-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ob2-tune-dot--pos {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.ob2-tune-dot--neg {
  background: var(--danger, var(--text-tertiary));
  box-shadow: 0 0 0 3px var(--danger-subtle, var(--bg-sunken));
}

.ob2-tune-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-sunken);
  padding: 1px 7px;
  border-radius: var(--r-full);
}

.ob2-tune-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: 4px;
}

/* ── ListEditor (negative patterns) ──────────────────────────────── */

.ob2-listed {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ob2-listed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--text-primary);
}

.ob2-listed-bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger, var(--text-tertiary));
  flex-shrink: 0;
}

.ob2-listed-text {
  flex: 1;
  line-height: 1.45;
}

.ob2-listed-x {
  border: 0;
  background: transparent;
  color: var(--text-quaternary);
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
}

.ob2-listed-x:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.ob2-listed-add {
  display: flex;
  padding: 6px 0 0;
}

.ob2-listed-input {
  flex: 1;
  border: 1px dashed var(--border-strong);
  background: transparent;
  padding: 7px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-primary);
  border-radius: var(--r-md);
  outline: none;
}

.ob2-listed-input:focus {
  border-style: solid;
  border-color: var(--accent);
  background: var(--bg-elevated);
}

/* ── Themes (collapsible) ────────────────────────────────────────── */

.ob2-themes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

.ob2-themes-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
}

.ob2-themes-toggle>span:nth-of-type(1) {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ob2-themes-count {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-sunken);
  padding: 1px 7px;
  border-radius: var(--r-full);
}

.ob2-themes-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.ob2-themes-body {
  padding: 0 16px 14px;
}

/* ── Foot ────────────────────────────────────────────────────────── */

.ob2-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px 0;
}

.ob2-foot .spacer {
  flex: 1;
}

.ob2-foot-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ob2-foot-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: left;
}

.ob2-foot-trust svg {
  color: var(--success);
}

@media (max-width: 720px) {
  .ob2-extract-tag,
  .onboard-stepper {
    display: none !important;
  }

  .ob2-radar {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .ob2-foot {
    position: static;
    z-index: auto;
    margin-top: 12px;
    padding: 0 4px;
  }
}

/* ============================================================
     Theme toggle (sun/moon) — top-right floating button
     ============================================================ */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease), border-color 120ms var(--ease), transform 120ms var(--ease);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.theme-toggle-float {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 30;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.theme-toggle-float:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

@media (max-width: 640px) {
  .theme-toggle-float {
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
  }
}

/* ============================================================
     Welcome v4 — editorial morning briefing
     ============================================================ */

.welcome-v4 {
  display: block;
  min-height: 100%;
  padding: 56px 32px 72px;
  text-align: left;
  background:
    radial-gradient(ellipse 880px 360px at 50% -6%, var(--accent-subtle) 0%, transparent 70%),
    var(--bg);
  position: relative;
  overflow-x: clip;
  max-width: 100%;
  box-sizing: border-box;
}

.welcome-top-actions {
  position: absolute;
  top: max(env(safe-area-inset-top), 18px);
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  box-sizing: border-box;
  width: auto;
  max-width: none;
  margin: 0;
}

.welcome-top-actions-left,
.welcome-top-actions-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.welcome-top-actions-right {
  gap: 10px;
}

.welcome-theme-toggle {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
}

.welcome-v4 > :not(.welcome-top-actions) {
  width: 100%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
  box-sizing: border-box;
}

.welcome-v4>.wv5-how {
  max-width: 980px;
}

.wv4-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 48px;
  padding-top: 42px;
}

@media (max-width: 640px) {
  .welcome-top-actions {
    top: max(env(safe-area-inset-top), 14px);
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .welcome-theme-toggle {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .welcome-top-actions-right {
    gap: 8px;
  }

  .welcome-v4 {
    padding: 44px 16px 56px;
  }

  .wv4-hero {
    padding-top: 40px;
  }

  .wv4-serif {
    white-space: normal;
  }

  .wv4-brief-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

.wv4-headline {
  font-family: var(--font-sans);
  font-size: 52px;
  font-weight: 600;
  letter-spacing: -0.038em;
  line-height: 1.04;
  color: var(--text-primary);
  margin: 0 0 18px;
  text-wrap: balance;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.wv4-serif {
  font-family: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  font-size: 1.13em;
  line-height: 1;
  color: var(--accent);
  padding: 4px 0.04em;
  white-space: nowrap;
}

.wv4-headline-highlight {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.wv4-headline-highlight::before {
  content: "";
  position: absolute;
  inset: 0.08em -0.08em 0.02em;
  border-radius: 0.02em;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: -1;
  animation: wv4-headline-sweep 2s var(--ease-out) 1.5s forwards;
}

@keyframes wv4-headline-sweep {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.wv4-sub {
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 auto 30px;
  max-width: 520px;
  text-wrap: pretty;
  text-align: center;
}

.wv4-ctas {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.welcome-v4 .btn-primary {
  padding: 10px 18px;
  font-size: 14px;
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.16),
    0 1px 2px oklch(0.585 0.122 38 / 0.18),
    0 8px 24px -8px oklch(0.585 0.122 38 / 0.35);
}

.welcome-v4 .btn-primary:hover .cta-arrow {
  transform: translateX(2px);
}

.wv4-quiet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 6px 4px;
  border-bottom: 1px solid transparent;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}

.wv4-quiet:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-strong);
}

.wv4-quiet svg {
  color: var(--text-tertiary);
  transition: transform 180ms var(--ease-out);
}

.wv4-quiet:hover svg {
  transform: translateX(2px);
  color: var(--accent);
}

.wv4-brief {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 22px 26px 18px;
  box-shadow:
    0 1px 2px oklch(0.3 0.04 45 / 0.04),
    0 28px 60px -28px oklch(0.585 0.122 38 / 0.22);
  margin-bottom: 56px;
  position: relative;
}

.wv4-brief::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.5;
}

.wv4-brief-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.wv4-brief-label {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  flex-shrink: 0;
  white-space: nowrap;
}

.wv4-brief-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}

.wv4-brief-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wv4-brief-meta strong {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wv4-brief-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.wv4-brief-row {
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 140ms var(--ease);
  position: relative;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: var(--r-md);
}

.wv4-brief-row:hover {
  background: var(--bg-sunken);
}

.wv4-brief-row:hover .wv4-brief-arrow svg {
  transform: translate(2px, -2px);
  color: var(--accent);
}

.wv4-brief-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-quaternary);
  letter-spacing: 0.04em;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

.wv4-brief-body {
  min-width: 0;
}

.wv4-brief-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  flex-wrap: wrap;
  white-space: nowrap;
}

.wv4-brief-kicker>* {
  white-space: nowrap;
}

.wv4-brief-tag {
  font-weight: 600;
  letter-spacing: 0.08em;
}

.wv4-brief-tag.tier-high {
  color: var(--success-text);
}

.wv4-brief-tag.tier-med {
  color: var(--warning-text);
}

.wv4-brief-tag.tier-new {
  color: var(--accent-soft-text);
}

.wv4-brief-sub {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.wv4-brief-sep {
  color: var(--text-quaternary);
}

.wv4-brief-ago {
  color: var(--text-tertiary);
}

.wv4-brief-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.012em;
  line-height: 1.4;
  text-wrap: pretty;
  margin: 0 0 8px;
}

.wv4-brief-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.wv4-brief-foot-sep {
  color: var(--text-quaternary);
}

.wv4-brief-extra {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-soft-text);
  letter-spacing: 0.02em;
}

.wv4-brief-arrow {
  padding-top: 4px;
  color: var(--text-quaternary);
}

.wv4-brief-arrow svg {
  transition: transform 180ms var(--ease-out), color 180ms var(--ease);
}

.wv4-brief-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.wv4-brief-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-soft-text);
  padding: 4px 0;
  border-bottom: 1px solid var(--accent-border);
  transition: border-color 140ms var(--ease), color 140ms var(--ease), gap 140ms var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}

.wv4-brief-cta:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  gap: 7px;
}

.wv4-brief-footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-quaternary);
  letter-spacing: 0.01em;
}

.wv4-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  text-align: center;
  text-wrap: pretty;
}

.wv4-foot svg {
  color: var(--success);
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .wv4-headline {
    font-size: 38px;
  }

  .wv4-brief {
    padding: 18px 18px 14px;
  }

  .wv4-brief-row {
    grid-template-columns: 30px 1fr 20px;
    gap: 10px;
  }

  .wv4-brief-head {
    flex-wrap: wrap;
  }

  .wv4-brief-label,
  .wv4-brief-meta {
    white-space: normal;
  }

  .wv4-brief-meta {
    font-size: 10.5px;
    width: 100%;
  }

  .wv4-brief-kicker {
    white-space: normal;
  }

  .wv4-brief-kicker > * {
    white-space: normal;
  }
}

/* ============================================================
     How it works v5 — 3-step storyboard with live art per step
     ============================================================ */

.wv5-how {
  width: 100%;
  max-width: 980px;
  margin: 0 auto 56px;
}

.wv5-how-head {
  text-align: center;
  margin-bottom: 36px;
  padding: 0 16px;
}

.wv5-how-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  white-space: nowrap;
}

.wv5-how-title {
  font-family: var(--font-sans);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0;
  text-wrap: balance;
}

.wv5-how-title .wv4-serif {
  font-size: 1.14em;
  color: var(--accent);
  letter-spacing: 1px;
}

.wv5-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 32px 1fr 32px 1fr;
  gap: 0;
  align-items: stretch;
}

.wv5-step {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow:
    0 1px 2px oklch(0.3 0.04 45 / 0.04),
    0 24px 48px -28px oklch(0.585 0.122 38 / 0.18);
  position: relative;
  opacity: 0.92;
  transition: opacity 480ms var(--ease-out), box-shadow 480ms var(--ease-out);
}

.wv5-step.is-active {
  opacity: 1;
  box-shadow:
    0 1px 2px oklch(0.3 0.04 45 / 0.05),
    0 32px 60px -28px oklch(0.585 0.122 38 / 0.32);
}

.wv5-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.wv5-step-num {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 38px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  opacity: 0.85;
}

.wv5-step-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-sunken);
  border: 1.5px solid var(--border-strong);
  transition: background 360ms var(--ease-out), border-color 360ms var(--ease-out), box-shadow 360ms var(--ease-out);
}

.wv5-step.is-active .wv5-step-marker {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.wv5-step-art {
  margin: 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 168px;
  flex-shrink: 0;
}

.wv5-step-art>* {
  width: 100%;
}

.wv5-step-title {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--text-primary);
  margin: 0 0 6px;
  line-height: 1.3;
  min-height: calc(17px * 1.3);
}

.wv5-step-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  text-wrap: pretty;
}

.wv5-connect {
  list-style: none;
  position: relative;
  align-self: center;
  height: 1px;
  margin: 0;
  padding: 0;
  background-image: linear-gradient(to right, var(--border-strong) 50%, transparent 0%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
  background-position: 0 50%;
  margin-top: 30px;
  overflow: visible;
}

.wv5-connect::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--border-strong);
  border-right: 1.5px solid var(--border-strong);
  transform: translateY(-50%) rotate(45deg);
  transition: border-color 480ms var(--ease-out);
}

.wv5-connect-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--accent) 50%, transparent 0%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
  background-position: 0 50%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 600ms var(--ease-out);
}

.wv5-connect-fill.is-on {
  transform: scaleX(1);
}

.wv5-step.is-active~.wv5-connect::after,
.wv5-connect:has(.wv5-connect-fill.is-on)::after {
  border-color: var(--accent);
}

/* Step 1 art — Describe (typewriter input) */
.art-describe {
  width: 100%;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px 14px;
  transition: border-color 360ms var(--ease-out), box-shadow 360ms var(--ease-out), background 360ms var(--ease-out);
}

.art-describe.is-active {
  background: var(--bg-elevated);
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.art-describe-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.art-describe-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
  min-height: 60px;
  text-wrap: pretty;
}

.art-describe-cursor {
  display: inline-block;
  width: 2px;
  height: 13px;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: -2px;
  animation: flow-blink 900ms steps(2, start) infinite;
}

/* Step 2 art — Listen (radar + chips) */
.art-listen {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.art-listen-radar {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.art-listen-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  opacity: 0.55;
  border-color: var(--accent-border);
  animation: radar-pulse 2.6s ease-out infinite;
}

.art-listen-ring.r1 {
  animation-delay: 0s;
}

.art-listen-ring.r2 {
  animation-delay: 0.8s;
}

.art-listen-ring.r3 {
  animation-delay: 1.6s;
}

@keyframes radar-pulse {
  0% {
    opacity: 0.85;
    transform: scale(0.3);
  }

  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

.art-listen-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  position: relative;
  z-index: 2;
}

.art-listen-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 1px;
  background: linear-gradient(to right, var(--accent) 0%, transparent 100%);
  transform-origin: 0% 50%;
  animation: radar-sweep 2.4s linear infinite;
  opacity: 0.8;
}

@keyframes radar-sweep {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.art-listen-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

.art-listen-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  opacity: 1;
  transform: translateY(0) scale(1);
  box-shadow: var(--shadow-xs);
  animation: chip-pop 480ms var(--ease-out) backwards;
}

.art-listen-chip.is-in {
  opacity: 1;
}

@keyframes chip-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.art-listen-chip-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* Step 3 art — Reply (mini match card with actions) */
.art-reply {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  opacity: 1;
  transition: border-color 480ms var(--ease-out), box-shadow 480ms var(--ease-out);
}

.art-reply.is-active {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-subtle), var(--shadow-xs);
}

.art-reply-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.art-reply-tier {
  font-weight: 600;
  color: var(--success-text);
  letter-spacing: 0.08em;
}

.art-reply-sub {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.art-reply-score {
  margin-left: auto;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.art-reply-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.art-reply-why {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg-sunken);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
}

.art-reply-why-label {
  color: var(--accent-soft-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.art-reply-why-text {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.art-reply-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.18);
  margin-top: auto;
  white-space: nowrap;
  line-height: 1;
}

@media (max-width: 880px) {
  .wv5-steps {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .wv5-connect {
    height: 24px;
    width: 1px;
    margin: 0 auto;
    background-image: linear-gradient(to bottom, var(--border-strong) 50%, transparent 0%);
    background-size: 1px 6px;
    background-repeat: repeat-y;
    background-position: 50% 0;
    overflow: hidden;
  }

  .wv5-connect::after {
    top: auto;
    right: 50%;
    bottom: -3px;
    transform: translateX(50%) rotate(135deg);
  }

  .wv5-connect-fill {
    background: linear-gradient(to bottom, var(--accent) 50%, transparent 0%);
    background-size: 1px 6px;
    background-repeat: repeat-y;
    background-position: 50% 0;
    transform: scaleY(0);
    transform-origin: top center;
  }

  .wv5-connect-fill.is-on {
    transform: scaleY(1);
  }

  .wv5-how-title {
    font-size: 26px;
  }
}

/* ============================================================
   Mobile shell — full-viewport phone layout (MobileApp).
   Activates when (max-width: 720px) AND the user is signed in.
   ============================================================ */

@media (max-width: 720px) {
  html,
  body {
    overflow-x: clip;
    max-width: 100%;
  }
}

.app-mobile {
  display: block;
  grid-template-columns: none;
  grid-template-rows: none;
  height: 100dvh;
  background: var(--bg);
}

.mobile-app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
}

.mobile-app-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mobile-chrome {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text-primary);
}

.mobile-chrome-header {
  padding: max(env(safe-area-inset-top), 12px) 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
}

.mobile-chrome-eyebrow {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.mobile-chrome-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 1px;
  color: var(--text-primary);
}

.mobile-demo-exit {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  gap: 6px;
  font-size: 12.5px;
}

.mobile-demo-exit-row {
  margin: 14px 0 10px;
}

.mobile-chrome-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-page {
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
}

.mobile-user-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.mobile-profile-switcher {
  position: relative;
  flex-shrink: 0;
}

.mobile-profile-switcher.is-open {
  z-index: 91;
}

.mobile-profile-switcher-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
}

.mobile-profile-switcher-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 13px;
}

.mobile-profile-pop {
  right: 0;
  left: auto;
  width: min(280px, calc(100vw - 32px));
}

.mobile-hero {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.mobile-hero-eyebrow {
  font-size: 12px;
  color: var(--accent-soft-text);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.mobile-hero-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mobile-hero-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.mobile-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.mobile-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.mobile-stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.mobile-stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.mobile-section-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-bottom: 10px;
}

.mobile-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.mobile-card > * {
  text-align: left;
}

.mobile-card-title,
.mobile-card-title-sm,
.mobile-card-why {
  text-align: left;
  align-self: stretch;
}

.mobile-card:hover,
.mobile-card:active {
  background: var(--bg-hover);
}

.mobile-card-compact {
  padding: 12px;
  border-radius: 12px;
}

.mobile-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.mobile-card-sub {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-card-time {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.mobile-card-score {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.mobile-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.mobile-card-title-sm {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.mobile-card-why {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.mobile-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.mobile-empty-inline {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.mobile-empty {
  padding: 48px 24px;
  text-align: center;
}

.mobile-empty-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.mobile-empty-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.mobile-cta {
  width: 100%;
  margin-top: 14px;
  justify-content: center;
}

.mobile-feed {
  padding: 12px 14px calc(96px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mobile-chip-row::-webkit-scrollbar {
  display: none;
}

.mobile-detail-header {
  padding: max(env(safe-area-inset-top), 10px) 14px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
}

.mobile-detail-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.mobile-detail-body {
  padding: 16px;
}

.mobile-detail-footer {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  background: var(--bg);
  flex-shrink: 0;
}

.mobile-detail-footer-cta {
  margin-top: 0;
}

.mobile-detail-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.mobile-detail-h {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.mobile-detail-reddit-thread {
  margin: -6px 0 12px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.45;
}

.mobile-detail-reddit-thread span {
  color: var(--text-secondary);
}

.mobile-detail-excerpt {
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.mobile-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.mobile-detail-why {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.mobile-callout {
  border-radius: 12px;
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.mobile-callout-accent {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent-soft-text);
}

.mobile-callout-warn {
  background: var(--warning-subtle);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.mobile-callout-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-detail-fb {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.mobile-detail-fb .mobile-feedback-btn {
  justify-content: flex-start;
  padding: 9px 12px;
  font-size: 12.5px;
  gap: 8px;
}
.mobile-detail-fb .mobile-feedback-btn:nth-child(1) { grid-column: 1 / -1; justify-content: center; }
.mobile-detail-fb .mobile-feedback-btn:nth-child(2) { grid-column: 1 / -1; justify-content: center; }
.mobile-detail-fb-note {
  font-size: 11.5px;
  color: var(--text-quaternary, var(--text-tertiary));
  margin-bottom: 14px;
  line-height: 1.45;
}

.mobile-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-section-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
}

.mobile-section-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-section-card-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  font: inherit;
}

.mobile-list-row:hover,
.mobile-list-row:active {
  background: var(--bg-hover);
}

.mobile-list-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.mobile-list-row-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.mobile-list-row-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.mobile-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.mobile-tabbar {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: color 120ms var(--ease);
}

.mobile-tab.is-active {
  color: var(--accent);
  font-weight: 600;
}

.mobile-tab-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.mobile-tab-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  line-height: 1;
}

.mobile-tab-label {
  font-size: 10.5px;
}

.mobile-card-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ios-device {
  position: relative;
  border-radius: 44px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.ios-device-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 28px;
  border-radius: 999px;
  background: #000;
  z-index: 3;
}

.ios-device-status {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 2;
  pointer-events: none;
}

.ios-device-inner {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   Mobile — extra primitives for the updated mobile shell
   (stats, scan list, settings rows, filter panel)
   ============================================================ */

.mobile-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-tertiary);
}
.mobile-stat-meta {
  font-size: 10.5px;
  color: var(--text-tertiary);
  line-height: 1.35;
  margin-top: 2px;
}
.mobile-stat-accent {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
}
.mobile-stat-accent .mobile-stat-value {
  color: var(--accent-soft-text);
}
.mobile-stat-grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.mobile-stat-grid-4 .mobile-stat {
  padding: 10px 10px;
}
.mobile-stat-grid-4 .mobile-stat-value {
  font-size: 18px;
}
.mobile-stat-grid-4 .mobile-stat-label {
  font-size: 10px;
}

.mobile-scan-summary {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 14px;
}
.mobile-scan-summary svg {
  margin-top: 2px;
  flex: 0 0 auto;
  color: var(--text-tertiary);
}

.mobile-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.mobile-section-head .mobile-section-label {
  margin-bottom: 0;
  flex: 1;
}
.mobile-section-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  cursor: pointer;
}
.mobile-section-link:disabled {
  opacity: 0.55;
  cursor: default;
}

.mobile-save-status {
  font-size: 11px;
  font-weight: 500;
  transition: color 160ms ease;
  min-height: 14px;
  display: inline-flex;
  align-items: center;
}

/* Subreddit breakdown */
.mobile-sub-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.mobile-sub-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mobile-sub-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.mobile-sub-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-sub-newtag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--text-secondary);
}
.mobile-sub-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
}
.mobile-sub-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border-subtle);
  overflow: hidden;
}
.mobile-sub-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft-text, var(--accent)));
  border-radius: 2px;
  transition: width 320ms ease;
}

/* Activity card */
.mobile-activity {
  padding: 8px;
  display: flex;
  flex-direction: column;
}
.mobile-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
}
.mobile-activity-row + .mobile-activity-row {
  border-top: 1px solid var(--border-subtle);
}
.mobile-activity-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  flex: 0 0 auto;
}
.mobile-activity-body {
  flex: 1;
  min-width: 0;
}
.mobile-activity-text {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.45;
}
.mobile-activity-time {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Trust card on mobile dashboard */
.mobile-trust-card {
  margin-top: 20px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.mobile-trust-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.mobile-trust-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Search + filter row in feed */
.mobile-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.mobile-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
}
.mobile-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
}
.mobile-search input::placeholder {
  color: var(--text-tertiary);
}
.mobile-search svg {
  color: var(--text-tertiary);
}
.mobile-search-clear {
  background: transparent;
  border: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  color: var(--text-tertiary);
  cursor: pointer;
}
.mobile-filter-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.mobile-filter-btn.is-active {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent);
}
.mobile-filter-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 9.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* Expanded filter panel */
.mobile-filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}
.mobile-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mobile-filter-label {
  font-size: 10.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.mobile-chip-row-static {
  flex-wrap: wrap;
  overflow: visible;
}
.mobile-chip-row-scroll {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.mobile-chip-row-scroll::-webkit-scrollbar {
  display: none;
}
.mobile-filter-toggles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mobile-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-sunken);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.mobile-toggle-row svg {
  color: var(--text-tertiary);
}
.mobile-toggle-row .mobile-toggle-dot {
  margin-left: auto;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
}
.mobile-toggle-row.is-active {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-soft-text);
}
.mobile-toggle-row.is-active svg {
  color: var(--accent);
}
.mobile-toggle-row.is-active .mobile-toggle-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--bg-card);
}
.mobile-filter-reset {
  align-self: flex-start;
}

.mobile-feed-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  padding: 0 2px 4px;
}
.mobile-feed-meta strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Scans list rows */
.mobile-scan-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-align: left;
  width: 100%;
  cursor: pointer;
  color: var(--text-primary);
  font: inherit;
}
.mobile-scan-row:hover,
.mobile-scan-row:active {
  background: var(--bg-hover);
}
.mobile-scan-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-scan-row-when {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.mobile-scan-row-counts {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  gap: 6px;
  align-items: center;
}
.mobile-scan-row-counts strong {
  color: var(--text-primary);
  font-weight: 600;
}
.mobile-scan-row-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.mobile-scan-themes-more {
  font-size: 10.5px;
  color: var(--text-tertiary);
}
.mobile-scan-row-err {
  font-size: 11px;
  color: var(--warning-text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-cta-tight {
  margin-top: 0;
}

/* Settings — extra row helpers */
.mobile-list-row[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.mobile-list-row-danger:hover,
.mobile-list-row-danger:active {
  background: var(--danger-subtle, var(--bg-hover));
}
.mobile-list-row-stack {
  align-items: center;
}
.mobile-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 24px 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%),
                    linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.mobile-account-card {
  padding: 8px;
}
.mobile-compliance-card {
  padding: 10px;
  gap: 10px;
}
.mobile-compliance-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 6px;
}
.mobile-compliance-mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid;
}
.mobile-compliance-mark.is-yes {
  background: var(--success-subtle);
  color: var(--success-text);
  border-color: var(--success-border);
}
.mobile-compliance-mark.is-no {
  background: var(--danger-subtle);
  color: var(--danger-text);
  border-color: var(--danger-border);
}
.mobile-compliance-text {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.5;
}
.mobile-danger-link {
  color: var(--danger-text);
}

/* Profile edit on mobile uses the desktop ProfileScreen — make it scroll
   inside the chrome and tighten the page padding for narrow viewports. */
.mobile-profile-scroll .page {
  padding: 16px 14px calc(40px + env(safe-area-inset-bottom));
  max-width: 100% !important;
}
.mobile-profile-scroll .page-header {
  margin-bottom: 18px;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* ============================================================
   Dashboard — Editorial "brief row" opportunity card
   Numbered, generous, kicker → headline → why.
   ============================================================ */

.opp-brief-list {
  list-style: none;
  margin: 0;
  padding: 4px 10px 10px;
  display: flex;
  flex-direction: column;
}

.opp-brief {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 28px;
  gap: 18px;
  align-items: start;
  padding: 20px 12px;
  margin: 0 -6px;
  border-top: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  cursor: pointer;
  position: relative;
  transition: background 140ms var(--ease);
}
.opp-brief:first-child { border-top-color: transparent; }
.opp-brief:hover { background: var(--bg-sunken); }
.opp-brief:hover + .opp-brief { border-top-color: transparent; }
.opp-brief:hover .opp-brief-arrow svg {
  transform: translate(2px, -2px);
  color: var(--accent);
}
.opp-brief:hover .opp-brief-fb { opacity: 1; transform: translateY(0); }

/* Number column */
.opp-brief-num {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-quaternary);
  letter-spacing: 0.04em;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.opp-brief-newdot {
  position: absolute;
  top: 8px;
  left: -10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Body column */
.opp-brief-body { min-width: 0; }

.opp-brief-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}
.opp-brief-kicker > * { white-space: nowrap; }

.opp-brief-tag {
  font-weight: 600;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
  font-size: 11px;
}
.opp-brief-tag.tier-high { color: var(--success-text); }
.opp-brief-tag.tier-med  { color: var(--warning-text); }
.opp-brief-tag.tier-low  { color: var(--text-quaternary); }
.opp-brief-tag.tier-new  { color: var(--accent-soft-text); }

.opp-brief-sub {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.opp-brief-sep  { color: var(--text-quaternary); }
.opp-brief-ago  { color: var(--text-tertiary); }

.opp-brief-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.014em;
  line-height: 1.35;
  margin: 0 0 8px;
  text-wrap: pretty;
}

.opp-brief-why {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 12px;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.opp-brief-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
  flex-wrap: wrap;
}
.opp-brief-foot-score {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.opp-brief-foot-sep { color: var(--text-quaternary); }

/* Actions column — quiet by default, reveals on hover */
.opp-brief-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 100%;
  min-height: 64px;
  padding-top: 2px;
}
.opp-brief-fb {
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
  pointer-events: auto;
  margin-top: auto;
}
.opp-brief-fb .feedback-btn {
  background: transparent;
  border-color: transparent;
  padding: 5px 7px;
}
.opp-brief-fb .feedback-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
}
.opp-brief-fb .feedback-btn.is-active { opacity: 1; }
.opp-brief:has(.feedback-btn.is-active) .opp-brief-fb { opacity: 1; transform: translateY(0); }

.opp-brief-arrow {
  color: var(--text-quaternary);
  display: inline-flex;
  padding-right: 2px;
  padding-top: 4px;
}
.opp-brief-arrow svg { transition: transform 180ms var(--ease-out), color 180ms var(--ease); }

.dash-card .opp-brief-list { padding: 4px 14px 12px; }

@media (max-width: 860px) {
  .opp-brief {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 10px;
  }
  .opp-brief-actions {
    grid-column: 2 / -1;
    flex-direction: row;
    justify-content: flex-start;
    min-height: 0;
    height: auto;
    padding-top: 6px;
  }
  .opp-brief-fb { opacity: 1; transform: none; }
  .opp-brief-title { font-size: 15px; }
}


/* ============================================================
   Detail Panel — editorial header
   ============================================================ */

.detail-header {
  padding: 16px 22px;
}

.detail-header-kicker {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.detail-header-pct {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.detail-header-pct-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-quaternary);
}

.detail-headline {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.detail-headline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
  flex-wrap: wrap;
}
.detail-headline-meta > * { white-space: nowrap; }
.detail-headline-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.detail-headline-meta-item svg { color: var(--text-quaternary); }

.detail-section h3.detail-headline-title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  text-wrap: pretty;
}


/* ============================================================
   Scan Dialog
   ============================================================ */

.scan-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 26, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 24px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease);
}
.scan-dialog-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.scan-dialog {
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 14vh);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: 0 24px 64px -16px rgba(20, 20, 26, 0.28),
              0 8px 16px -4px rgba(20, 20, 26, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scan-dialog-in 220ms var(--ease-out);
}
@keyframes scan-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.scan-dialog-header {
  position: relative;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.scan-dialog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.scan-dialog-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.scan-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
}
.scan-dialog-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 6px;
  text-wrap: pretty;
}
.scan-dialog-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  text-wrap: pretty;
  max-width: 52ch;
}
.scan-dialog-sub strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Presets */
.scan-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-sunken);
}
.scan-preset {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 140ms var(--ease), background 140ms var(--ease), box-shadow 140ms var(--ease);
}
.scan-preset:hover {
  border-color: var(--border-strong);
}
.scan-preset.is-active {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 1px var(--accent-border);
}
.scan-preset-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  margin-top: 1px;
  flex-shrink: 0;
}
.scan-preset.is-active .scan-preset-icon { color: var(--accent-soft-text); }
.scan-preset-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.scan-preset-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.scan-preset-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-preset-check {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--accent-soft-text);
}

/* Body */
.scan-dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 26px 22px;
}

.scan-section { margin: 0; }
.scan-section + .scan-rule { margin: 18px 0; }

.scan-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.scan-section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.scan-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-quaternary);
}
.scan-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 120ms var(--ease);
}
.scan-link:hover { color: var(--accent-soft-text); }
.scan-link-sep { color: var(--text-quaternary); }

.scan-rule {
  height: 1px;
  background: var(--border-subtle);
}

/* Radio rows (When) */
.scan-radio-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.scan-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms var(--ease), background 140ms var(--ease);
}
.scan-radio:hover { border-color: var(--border-strong); }
.scan-radio.is-on {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}
.scan-radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 140ms var(--ease);
}
.scan-radio.is-on .scan-radio-dot { border-color: var(--accent); }
.scan-radio-dot-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 140ms var(--ease-out);
}
.scan-radio.is-on .scan-radio-dot-inner { transform: scale(1); }
.scan-radio-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.scan-radio-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.scan-radio-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

/* Chip grid (Where, What) */
.scan-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.scan-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 140ms var(--ease), background 140ms var(--ease), color 140ms var(--ease);
  letter-spacing: -0.005em;
}
.scan-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.scan-chip.is-on {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-soft-text);
}
.scan-chip.is-on svg { color: var(--accent); }

/* How section: content type + threshold */
.scan-field {
  margin-top: 14px;
}
.scan-field:first-child { margin-top: 0; }
.scan-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.scan-field-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
  font-weight: 400;
}
.scan-field-meta strong {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.scan-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.scan-segmented-opt {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: calc(var(--r-md) - 3px);
  cursor: pointer;
  transition: background 140ms var(--ease), color 140ms var(--ease);
  letter-spacing: -0.005em;
}
.scan-segmented-opt:hover { color: var(--text-primary); }
.scan-segmented-opt.is-on {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(20,20,26,0.08), 0 0 0 1px var(--border-subtle);
}

/* Slider */
.scan-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  margin: 4px 0 6px;
}
.scan-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  box-shadow: 0 1px 3px rgba(20,20,26,0.18);
  cursor: pointer;
  transition: transform 120ms var(--ease-out);
}
.scan-slider::-webkit-slider-thumb:hover { transform: scale(1.08); }
.scan-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  cursor: pointer;
}
.scan-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-quaternary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Footer */
.scan-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px 16px;
  background: var(--bg-sunken);
  border-top: 1px solid var(--border-subtle);
}
.scan-estimate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.scan-estimate-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
  flex-wrap: wrap;
}
.scan-estimate-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.scan-estimate-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}
.scan-estimate-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.scan-estimate-time svg { color: var(--text-quaternary); }
.scan-estimate-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-quaternary);
  flex-shrink: 0;
  align-self: center;
}
.scan-estimate-note {
  font-size: 10.5px;
  color: var(--text-quaternary);
  letter-spacing: 0.01em;
}
.scan-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 720px) {
  .scan-dialog-overlay { padding: 4vh 12px 12px; }
  .scan-dialog { max-height: calc(100vh - 8vh); }
  .scan-dialog-header { padding: 18px 18px 14px; }
  .scan-dialog-body { padding: 16px 18px 18px; }
  .scan-dialog-footer { flex-direction: column; align-items: stretch; padding: 12px 16px 14px; }
  .scan-dialog-actions { justify-content: flex-end; }
  .scan-presets { grid-template-columns: repeat(2, 1fr); }
  .scan-radio-list { grid-template-columns: 1fr; }
  .scan-segmented { grid-template-columns: 1fr; }
}

/* ============================================================
   Legal pages — Terms of Service & Privacy Policy
   Editorial layout: hero, table of contents, numbered sections.
   Mounted as standalone routes (no app shell), so the page owns
   its own padding and background.
   ============================================================ */

.legal-page {
  min-height: 100vh;
  width: 100%;
  background:
    radial-gradient(ellipse 880px 360px at 50% -6%, var(--accent-subtle) 0%, transparent 70%),
    var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  padding: 24px max(20px, env(safe-area-inset-left)) 96px max(20px, env(safe-area-inset-right));
  position: relative;
}

.legal-top {
  max-width: 760px;
  margin: 0 auto 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}

.legal-back:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.legal-back svg {
  color: var(--text-tertiary);
  transition: transform 160ms var(--ease-out);
}

.legal-back:hover svg {
  transform: translateX(-2px);
  color: var(--text-primary);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}


.legal-shell {
  max-width: 760px;
  margin: 0 auto;
}

.legal-hero {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.legal-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.legal-title {
  font-family: var(--font-sans);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.034em;
  line-height: 1.05;
  color: var(--text-primary);
  margin: 0 0 16px;
  text-wrap: balance;
}

.legal-lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 18px;
  max-width: 620px;
  text-wrap: pretty;
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-meta strong {
  color: var(--text-primary);
  font-weight: 600;
}

.legal-meta-sep {
  color: var(--text-quaternary);
}

.legal-toc {
  margin: 0 0 56px;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
}

.legal-toc-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.legal-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 28px;
}

.legal-toc-list li {
  margin: 0;
}

.legal-toc-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}

.legal-toc-list a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-strong);
}

.legal-toc-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-quaternary);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  width: 22px;
}

.legal-body {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.legal-section {
  scroll-margin-top: 24px;
}

.legal-section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-section-num {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  opacity: 0.85;
  flex-shrink: 0;
}

.legal-section-title {
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 0;
  text-wrap: balance;
}

.legal-section-body {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
}

.legal-section-body p {
  margin: 0 0 14px;
}

.legal-section-body p:last-child {
  margin-bottom: 0;
}

.legal-section-body h3 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  margin: 24px 0 8px;
}

.legal-section-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-section-body ul li {
  position: relative;
  padding-left: 20px;
}

.legal-section-body ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

.legal-section-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.legal-section-body a {
  color: var(--accent-soft-text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-border);
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}

.legal-section-body a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.legal-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal-footer-note {
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.55;
  max-width: 540px;
}

.legal-footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.legal-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-soft-text);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid var(--accent-border);
  transition: color 140ms var(--ease), border-color 140ms var(--ease), gap 140ms var(--ease);
}

.legal-footer-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  gap: 8px;
}

.legal-footer-link-quiet {
  color: var(--text-secondary);
  border-bottom-color: var(--border-strong);
}

.legal-footer-link-quiet:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-secondary);
}

@media (max-width: 720px) {
  .legal-page {
    padding: 18px 16px 64px;
  }

  .legal-top {
    margin-bottom: 24px;
  }

  .legal-title {
    font-size: 32px;
  }

  .legal-lede {
    font-size: 15.5px;
  }

  .legal-toc {
    padding: 18px 18px;
  }

  .legal-toc-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .legal-section-title {
    font-size: 18px;
  }

  .legal-section-body {
    font-size: 14.5px;
  }
}

/* ============================================================
   Page footer — appears at the bottom of welcome and settings.
   Compact, calm: brand mark + legal links.
   ============================================================ */

.legal-page-footer {
  width: 100%;
}

.legal-page-footer-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.legal-page-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--text-tertiary);
}

.legal-page-footer-mark {
  width: 20px;
  height: 20px;
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.legal-page-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.legal-page-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}

.legal-page-footer-links a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-strong);
}

.legal-page-footer-sep {
  color: var(--text-quaternary);
}

.contact-page-shell {
  max-width: 760px;
  margin: 0 auto;
}

.contact-page-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(98, 208, 255, 0.12), transparent 36%),
    linear-gradient(180deg, var(--surface), rgba(255, 255, 255, 0.94));
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.08);
  padding: 34px;
}

.contact-page-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.contact-page-title {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.contact-page-copy {
  max-width: 560px;
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.contact-page-form {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}

.contact-page-field {
  display: grid;
  gap: 8px;
}

.contact-page-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.contact-page-field input,
.contact-page-field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  outline: none;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.contact-page-field input:focus,
.contact-page-field textarea:focus {
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.contact-page-field textarea {
  min-height: 148px;
  resize: vertical;
}

.contact-page-status {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.contact-page-status.is-success {
  background: linear-gradient(180deg, rgba(134, 239, 172, 0.28), rgba(74, 222, 128, 0.18));
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #15803d;
}

.contact-page-status.is-error {
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}

.contact-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 6px;
}

.contact-page-link {
  color: var(--text-secondary);
  text-decoration: none;
}

.contact-page-submit {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: #111827;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.contact-page-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Welcome variant: respects the welcome-v4 padding rhythm. */
.welcome-v4 .legal-page-footer-welcome {
  margin-top: 8px;
}

.welcome-v4 .legal-page-footer-welcome .legal-page-footer-inner {
  max-width: 980px;
  padding: 22px 0 4px;
}

/* Settings variant: aligns with the settings page max-width. */
.legal-page-footer-settings {
  margin-top: 24px;
}

.legal-page-footer-settings .legal-page-footer-inner {
  max-width: 860px;
  padding: 18px 0 0;
}

/* Mobile variant: stays compact and respects the mobile-page rhythm. */
.legal-page-footer-mobile {
  margin-top: 28px;
}

.legal-page-footer-mobile .legal-page-footer-inner {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 0 0;
  font-size: 12px;
}

.legal-page-footer-mobile .legal-page-footer-links {
  font-size: 12px;
  gap: 8px;
}

@media (max-width: 720px) {
  .legal-page-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .contact-page-card {
    padding: 22px;
    border-radius: 22px;
  }
  .contact-page-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
