:root {
  color-scheme: light;
  --ink: #060917;
  --muted: #485073;
  --subtle: #7b82a3;
  --line: #e7e9f3;
  --panel: #ffffff;
  --accent: #3b18ff;
  --accent-strong: #2100e8;
  --accent-soft: #ede9ff;
  --success: #03b949;
  --warning: #ff5c00;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  overflow: hidden;
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 800;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 25px;
  border-radius: 6px;
  background: #ff3d10;
}

.brand-mark::after {
  position: absolute;
  bottom: -9px;
  left: 10px;
  width: 14px;
  height: 14px;
  background: #ff3d10;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  content: "";
}

.brand-mark span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #fff;
}

.main-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 100px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}

.nav-link.active {
  color: var(--accent);
}

.nav-content {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-content svg {
  width: 1.25rem;
  height: 1.25rem;
}

.nav-link.active .nav-content::after {
  position: absolute;
  left: -6px;
  bottom: -15px;
  width: calc(100% + 12px);
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.profile {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 164px;
  height: 42px;
  padding: 0 0 0 6px;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
}

.profile img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #eadfd8;
}

.profile svg {
  width: 18px;
  height: 18px;
  color: #23315f;
}

.app-shell {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  height: calc(100vh - 72px);
  min-height: 0;
  padding: 20px 24px 18px;
  overflow: hidden;
}

.app-view {
  display: none;
}

.app-view.active {
  display: grid;
}

.product-shell.app-view.active {
  display: block;
}

.inbox-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.inbox-panel,
.content-card {
  scrollbar-width: none;
}

.inbox-panel::-webkit-scrollbar,
.content-card::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.inbox-sticky-top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-bottom: 10px;
  background: #fff;
}

.inbox-sticky-top::before {
  position: absolute;
  inset: -20px -4px -10px 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: #fff;
}

.inbox-sticky-top::after {
  position: absolute;
  left: 0;
  right: -4px;
  bottom: -30px;
  z-index: -1;
  height: 30px;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.88) 42%, rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.inbox-panel.has-scroll .inbox-sticky-top::after {
  opacity: 1;
}

.cron-status {
  position: relative;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 0 0 12px;
  color: #101942;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  box-shadow: none;
}

.cron-status div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cron-status span {
  color: #435174;
  font-size: 11px;
  font-weight: 750;
}

.cron-status strong {
  color: #0b56c5;
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cron-status i {
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: #d8eaff;
  border-radius: 999px;
}

.cron-status i::before {
  display: block;
  width: var(--scan-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, #0b56c5, #23ba49);
  border-radius: inherit;
  content: "";
  transition: width 0.4s ease;
}

.cron-status.scanning {
  background: #eef6ff;
  animation: scan-pulse 1.1s ease-in-out infinite;
}

.cron-status.scanning strong {
  color: #ff5c00;
}

.cron-status.scan-complete {
  background: #f2fbf5;
}

.cron-status.scan-complete strong {
  color: var(--success);
}

.mode-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  background: #fff;
}

.mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 800;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
}

.mode.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.list-tools {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 4px 0 0;
  color: var(--ink);
  background: #fff;
  font-weight: 500;
}

.filter-toggle {
  position: relative;
  z-index: 25;
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 100%;
  height: 36px;
  padding: 3px;
  background: #f7f8fd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.filter-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 28px;
  padding: 0 6px;
  color: var(--ink);
  background: transparent;
  border-radius: 5px;
  font-weight: 750;
  font-size: 12px;
  text-align: center;
}

.filter-option:hover,
.filter-option.selected {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 5px 14px rgba(59, 24, 255, 0.1);
}

.filter-option span {
  width: auto;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.lead-list {
  display: grid;
  gap: 10px;
  padding: 26px 0 8px;
}

.lead-list.scan-refreshing .lead-card {
  animation: row-scan 0.9s ease-in-out infinite;
}

.lead-list.scan-complete .lead-card:nth-child(-n + 4) {
  animation: row-arrive 0.7s ease both;
}

.lead-loading {
  padding: 18px 14px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.load-more-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 14px 16px;
}

.load-more-spinner span {
  width: 16px;
  height: 16px;
  border: 2px solid #d8e1f5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.lead-card {
  position: relative;
  z-index: 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #fff8f2;
}

.lead-card.read {
  background: #fff;
}

.lead-card.unread::after {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff5c00;
  box-shadow: 0 0 0 3px rgba(255, 92, 0, 0.1);
  content: "";
}

.lead-card.selected {
  z-index: 2;
  border-color: #c8b7ff;
  box-shadow: 0 14px 34px rgba(59, 24, 255, 0.08);
}

.lead-card.completed {
  border-color: #c7ead6;
  background: #f3fbf6;
}

.lead-card.completed.selected {
  border-color: #79d69d;
  box-shadow: 0 14px 34px rgba(35, 186, 73, 0.10);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.avatar.navy { background: #13234f; }
.avatar.orange { background: #ff5c00; }
.avatar.green { background: #23ba49; }
.avatar.blue { background: #0b56c5; }
.avatar.sky { background: #38a9ff; }

.lead-card.completed .avatar {
  background: var(--success);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.lead-card.completed .lead-copy h3,
.lead-card.completed .lead-copy .meta,
.lead-card.completed .lead-copy .meta + p,
.lead-card.completed .score {
  color: #5c6f67;
}

.lead-card.completed .lead-copy .meta span {
  color: #239b52;
}

.lead-copy {
  min-width: 0;
}

.lead-copy h3 {
  margin: 0 0 2px;
  color: #1300ff;
  font-size: 13px;
  line-height: 1.2;
}

.lead-copy p {
  margin: 0;
}

.lead-copy .meta {
  color: #25305d;
  font-size: 11px;
  font-weight: 600;
}

.lead-copy .meta span {
  color: var(--success);
}

.lead-copy .meta.medium span {
  color: var(--warning);
}

.lead-copy .meta.low span {
  color: #1071ff;
}

.lead-copy .meta + p {
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #030712;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
}

.score {
  display: grid;
  gap: 2px;
  justify-items: center;
  color: var(--accent);
}

.score strong {
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.score strong.compact-value {
  font-size: 12px;
}

.score span {
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.chevron {
  position: absolute;
  right: 10px;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.content-card {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.post-card {
  padding: 20px 20px 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2,
.response-card h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.icon-button,
.open-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #263272;
  background: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.icon-button svg,
.open-button svg {
  width: 18px;
  height: 18px;
}

.icon-button:hover,
.open-button:hover {
  border-color: #d7dcf0;
}

.post-meta {
  margin: 16px 0 16px;
  color: #303866;
  font-size: 13px;
  font-weight: 600;
}

.post-card h1 {
  margin: 0 0 18px;
  max-width: 740px;
  font-size: 16px;
  line-height: 1.45;
}

.post-card h1[hidden] {
  display: none;
}

.post-body {
  color: #0b1024;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.62;
}

.post-body p {
  margin: 0 0 16px;
}

.post-body ul {
  margin: -8px 0 24px 24px;
  padding: 0;
}

.post-body li {
  padding-left: 8px;
  margin: 8px 0;
}

.subreddit-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.subreddit-stats div {
  min-width: 0;
  padding: 10px;
  background: #f7f8fd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.subreddit-stats span {
  display: block;
  margin: 0 0 6px;
  color: #667085;
  font-size: 10px;
  font-weight: 700;
}

.subreddit-stats strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.1;
}

.subreddit-context {
  margin-top: 18px;
}

.subreddit-description {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.subreddit-description div {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 10px 8px;
  color: var(--accent);
  background: #f6f4ff;
  border: 1px solid #ded7ff;
  border-radius: var(--radius);
}

.subreddit-description span {
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.subreddit-description strong {
  font-size: 20px;
  line-height: 1;
}

.subreddit-description p {
  margin: 0;
}

.original-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 14px;
  margin-top: 26px;
  padding: 14px;
  background: #f8f9ff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.original-context .context-meta {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.original-context h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.original-context p {
  margin: 0;
  color: #303866;
  font-size: 13px;
  line-height: 1.5;
}

.context-open {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--accent);
  background: #fff;
  border: 1px solid #dcd8ff;
  border-radius: var(--radius);
}

.context-open:hover {
  background: var(--accent-soft);
}

.dots {
  margin-left: auto;
  color: #263272;
  background: transparent;
  font-size: 18px;
  letter-spacing: 3px;
}

.response-card {
  padding: 20px 24px 18px;
}

.response-card h2 {
  padding-top: 2px;
  color: #1000ff;
}

.response-kicker {
  margin: 14px 0 20px;
  color: #2f3767;
  font-weight: 500;
}

.response-copy {
  margin-top: 28px;
  min-height: 280px;
  color: #0b1024;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
}

.response-copy.typing,
.response-copy.generated {
  position: relative;
  margin-inline: -10px;
  padding: 10px;
  color: #070b1d;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(120deg, rgba(59, 24, 255, 0.55), rgba(0, 184, 148, 0.32), rgba(59, 24, 255, 0.55)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow:
    0 16px 34px rgba(59, 24, 255, 0.12),
    inset 0 0 28px rgba(59, 24, 255, 0.05);
  animation: response-pulse 1.6s ease-in-out infinite;
}

.response-copy.generated {
  animation: response-settle 1.4s ease-out;
}

.response-copy p {
  margin: 0 0 21px;
  white-space: pre-wrap;
}

.typing-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: var(--accent);
  transform: translateY(2px);
  animation: caret-blink 760ms steps(1) infinite;
}

.response-actions {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  margin-top: auto;
  padding-top: 30px;
}

.response-actions.generated {
  grid-template-columns: 128px 112px 1fr;
}

.copy-button {
  min-height: 50px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(59, 24, 255, 0.24);
}

.regenerate-button {
  min-height: 50px;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-weight: 800;
}

.regenerate-button:hover {
  background: var(--accent-soft);
}

.copy-button:disabled {
  cursor: wait;
  background: #2100e8;
  box-shadow: 0 18px 40px rgba(59, 24, 255, 0.32);
}

.style-menu {
  position: relative;
}

.style-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-weight: 800;
}

.style-button svg {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.style-menu.open .style-button svg {
  transform: rotate(180deg);
}

.style-options {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: grid;
  gap: 4px;
  width: 132px;
  padding: 6px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.13);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
}

.style-menu.open .style-options {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.style-option {
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  border-radius: 6px;
  font-weight: 750;
  text-align: left;
}

.style-option:hover,
.style-option.selected {
  color: var(--accent);
  background: var(--accent-soft);
}

.disclaimer {
  margin: 14px 0 0;
  color: #485073;
  font-size: 12px;
  font-weight: 500;
}

.product-shell {
  height: calc(100vh - 72px);
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px 18px;
  background: #fff;
  scrollbar-width: none;
}

.product-shell::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.product-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: start;
  gap: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.product-header h1 {
  margin: 0 0 3px;
  font-size: 22px;
  line-height: 1.2;
}

.product-header p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.product-url-form label,
.field-stack label {
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.product-url-form {
  padding-top: 4px;
}

.product-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px;
  gap: 10px;
}

.product-url-row input,
.field-stack textarea {
  width: 100%;
  color: #252b45;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 400;
}

.product-url-row input {
  height: 42px;
  padding: 0 12px;
}

.product-url-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(59, 24, 255, 0.14);
}

.product-regenerate {
  height: 42px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(59, 24, 255, 0.18);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: start;
  gap: 14px;
  padding-top: 14px;
}

.product-panel {
  min-width: 0;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.product-wide {
  grid-column: auto;
}

.product-summary {
  grid-column: 1;
  grid-row: span 2;
}

.product-positioning {
  grid-column: 2;
}

.product-side-stack {
  grid-column: 3;
  display: grid;
  gap: 14px;
}

.product-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.product-panel h2 {
  margin: 0 0 16px;
  font-size: 16px;
}

.product-panel-heading h2 {
  margin-bottom: 0;
}

.product-panel-heading + .signal-list,
.product-panel-heading + .keyword-cloud {
  margin-top: 16px;
}

.product-status {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.product-panel dl {
  display: grid;
  gap: 16px;
  margin: 18px 0 0;
}

.product-panel dt {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
}

.product-panel dd {
  margin: 0;
  color: #252b45;
  font-weight: 400;
  line-height: 1.45;
}

.field-stack {
  display: grid;
  gap: 14px;
}

.field-stack textarea {
  min-height: 88px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.product-save {
  display: block;
  width: 96px;
  height: 36px;
  margin: 14px 0 0 auto;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(59, 24, 255, 0.18);
}

.product-save:disabled {
  cursor: default;
  color: #6b7280;
  background: #eef0f6;
  box-shadow: none;
}

.product-save:not(:disabled):hover {
  background: var(--accent-strong);
}

.signal-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: #252b45;
  font-weight: 400;
  line-height: 1.45;
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-cloud span {
  padding: 8px 10px;
  color: #303866;
  background: #f4f6fb;
  border: 1px solid #e3e6f3;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.analytics-shell {
  height: calc(100vh - 72px);
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px 18px;
  background: #fff;
  scrollbar-width: none;
}

.analytics-shell.app-view.active {
  display: block;
}

.analytics-shell::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.analytics-header h1 {
  margin: 0 0 3px;
  font-size: 22px;
  line-height: 1.2;
}

.analytics-header p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.analytics-range {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  gap: 4px;
  padding: 4px;
  background: #f7f8fd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.analytics-range button {
  height: 32px;
  color: var(--muted);
  background: transparent;
  border-radius: 5px;
  font-weight: 800;
}

.analytics-range button.active {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 5px 14px rgba(59, 24, 255, 0.1);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
}

.metric-card,
.analytics-panel {
  min-width: 0;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.metric-card p {
  margin: 10px 0 0;
  color: #485073;
  font-size: 13px;
  line-height: 1.45;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
}

.analytics-panel {
  grid-column: span 2;
}

.analytics-wide {
  grid-column: span 4;
}

.analytics-panel h2 {
  margin: 0 0 16px;
  font-size: 16px;
}

.bar-list,
.funnel-list,
.source-list {
  display: grid;
  gap: 12px;
}

.bar-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.bar-list span,
.funnel-list span,
.source-list span {
  color: #252b45;
  font-weight: 500;
}

.bar-list strong,
.funnel-list strong,
.source-list strong {
  text-align: right;
  color: var(--ink);
}

.bar-list i {
  grid-column: 1 / -1;
  display: block;
  height: 8px;
  overflow: hidden;
  background: #eef0f6;
  border-radius: 999px;
}

.bar-list i::before {
  display: block;
  width: var(--bar);
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  content: "";
}

.funnel-list div,
.source-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #eef0f6;
}

.funnel-list div:last-child,
.source-list div:last-child {
  border-bottom: 0;
}

@keyframes response-pulse {
  0%,
  100% {
    box-shadow:
      0 16px 34px rgba(59, 24, 255, 0.1),
      inset 0 0 28px rgba(59, 24, 255, 0.04);
  }

  50% {
    box-shadow:
      0 20px 46px rgba(59, 24, 255, 0.18),
      inset 0 0 34px rgba(0, 184, 148, 0.08);
  }
}

@keyframes response-settle {
  from {
    transform: translateY(2px);
    opacity: 0.84;
    filter: drop-shadow(0 14px 24px rgba(59, 24, 255, 0.2));
  }

  to {
    transform: translateY(0);
    opacity: 1;
    filter: drop-shadow(0 0 0 rgba(59, 24, 255, 0));
  }
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

@keyframes scan-pulse {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(16, 76, 160, 0.06);
  }

  50% {
    box-shadow: 0 12px 30px rgba(16, 76, 160, 0.16);
  }
}

@keyframes row-scan {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(2px);
  }
}

@keyframes row-arrive {
  from {
    transform: translateY(4px);
    background: #eef6ff;
  }

  to {
    transform: translateY(0);
  }
}

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

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }

  .brand,
  .profile {
    justify-self: center;
  }

  .main-nav {
    order: 3;
    width: 100%;
    min-height: 48px;
  }

  .app-shell {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .response-card {
    grid-column: 2;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid,
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-panel,
  .analytics-wide {
    grid-column: span 2;
  }

  .product-wide {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .topbar {
    position: static;
  }

  .main-nav {
    overflow-x: auto;
    justify-content: flex-start;
    gap: 28px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
    padding: 18px;
  }

  .inbox-panel,
  .content-card {
    max-height: 72vh;
  }

  .response-card {
    grid-column: auto;
  }

  .product-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 18px;
  }

  .analytics-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 18px;
  }

  .analytics-header {
    display: grid;
  }

  .product-header,
  .product-grid,
  .metric-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-panel,
  .analytics-wide {
    grid-column: auto;
  }

  .product-wide {
    grid-column: auto;
  }

  .list-tools {
    position: static;
    margin-inline: 0;
  }

  .inbox-sticky-top,
  .mode-grid {
    position: static;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 24px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .list-tools {
    grid-template-columns: 1fr;
  }

  .lead-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .score {
    grid-column: 2;
    justify-items: start;
  }

  .chevron {
    top: 16px;
  }

  .post-card,
  .response-card {
    padding: 20px;
  }

  .response-actions {
    grid-template-columns: 1fr 104px;
  }

  .product-url-row {
    grid-template-columns: 1fr;
  }
}
