:root {
  --ink: #202725;
  --muted: #68716d;
  --muted-2: #89918d;
  --line: #dfe4e1;
  --line-strong: #cbd3cf;
  --canvas: #f3f5f2;
  --panel: #ffffff;
  --sidebar: #1d2725;
  --sidebar-soft: #293431;
  --teal: #087f70;
  --teal-dark: #06685d;
  --teal-soft: #e7f4f0;
  --coral: #d65f4a;
  --coral-soft: #faebe7;
  --amber: #c58a18;
  --amber-soft: #fff4d9;
  --blue: #3974b9;
  --blue-soft: #e9f1fb;
  --purple: #7b5aa6;
  --purple-soft: #f0eaf7;
  --danger: #b83d3d;
  --danger-soft: #fbeaea;
  --shadow: 0 8px 24px rgba(31, 49, 44, 0.07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

svg {
  display: block;
}

[data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

.app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  padding: 19px 14px 16px;
  background: var(--sidebar);
  color: #f4f7f5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  padding: 0 8px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #e4ba51;
  color: #18211f;
}

.brand-mark [data-lucide] {
  width: 21px;
  height: 21px;
  stroke-width: 2.2;
}

.brand > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  color: #9eaaa5;
  font-size: 10px;
  text-transform: uppercase;
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 28px;
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #aeb8b4;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--sidebar-soft);
  color: #ffffff;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 24px;
  border-radius: 0 3px 3px 0;
  background: #e4ba51;
}

.nav-item span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-count {
  min-width: 24px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #dce4e0;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-section {
  margin-top: auto;
  padding: 0 7px 18px;
}

.sidebar-label {
  margin-bottom: 10px;
  color: #77847e;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-sources {
  display: grid;
  gap: 9px;
}

.sidebar-source {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 8px;
  color: #b7c1bd;
  font-size: 11px;
}

.sidebar-source > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-mini-mark {
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2725;
  font-size: 10px;
  font-weight: 800;
}

.source-mini-mark.google {
  color: #2c69b3;
}

.source-mini-mark.tiktok {
  background: #101111;
  color: #ffffff;
}

.source-mini-mark.pinterest {
  color: #b92a36;
}

.source-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #737d78;
}

.source-state-dot.live,
.source-state-dot.online {
  background: #55b69f;
  box-shadow: 0 0 0 3px rgba(85, 182, 159, 0.12);
}

.source-state-dot.auth {
  background: #dfab38;
}

.source-state-dot.manual {
  background: #7f97b5;
}

.sidebar-footer {
  min-height: 54px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sidebar-footer strong {
  color: #d9e0dd;
  font-size: 11px;
}

.sidebar-footer small {
  overflow: hidden;
  color: #77847e;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #808b86;
}

.connection-dot.online {
  background: #4dc19f;
  box-shadow: 0 0 0 4px rgba(77, 193, 159, 0.12);
}

.connection-dot.offline {
  background: #d56b5a;
}

.sidebar-scrim {
  display: none;
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.topbar-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title > div {
  min-width: 0;
}

.topbar-title p {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.market-control {
  height: 39px;
  display: grid;
  grid-template-columns: auto 138px;
  align-items: center;
  gap: 8px;
  padding-left: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.market-control span {
  color: var(--muted);
  font-size: 11px;
}

.market-control select {
  height: 37px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
  background: #ffffff;
  color: var(--ink);
  padding: 0 26px 0 10px;
  outline: none;
  font-weight: 650;
}

.sync-time {
  min-width: 90px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: right;
}

.mobile-menu {
  display: none !important;
}

.content-shell {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 22px 24px 36px;
}

.view[hidden] {
  display: none !important;
}

.view.active {
  animation: view-in 160ms ease-out;
}

@keyframes view-in {
  from {
    opacity: 0.55;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.button,
.icon-only,
.text-button {
  border: 1px solid transparent;
  outline: none;
}

.button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 7px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.button.primary:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.button.secondary {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--ink);
}

.button.secondary:hover {
  border-color: #9caaa4;
  background: #f7f9f8;
}

.button.danger {
  border-color: #edc3c3;
  background: var(--danger-soft);
  color: var(--danger);
}

.button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.button.loading [data-lucide],
.analysis-loading [data-lucide] {
  animation: spin 850ms linear infinite;
}

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

.icon-only {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border-color: var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}

.icon-only:hover {
  border-color: #9caaa4;
  background: #f7f9f8;
}

.icon-only.subtle {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.icon-only.subtle:hover {
  border-color: var(--line);
  background: #f4f6f5;
  color: var(--ink);
}

.icon-only.danger-soft {
  border-color: #edc3c3;
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-only.danger-text {
  color: var(--danger);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  background: transparent;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 650;
}

.text-button [data-lucide] {
  width: 15px;
  height: 15px;
}

.section-kicker {
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 6px 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(31, 49, 44, 0.05);
}

.metric-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-row: 1;
  border-radius: 8px;
}

.metric-icon.teal {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.metric-icon.coral {
  background: var(--coral-soft);
  color: var(--coral);
}

.metric-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.metric-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.metric-card > div:nth-child(2) {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

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

.metric-card strong {
  font-size: 27px;
  line-height: 1;
}

.metric-card small {
  grid-column: 1 / -1;
  color: var(--muted-2);
  font-size: 10px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.opportunity-panel,
.queue-panel {
  min-height: 338px;
}

.distribution-panel,
.coverage-panel {
  min-height: 235px;
}

.opportunity-list,
.queue-list,
.coverage-list {
  display: grid;
}

.opportunity-row {
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: 32px 38px minmax(170px, 1fr) 76px 74px 42px;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.opportunity-row:last-child {
  border-bottom: 0;
}

.opportunity-row:hover {
  background: #f8faf9;
}

.rank-number {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
}

.opportunity-copy,
.product-cell > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.opportunity-copy strong,
.opportunity-copy small,
.product-cell strong,
.product-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-copy strong,
.product-cell strong {
  font-size: 13px;
}

.opportunity-copy small,
.product-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.category-avatar {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #d9e6e1;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.category-avatar [data-lucide] {
  width: 19px;
  height: 19px;
}

.category-beauty,
.category-kids {
  border-color: #ebd9e2;
  background: #f8edf2;
  color: #b35179;
}

.category-outdoor,
.category-sports {
  border-color: #dce4cb;
  background: #f0f4e7;
  color: #6b7d33;
}

.category-electronics,
.category-car {
  border-color: #d5e0ec;
  background: #ecf2f8;
  color: #476c96;
}

.category-kitchen,
.category-home {
  border-color: #eadfc9;
  background: #f8f2e7;
  color: #9a7330;
}

.category-travel {
  border-color: #ddd5eb;
  background: #f2eef8;
  color: #765c9e;
}

.mini-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mini-trend [data-lucide] {
  width: 14px;
  height: 14px;
}

.mini-trend.up,
.growth-value.up,
.analysis-metrics strong.up {
  color: var(--teal);
}

.mini-trend.down,
.growth-value.down,
.analysis-metrics strong.down {
  color: var(--coral);
}

.score-number {
  text-align: right;
  font-size: 17px;
  font-weight: 800;
}

.priority-badge,
.state-pill,
.season-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.priority-badge.strong {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.priority-badge.verify {
  background: var(--amber-soft);
  color: #86600e;
}

.priority-badge.watch {
  background: var(--blue-soft);
  color: #315f93;
}

.priority-badge.drop {
  background: var(--danger-soft);
  color: var(--danger);
}

.distribution-chart {
  width: 100%;
  height: 270px;
  padding: 6px 8px;
}

.distribution-chart.fallback {
  height: auto;
  display: grid;
  gap: 17px;
  padding: 18px 16px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 54px minmax(70px, 1fr) 24px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.distribution-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0ee;
}

.distribution-track i {
  height: 100%;
  display: block;
  min-width: 0;
  border-radius: inherit;
}

.distribution-track .strong {
  background: var(--teal);
}

.distribution-track .verify {
  background: #d5a138;
}

.distribution-track .watch {
  background: var(--blue);
}

.distribution-track .drop {
  background: var(--coral);
}

.distribution-row strong {
  color: var(--ink);
  text-align: right;
}

.queue-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.queue-row:last-child {
  border-bottom: 0;
}

.queue-row:hover {
  background: #f8faf9;
}

.queue-row > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.queue-row strong,
.queue-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-row strong {
  font-size: 12px;
}

.queue-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.queue-row > [data-lucide] {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.queue-check {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
}

.queue-check [data-lucide] {
  width: 15px;
  height: 15px;
}

.coverage-row {
  min-height: 57px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--line);
}

.coverage-row:last-child {
  border-bottom: 0;
}

.coverage-row > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.coverage-row strong {
  font-size: 11px;
}

.coverage-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-logo {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.source-logo.google {
  border-color: #cfdff1;
  color: #2f70bb;
}

.source-logo.tiktok {
  border-color: #111514;
  background: #111514;
  color: #ffffff;
}

.source-logo.pinterest {
  border-color: #efd3d6;
  color: #b92a36;
}

.state-pill.live {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.state-pill.auth {
  background: var(--amber-soft);
  color: #86600e;
}

.state-pill.manual {
  background: var(--blue-soft);
  color: #315f93;
}

.state-pill.offline {
  background: var(--danger-soft);
  color: var(--danger);
}

.inline-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.discover-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 12px;
}

.discover-command {
  position: relative;
  min-height: 172px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 18px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.discover-copy h2 {
  font-size: 22px;
}

.discover-copy > p:last-child {
  max-width: 610px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.discover-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 148px 82px auto;
  align-items: end;
  gap: 10px;
}

.keyword-input {
  position: relative;
  display: block;
}

.keyword-input [data-lucide] {
  position: absolute;
  left: 11px;
  top: 50%;
  z-index: 1;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.keyword-input input {
  padding-left: 34px;
}

.control-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.control-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.control-field input,
.control-field select,
.control-field textarea,
.toolbar-actions select,
.search-box,
.status-select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.control-field input,
.control-field select,
.toolbar-actions select,
.status-select {
  min-height: 39px;
  padding: 0 10px;
}

.control-field textarea {
  min-height: 76px;
  padding: 9px 10px;
  resize: vertical;
}

.control-field input:focus,
.control-field select:focus,
.control-field textarea:focus,
.toolbar-actions select:focus,
.search-box:focus-within,
.status-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 127, 112, 0.12);
}

.discover-run {
  min-width: 154px;
}

.market-pulse-panel {
  min-width: 0;
  min-height: 172px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.pulse-header {
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
}

.pulse-header h2 {
  margin-top: 1px;
  font-size: 15px;
}

.pulse-status {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef1ef;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.pulse-status i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-2);
}

.pulse-status.live {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.pulse-status.live i {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 127, 112, 0.12);
}

.pulse-status.loading {
  background: var(--amber-soft);
  color: #86600e;
}

.pulse-status.loading i {
  background: var(--amber);
  animation: pulse-status 850ms ease-in-out infinite alternate;
}

.pulse-content {
  height: 118px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
}

.market-pulse-chart {
  width: 132px;
  height: 118px;
}

.pulse-stats {
  min-width: 0;
  display: grid;
  padding-right: 13px;
}

.pulse-stats div {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #edf0ee;
}

.pulse-stats div:last-child {
  border-bottom: 0;
}

.pulse-stats span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.pulse-stats strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

@keyframes pulse-status {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.provenance-strip {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 10px 0 16px;
  padding: 7px 12px;
  border: 1px solid #d9dedb;
  border-radius: 7px;
  background: #edf0ee;
  color: #5f6964;
  font-size: 10px;
}

.provenance-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.provenance-strip span + span {
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
}

.provenance-strip [data-lucide] {
  width: 14px;
  height: 14px;
}

.tippy-box[data-theme~="radar"] {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: var(--sidebar);
  box-shadow: 0 8px 20px rgba(16, 27, 24, 0.2);
  color: #ffffff;
  font-size: 11px;
  font-weight: 650;
}

.tippy-box[data-theme~="radar"][data-placement^="top"] > .tippy-arrow::before {
  border-top-color: var(--sidebar);
}

.tippy-box[data-theme~="radar"][data-placement^="bottom"] > .tippy-arrow::before {
  border-bottom-color: var(--sidebar);
}

.tippy-box[data-theme~="radar"][data-placement^="left"] > .tippy-arrow::before {
  border-left-color: var(--sidebar);
}

.tippy-box[data-theme~="radar"][data-placement^="right"] > .tippy-arrow::before {
  border-right-color: var(--sidebar);
}

.results-header {
  min-height: 47px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.results-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  font-size: 10px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.up {
  background: var(--teal);
}

.legend-dot.stable {
  background: var(--blue);
}

.legend-dot.down {
  background: var(--coral);
}

.result-board {
  min-width: 0;
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.signal-row {
  min-width: 1070px;
  min-height: 106px;
  display: grid;
  grid-template-columns: 42px minmax(300px, 1.5fr) 170px 178px 82px 206px;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 13px rgba(31, 49, 44, 0.04);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.signal-row:hover {
  border-color: #bec9c4;
  box-shadow: 0 7px 20px rgba(31, 49, 44, 0.07);
  transform: translateY(-1px);
}

.signal-rank {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 3px;
}

.signal-rank span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.rank-line {
  width: 1px;
  flex: 1;
  background: var(--line);
}

.signal-product {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.signal-product .category-avatar {
  width: 46px;
  height: 46px;
}

.signal-product > div {
  min-width: 0;
}

.product-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.product-title-line h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.season-badge {
  min-height: 20px;
  gap: 3px;
  padding: 0 6px;
  background: var(--amber-soft);
  color: #85610e;
  font-size: 9px;
}

.season-badge [data-lucide] {
  width: 11px;
  height: 11px;
}

.signal-product p {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-list {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.tag-list span {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 5px;
  background: #f0f2f1;
  color: #69736f;
  font-size: 9px;
  white-space: nowrap;
}

.signal-source-scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.score-chip {
  position: relative;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
}

.score-chip b {
  color: var(--muted);
  font-size: 9px;
}

.score-chip strong {
  margin-top: 1px;
  font-size: 15px;
}

.score-chip.google strong {
  color: #2f70bb;
}

.score-chip.tiktok strong {
  color: #242826;
}

.score-chip.pinterest strong {
  color: #b92a36;
}

.mode-dot {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9ba39f;
}

.mode-dot.live {
  background: var(--teal);
}

.mode-dot.manual {
  background: var(--blue);
}

.mode-dot.estimated {
  background: var(--amber);
}

.trend-cell {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trend-head small {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.growth-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.growth-value [data-lucide] {
  width: 13px;
  height: 13px;
}

.sparkline {
  width: 100%;
  height: 45px;
  color: var(--blue);
}

.sparkline.up {
  color: var(--teal);
}

.sparkline.down {
  color: var(--coral);
}

.sparkline-empty {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  color: var(--muted-2);
  font-size: 10px;
}

.result-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.result-score > strong {
  font-size: 24px;
  line-height: 1;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.result-actions .icon-only {
  width: 34px;
  height: 34px;
}

.result-skeleton {
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.result-skeleton::after {
  content: "";
  display: block;
  width: 36%;
  height: 100%;
  background: rgba(230, 235, 232, 0.78);
  animation: skeleton-move 1s ease-in-out infinite alternate;
}

@keyframes skeleton-move {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(300%);
  }
}

.board-empty,
.empty-state {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
}

.board-empty [data-lucide],
.empty-state [data-lucide] {
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  color: var(--muted-2);
}

.board-empty strong,
.empty-state strong {
  color: var(--ink);
}

.board-empty span,
.empty-state span {
  font-size: 11px;
}

.workspace-toolbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.toolbar-actions select {
  width: 126px;
  min-height: 38px;
  padding: 0 8px;
  font-size: 11px;
}

.search-box {
  width: 220px;
  min-height: 38px;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0 9px;
}

.search-box [data-lucide] {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
}

.candidate-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.table-summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.table-summary span:first-child {
  color: var(--ink);
  font-weight: 700;
}

.candidate-table-wrap {
  overflow: auto;
}

.candidate-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  table-layout: fixed;
}

.candidate-table th,
.candidate-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.candidate-table th {
  height: 40px;
  background: #f6f8f7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.candidate-table td {
  height: 68px;
  background: #ffffff;
}

.candidate-table tbody tr:hover td {
  background: #fafcfb;
}

.candidate-table tbody tr:last-child td {
  border-bottom: 0;
}

.candidate-table th:nth-child(1) {
  width: 250px;
}

.candidate-table th:nth-child(2) {
  width: 105px;
}

.candidate-table th:nth-child(3) {
  width: 154px;
}

.candidate-table th:nth-child(4) {
  width: 155px;
}

.candidate-table th:nth-child(5) {
  width: 120px;
}

.candidate-table th:nth-child(6) {
  width: 128px;
}

.candidate-table th:nth-child(7) {
  width: 86px;
}

.candidate-table th:nth-child(8) {
  width: 120px;
}

.product-cell {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.market-label {
  display: block;
  font-size: 12px;
  font-weight: 750;
}

.table-subline {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.table-scores {
  display: flex;
  gap: 5px;
}

.table-scores span {
  min-width: 40px;
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #f2f4f3;
  font-size: 10px;
  font-weight: 750;
}

.table-scores .google {
  background: var(--blue-soft);
  color: #315f93;
}

.table-scores .tiktok {
  background: #eceeed;
  color: #303533;
}

.table-scores .pinterest {
  background: var(--coral-soft);
  color: #a54545;
}

.table-trend {
  display: grid;
  grid-template-columns: 92px auto;
  align-items: center;
  gap: 7px;
}

.table-trend .sparkline {
  width: 92px;
  height: 34px;
}

.table-trend .growth-value {
  font-size: 9px;
}

.judgement-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.judgement-cell > strong {
  font-size: 19px;
}

.status-select {
  min-height: 34px;
  padding: 0 7px;
  font-size: 10px;
}

.date-cell {
  color: var(--muted);
  font-size: 10px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.row-actions .icon-only {
  width: 32px;
  height: 32px;
}

.row-actions [data-lucide] {
  width: 15px;
  height: 15px;
}

.candidate-panel .empty-state {
  border: 0;
  border-radius: 0;
}

.sources-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 14px;
}

.source-list-panel,
.weight-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.source-heading {
  min-height: 72px;
}

.source-count {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 700;
}

.source-cards {
  display: grid;
}

.source-card-row {
  min-height: 138px;
  display: grid;
  grid-template-columns: 48px minmax(230px, 1fr) 195px auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.source-card-row:last-child {
  border-bottom: 0;
}

.source-logo.large {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.source-main {
  min-width: 0;
}

.source-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-main p {
  margin-top: 6px;
  color: var(--ink);
  font-size: 12px;
}

.source-main small {
  display: block;
  max-width: 650px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.source-meta {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.source-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.source-meta [data-lucide] {
  width: 14px;
  height: 14px;
}

.weight-panel {
  position: sticky;
  top: 91px;
}

.weight-list {
  display: grid;
  gap: 19px;
  padding: 18px 16px;
}

.weight-control {
  display: grid;
  gap: 10px;
}

.weight-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.weight-control strong {
  color: var(--muted);
}

.weight-control input {
  width: 100%;
  height: 6px;
  accent-color: var(--teal);
}

.weight-control.tiktok input {
  accent-color: #303533;
}

.weight-control.pinterest input {
  accent-color: #b92a36;
}

.weight-total {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.weight-total strong {
  color: var(--teal-dark);
  font-size: 15px;
}

.weight-total strong.warning {
  color: var(--amber);
}

.data-note {
  padding: 13px 16px 16px;
  color: var(--muted);
  font-size: 10px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  justify-content: flex-end;
  background: rgba(18, 26, 24, 0.38);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.drawer-backdrop.show {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.candidate-drawer {
  width: min(620px, 100%);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--line);
  background: #f7f9f8;
  box-shadow: -18px 0 42px rgba(21, 34, 30, 0.18);
  transform: translateX(100%);
  transition: transform 200ms ease;
}

.drawer-backdrop.show .candidate-drawer {
  transform: translateX(0);
}

.drawer-header {
  min-height: 71px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.drawer-body {
  overflow: auto;
  padding: 14px;
}

.form-section {
  display: grid;
  gap: 13px;
  margin-bottom: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

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

.form-section-heading > div {
  min-width: 0;
}

.form-section-heading h3 {
  font-size: 13px;
}

.form-section-heading span,
.form-section-heading > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.score-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.score-inputs label {
  height: 48px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 43px;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbfa;
}

.score-inputs b {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}

.score-inputs input {
  width: 43px;
  height: 31px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  text-align: center;
  outline: none;
}

.signal-mark {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 850;
}

.signal-mark.google {
  background: var(--blue-soft);
  color: #315f93;
}

.signal-mark.tiktok {
  background: #e8eae9;
  color: #242826;
}

.signal-mark.pinterest {
  background: var(--coral-soft);
  color: #a54545;
}

.analysis-section {
  min-height: 192px;
}

.drawer-trend {
  min-height: 104px;
  display: grid;
  align-items: center;
}

.analysis-placeholder,
.analysis-loading,
.analysis-error {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 11px;
}

.analysis-error {
  color: var(--danger);
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.analysis-metrics > span {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbfa;
}

.analysis-metrics small {
  color: var(--muted);
  font-size: 9px;
}

.analysis-metrics strong {
  margin-top: 3px;
  font-size: 16px;
}

.large-sparkline {
  height: 82px;
  margin-top: 9px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
}

.large-sparkline .sparkline {
  height: 68px;
}

.related-query-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.query-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.query-group > strong {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 9px;
  border-bottom: 1px solid var(--line);
  background: #f5f7f6;
  font-size: 10px;
}

.query-group a {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 9px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 9px;
  text-decoration: none;
}

.query-group a:last-child {
  border-bottom: 0;
}

.query-group a:hover {
  background: #f8faf9;
}

.query-group a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.query-group a b {
  color: var(--teal-dark);
  white-space: nowrap;
}

.drawer-footer {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.drawer-footer > div {
  display: flex;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  max-width: min(360px, calc(100vw - 36px));
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 13px;
  border-radius: 8px;
  background: #1f2927;
  color: #ffffff;
  box-shadow: 0 14px 35px rgba(24, 36, 32, 0.22);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 1001px) and (max-width: 1350px) {
  .signal-row {
    min-width: 990px;
    grid-template-columns: 36px minmax(240px, 1.3fr) 150px 150px 68px 190px;
    gap: 10px;
  }
}

@media (max-width: 1250px) {
  .app-frame {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .app-sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .content-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .source-card-row {
    grid-template-columns: 48px minmax(220px, 1fr) auto;
  }

  .source-meta {
    display: none;
  }

  .discover-controls {
    grid-template-columns: minmax(180px, 1fr) 140px 82px;
  }

  .discover-run {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 1000px) {
  .app-frame {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 228px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    left: 228px;
    z-index: 35;
    display: block;
    border: 0;
    background: rgba(18, 26, 24, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
  }

  .sidebar-scrim.show {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu {
    display: inline-flex !important;
  }

  .overview-grid,
  .sources-layout {
    grid-template-columns: 1fr;
  }

  .weight-panel {
    position: static;
  }

  .discover-top-grid {
    grid-template-columns: 1fr;
  }

  .discover-command {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .market-pulse-panel {
    min-height: 150px;
  }

  .pulse-content {
    height: 96px;
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .market-pulse-chart {
    width: 150px;
    height: 96px;
  }

  .discover-controls {
    grid-template-columns: minmax(200px, 1fr) 150px 88px auto;
  }

  .discover-run {
    grid-column: auto;
    width: auto;
  }

  .workspace-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: 18px;
  }

  h2 {
    font-size: 16px;
  }

  .topbar {
    min-height: 64px;
    align-items: flex-start;
    padding: 10px 12px;
  }

  .topbar-title {
    min-height: 40px;
  }

  .topbar-title p {
    max-width: 165px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .market-control {
    grid-template-columns: 94px;
    padding-left: 0;
  }

  .market-control span,
  .sync-time {
    display: none;
  }

  .market-control select {
    width: 94px;
    border-left: 0;
    border-radius: 7px;
    padding-left: 8px;
    font-size: 11px;
  }

  .topbar-actions .button {
    width: 38px;
    padding: 0;
  }

  .topbar-actions .button span {
    display: none;
  }

  .content-shell {
    padding: 14px 12px 28px;
  }

  .metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric-card {
    min-height: 92px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 5px 8px;
    padding: 11px;
  }

  .metric-icon {
    width: 34px;
    height: 34px;
  }

  .metric-icon [data-lucide] {
    width: 17px;
    height: 17px;
  }

  .metric-card > div:nth-child(2) {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .metric-card strong {
    font-size: 22px;
  }

  .opportunity-row {
    min-width: 620px;
  }

  .opportunity-list {
    overflow-x: auto;
  }

  .discover-command {
    padding: 15px;
  }

  .pulse-header {
    min-height: 48px;
  }

  .pulse-content {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .market-pulse-chart {
    width: 112px;
  }

  .discover-copy h2 {
    font-size: 18px;
  }

  .discover-controls {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .keyword-field {
    grid-column: 1 / -1;
  }

  .discover-run {
    grid-column: 1 / -1;
    width: 100%;
  }

  .provenance-strip {
    flex-wrap: wrap;
    gap: 7px 14px;
    overflow: visible;
  }

  .provenance-strip span + span {
    padding-left: 0;
    border-left: 0;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .signal-row {
    min-width: 0;
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-areas:
      "rank product"
      "rank sources"
      "rank trend"
      "rank score"
      "rank actions";
    align-items: start;
    gap: 12px 10px;
    padding: 14px 13px;
  }

  .signal-rank {
    grid-area: rank;
  }

  .signal-product {
    grid-area: product;
  }

  .signal-source-scores {
    width: min(210px, 100%);
    grid-area: sources;
  }

  .trend-cell {
    width: 100%;
    grid-area: trend;
  }

  .result-score {
    grid-area: score;
    flex-direction: row;
    justify-content: flex-start;
  }

  .result-score > strong {
    min-width: 34px;
    font-size: 20px;
  }

  .result-actions {
    grid-area: actions;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: repeat(5, 38px) minmax(120px, 1fr);
    gap: 6px;
  }

  .search-box {
    width: auto;
    grid-column: 1 / -1;
  }

  .toolbar-actions select {
    width: auto;
    grid-column: span 3;
  }

  .toolbar-actions .button {
    min-width: 0;
  }

  .source-card-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
  }

  .source-logo.large {
    width: 42px;
    height: 42px;
  }

  .source-card-row > .button {
    grid-column: 2;
    justify-self: start;
  }

  .form-grid.two-columns,
  .related-query-grid {
    grid-template-columns: 1fr;
  }

  .score-inputs {
    grid-template-columns: 1fr;
  }

  .score-inputs label {
    grid-template-columns: 25px minmax(0, 1fr) 50px;
  }

  .score-inputs input {
    width: 50px;
  }

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

  .drawer-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .drawer-footer > div,
  .drawer-footer .button {
    width: 100%;
  }

  .drawer-footer > div .button {
    flex: 1;
  }

  .toast {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 440px) {
  .topbar-title p {
    max-width: 130px;
  }

  .market-control,
  .market-control select {
    width: 82px;
    grid-template-columns: 82px;
  }

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

  .metric-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel-header {
    padding-left: 13px;
    padding-right: 13px;
  }

  .toolbar-actions {
    grid-template-columns: repeat(4, 38px) minmax(110px, 1fr);
  }

  .toolbar-actions select {
    grid-column: span 2;
  }

  .toolbar-actions #addCandidateButton {
    grid-column: span 2;
  }
}

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

  .signal-row:hover {
    transform: none;
  }
}
