body[data-page^="selection"],
body[data-page="product-links"],
body[data-page="product-discovery-jobs"] {
  background: #f6f8fb;
  color: #162033;
}

body[data-page="selection-summary"] {
  margin: 0;
  background: #f2f4f8;
}

.niche-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 50px;
  padding: 0 70px;
  background: #1c8a87;
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.niche-topbar h1 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

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

.niche-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-family: inherit;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.niche-home-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.selection-market-page {
  width: min(1400px, calc(100vw - 48px));
  margin: 20px auto 42px;
}

.selection-searchbar {
  display: grid;
  grid-template-columns: 122px minmax(240px, 1fr) 80px 86px auto;
  gap: 0;
  align-items: stretch;
  margin-bottom: 20px;
}

.selection-searchbar select,
.selection-searchbar input,
.selection-searchbar button,
.selection-searchbar a,
.selection-filter-panel select,
.selection-result-toolbar select,
.selection-table-head select {
  min-height: 40px;
  border: 1px solid #d6dce8;
  background: #fff;
  color: #3f4652;
  font-size: 14px;
  font-family: inherit;
}

.selection-searchbar select {
  border-radius: 4px 0 0 4px;
  padding: 0 16px;
  color: #2b83f6;
  font-weight: 850;
}

.selection-searchbar input {
  border-left: 0;
  border-right: 0;
  padding: 0 16px;
}

.selection-searchbar button {
  border: 0;
  color: #fff;
  background: #1c8a87;
  font-weight: 850;
  border-radius: 0;
}

.selection-searchbar .filter-clear {
  border-left: 8px solid #f2f4f8;
  color: #687386;
  background: transparent;
}

.selection-searchbar a {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  border: 0;
  border-radius: 4px;
  background: #1c8a87;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.selection-filter-panel {
  margin-bottom: 24px;
  border: 1px solid #d9dee7;
  border-radius: 6px;
  background: #fff;
}

.filter-line {
  display: grid;
  grid-template-columns: 120px repeat(6, minmax(150px, 1fr));
  gap: 4px;
  align-items: center;
  min-height: 55px;
  padding: 8px 12px;
  border-top: 1px solid #edf0f5;
}

.filter-line:first-child {
  border-top: 0;
}

.filter-line > span {
  color: #6c7482;
  font-size: 14px;
  font-weight: 800;
}

.filter-line select,
.filter-line button {
  width: 100%;
  min-height: 30px;
  border: 1px solid #d6dce8;
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
}

.saved-line {
  grid-template-columns: 120px 150px minmax(0, 1fr);
}

.saved-line button,
.ghost-filter {
  color: #3f4652;
  font-weight: 760;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: center;
  padding: 14px 144px;
  border-top: 1px solid #edf0f5;
  color: #3f4652;
  font-size: 14px;
  font-weight: 760;
}

.filter-tags label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.filter-tags input {
  width: 14px;
  height: 14px;
  min-height: 0;
}

.listing-time-row {
  display: grid;
  grid-template-columns: 120px repeat(6, minmax(70px, 92px)) minmax(260px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid #edf0f5;
}

.listing-time-row > span {
  color: #6c7482;
  font-size: 14px;
  font-weight: 800;
}

.time-filter-button {
  min-height: 30px;
  border: 1px solid #d6dce8;
  border-radius: 4px;
  background: #fff;
  color: #3f4652;
  font: inherit;
  font-weight: 760;
}

.time-filter-button.is-active {
  border-color: #2f8fff;
  background: #eef6ff;
  color: #1178f2;
}

.custom-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-date-range input {
  width: 136px;
  min-height: 30px;
  border: 1px solid #d6dce8;
  border-radius: 4px;
  padding: 0 10px;
  background: #fff;
  color: #3f4652;
  font: inherit;
}

.selection-result-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
  color: #8a929f;
  font-size: 15px;
}

.selection-result-toolbar strong {
  color: #2f8fff;
}

.selection-result-toolbar span {
  display: inline-block;
  margin-left: 12px;
  color: #8a929f;
  font-size: 13px;
}

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

.admin-only-action {
  display: none;
}

body.is-admin .admin-only-action {
  display: inline-flex;
}

.toolbar-right button,
.toolbar-right select,
.selection-pager button,
.selection-pager select {
  min-height: 34px;
  border: 1px solid #d7deea;
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
  color: #3f4652;
  font-weight: 760;
}

.toolbar-right button:disabled {
  color: #a5adba;
}

.view-toggle.is-active {
  color: #2f8fff;
  border-color: #2f8fff;
}

.selection-product-table {
  overflow: hidden;
  border: 1px solid #d9dee7;
  border-radius: 6px;
  background: #fff;
}

.selection-table-head,
.selection-product-row {
  display: grid;
  grid-template-columns: minmax(310px, 1fr) minmax(140px, 180px) 92px 106px 122px 108px 144px 76px 88px;
  align-items: center;
}

.selection-table-head {
  min-height: 72px;
  border-bottom: 1px solid #edf0f5;
  background: #f3f6fb;
  color: #1f2937;
  font-size: 14px;
  font-weight: 950;
}

.selection-table-head > div {
  padding: 0 12px;
}

.selection-table-head select {
  min-width: 198px;
  border-radius: 4px;
  padding: 0 14px;
}

.sort-head {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 4px;
  padding: 0 8px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  cursor: pointer;
}

.sort-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #64748b;
  font-size: 15px;
  font-weight: 950;
}

.sort-head.is-active {
  color: #2279ee;
  background: #e8f2ff;
}

.sort-head.is-active span {
  color: #2279ee;
}

.recommendation-head {
  display: grid;
  grid-template-columns: minmax(56px, 1fr) auto auto;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.recommendation-sort-button {
  position: relative;
  z-index: 1;
  min-height: 24px;
  border: 1px solid #d6e2f2;
  border-radius: 999px;
  padding: 0 8px;
  background: #fff;
  color: #536078;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.recommendation-sort-button:hover,
.recommendation-sort-button.is-active {
  border-color: #1c8a87;
  background: #e9f8f6;
  color: #117370;
}

.selection-product-row {
  min-height: 132px;
  border-bottom: 1px solid #e5e9f0;
}

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

.product-thumb {
  grid-column: 1;
  grid-row: 1;
  width: 100px;
  height: 100px;
  margin-left: 16px;
  overflow: hidden;
  border-radius: 6px;
  background: #e9edf4;
}

.product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumb img + span {
  display: none;
}

.product-thumb span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #718096;
  font-weight: 900;
}

.product-thumb.is-image-missing span {
  display: flex;
}

.product-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  padding: 18px 18px 14px 132px;
}

.product-badges,
.product-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.product-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: #ecf2fb;
  color: #3662a2;
  font-size: 13px;
  font-weight: 800;
}

.product-badges .is-missing {
  color: #8a929f;
  background: #f2f4f8;
}

.product-badges .is-estimated {
  color: #8a5f13;
  background: #fff6df;
}

.product-title {
  display: block;
  margin-top: 10px;
  color: #222936;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.55;
  cursor: pointer;
}

.product-title:hover {
  color: #2279ee;
  text-decoration: underline;
}

.product-detail-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  color: #2279ee;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.product-detail-link:hover {
  text-decoration: underline;
}

.product-price {
  margin-top: 6px;
  color: #2384ff;
  font-size: 17px;
  font-weight: 950;
}

.product-signals {
  margin-top: 8px;
  color: #7b8493;
  font-size: 13px;
}

.product-rating {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: #596579;
  font-weight: 850;
}

.product-rating .rating-stars {
  color: #f5b301;
  font-size: 14px;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(126, 83, 0, 0.12);
}

.product-rating.is-missing .rating-stars {
  color: #c5ccd8;
  text-shadow: none;
}

.metric-cell {
  padding: 0 18px;
  color: #3a4250;
  font-size: 15px;
  text-align: center;
}

.metric-cell em {
  display: inline-flex;
  margin-left: 8px;
  min-height: 24px;
  align-items: center;
  border-radius: 5px;
  padding: 0 9px;
  background: #d8f6e5;
  color: #13a352;
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}

.painpoint-cell {
  min-width: 0;
  padding: 0 10px;
}

.painpoint-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.painpoint-tag {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  border: 1px solid #f0d0aa;
  border-radius: 999px;
  padding: 0 9px;
  background: #fff7ed;
  color: #9a4f0f;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.painpoint-empty {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #f2f5f9;
  color: #8a94a6;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.trend-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.platform-link-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.recommendation-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.recommendation-index {
  display: grid;
  min-width: 94px;
  gap: 3px;
  justify-items: center;
}

.recommendation-stars {
  display: inline-flex;
  gap: 1px;
  align-items: center;
  font-size: 15px;
  line-height: 1;
}

.recommendation-star {
  color: #d1d8e5;
  text-shadow: none;
}

.recommendation-star.is-filled {
  color: #f59e0b;
  text-shadow: 0 1px 0 rgba(126, 83, 0, 0.15);
}

.recommendation-good .recommendation-star.is-filled,
.recommendation-excellent .recommendation-star.is-filled {
  color: #19a56a;
}

.recommendation-low .recommendation-star.is-filled {
  color: #f97316;
}

.recommendation-index strong {
  color: #536078;
  font-size: 12px;
  font-weight: 950;
}

.recommendation-pending strong {
  color: #8a94a6;
}

.recommendation-excellent strong {
  color: #078158;
}

.recommendation-good strong {
  color: #12805c;
}

.recommendation-watch strong {
  color: #9a5b11;
}

.favorite-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}

.candidate-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.candidate-button {
  min-width: 64px;
  min-height: 32px;
  border: 1px solid #1c8a87;
  border-radius: 4px;
  background: #e9f8f6;
  color: #117370;
  font-size: 14px;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
}

.candidate-button:hover {
  background: #1c8a87;
  color: #fff;
}

.candidate-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.candidate-button.is-created {
  min-width: 112px;
  border-color: #176b68;
  background: #1c8a87;
  color: #fff;
  font-size: 12px;
}

.sparkline {
  width: 116px;
  height: 42px;
}

.sparkline-wrap {
  position: relative;
  display: inline-flex;
  min-width: 116px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
}

.sparkline path {
  fill: none;
  stroke: #4a86f7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.sparkline-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 20;
  display: grid;
  width: 190px;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid #c7d5e5;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  color: #1f2937;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.sparkline-tooltip::after {
  position: absolute;
  left: calc(50% - 5px);
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid #c7d5e5;
  border-bottom: 1px solid #c7d5e5;
  background: #fff;
  content: "";
  transform: rotate(45deg);
}

.sparkline-tooltip strong {
  margin-bottom: 2px;
  color: #0f172a;
  font-size: 13px;
}

.sparkline-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  white-space: nowrap;
}

.sparkline-tooltip b {
  color: #64748b;
  font-weight: 700;
}

.sparkline-tooltip em {
  color: #0f172a;
  font-style: normal;
  font-weight: 850;
}

.sparkline-wrap:hover .sparkline-tooltip,
.sparkline-wrap:focus-within .sparkline-tooltip,
.sparkline-wrap.is-inspecting .sparkline-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sparkline-marker {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 50%;
  z-index: 2;
  display: none;
  width: 1px;
  background: rgba(28, 138, 135, 0.55);
  box-shadow: 0 0 0 4px rgba(28, 138, 135, 0.09);
  transform: translateX(-50%);
}

.sparkline-wrap.is-inspecting .sparkline-marker,
.sparkline-wrap:focus-within .sparkline-marker {
  display: block;
}

.sparkline-empty {
  color: #9aa3b1;
  font-size: 13px;
}

.platform-link-cell a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef4ff;
  color: #376cf3;
  text-decoration: none;
  font-size: 17px;
  font-weight: 950;
}

.platform-link-cell a:hover {
  background: #dfeaff;
  color: #1557d6;
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff1f4;
  color: #e24b73;
  font-family: inherit;
  font-size: 19px;
  font-weight: 950;
  cursor: pointer;
}

.favorite-button:hover,
.favorite-button.is-favorited {
  background: #e24b73;
  color: #fff;
}

.favorite-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.selection-loading,
.selection-empty {
  padding: 34px;
  color: #697486;
  text-align: center;
}

.selection-error {
  color: #b42318;
}

.selection-pager {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-top: 1px solid #edf0f5;
}

.selection-pager select {
  flex: 0 0 auto;
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}

.selection-pager button:disabled {
  opacity: 0.5;
}

.selection-detail-root {
  display: grid;
  gap: 18px;
}

.selection-detail-hero,
.detail-metrics,
.detail-panel,
.detail-raw {
  border: 1px solid #d9dee7;
  border-radius: 6px;
  background: #fff;
}

.selection-detail-hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
}

.detail-image {
  width: 240px;
  aspect-ratio: 1 / 1;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: #f3f6fb;
  overflow: hidden;
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-image img + span {
  display: none;
}

.detail-image span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #718096;
  font-size: 28px;
  font-weight: 950;
}

.detail-image.is-image-missing span {
  display: flex;
}

.detail-main h2 {
  margin: 14px 0 10px;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0;
}

.detail-price {
  color: #2384ff;
  font-size: 26px;
  font-weight: 950;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.detail-metrics div {
  min-height: 86px;
  padding: 16px;
  border-left: 1px solid #edf0f5;
}

.detail-metrics div:first-child {
  border-left: 0;
}

.detail-metrics span,
.detail-raw dt {
  display: block;
  color: #7b8493;
  font-size: 13px;
  font-weight: 800;
}

.detail-metrics strong {
  display: block;
  margin-top: 8px;
  color: #1f2937;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.detail-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-panel,
.detail-raw {
  padding: 18px;
}

.detail-panel h3,
.detail-raw h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.detail-panel-note {
  margin: -4px 0 12px;
  color: #8a5f13;
  font-size: 13px;
  line-height: 1.6;
}

.detail-history {
  display: grid;
  gap: 8px;
}

.detail-history div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0f5;
}

.detail-review {
  padding: 12px 0;
  border-bottom: 1px solid #edf0f5;
}

.detail-review p {
  margin: 6px 0;
  color: #3f4652;
  line-height: 1.6;
}

.detail-review span {
  color: #7b8493;
  font-size: 12px;
}

.detail-raw dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}

.detail-raw dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.selection-wrap {
  max-width: 1320px;
}

.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin: 24px 0;
}

.selection-header h1 {
  margin: 6px 0 8px;
}

.selection-header p {
  margin: 0;
  max-width: 720px;
  color: #5b6474;
  line-height: 1.7;
}

.selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.primary-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.primary-link {
  background: #1f6feb;
  color: #fff;
}

.ghost-link {
  border: 1px solid #d6deea;
  color: #1d2b42;
  background: #fff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.summary-card {
  min-height: 106px;
  padding: 16px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background: #fff;
}

.summary-card .label {
  color: #627086;
  font-size: 13px;
}

.summary-card .value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
}

.platform-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.platform-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background: #fff;
}

.local-sync-panel {
  border-left: 4px solid #7357d6;
}

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

.sync-columns h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.sync-list {
  display: grid;
  gap: 10px;
  color: #627086;
}

.sync-item {
  padding: 12px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background: #fff;
}

.sync-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sync-item-head strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
}

.sync-item a {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: #1f6feb;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: #627086;
  font-size: 12px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 160px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  white-space: nowrap;
}

.discovery-panel {
  border-left: 4px solid #1f6feb;
}

.import-panel {
  border-left: 4px solid #168a51;
}

.discovery-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.import-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.import-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #536078;
}

.import-form input[type="file"] {
  min-height: 38px;
  border: 1px solid #d4ddeb;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
}

.import-form button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: #168a51;
  font-weight: 700;
}

.import-form button:disabled {
  opacity: 0.6;
}

.discovery-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #536078;
}

.discovery-form input,
.discovery-form select {
  min-height: 38px;
  border: 1px solid #d4ddeb;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.discovery-form button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: #1f6feb;
  font-weight: 700;
}

.discovery-form button:disabled {
  opacity: 0.6;
}

.discovery-result {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  background: #fff;
  color: #536078;
  line-height: 1.6;
}

.discovery-result.is-success {
  border-color: #badbcc;
  background: #f0f8f4;
  color: #234a35;
}

.discovery-result.is-error {
  border-color: #f1c2c2;
  background: #fff4f4;
  color: #8a1f1f;
}

.discovery-result.is-loading {
  color: #315ca5;
}

.discovery-result ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.discovery-result li {
  margin: 4px 0;
}

.discovery-result a {
  color: #1f6feb;
  font-weight: 700;
}

.discovery-result li span {
  margin-left: 8px;
  color: #627086;
}

.discovery-result h3 {
  margin: 10px 0 4px;
  font-size: 13px;
  color: #34415a;
}

.discovery-result em {
  margin-left: 8px;
  color: #8a4b18;
  font-style: normal;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) minmax(100px, 130px) auto;
  gap: 12px;
  align-items: end;
}

.filter-row label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #536078;
}

.filter-row input,
.filter-row select {
  min-height: 38px;
  border: 1px solid #d4ddeb;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.filter-row button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: #1f6feb;
  font-weight: 700;
}

.link-table-wrap {
  max-height: calc(100vh - 220px);
  overflow: auto;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  background: #fff;
}

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

.job-table {
  min-width: 1720px;
}

.link-table th,
.link-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: middle;
}

.link-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f6fb;
  color: #34415a;
  box-shadow: inset 0 -1px 0 #dfe6f1;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  color: #536078;
  font-size: 13px;
}

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

.toolbar-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #536078;
  font-weight: 700;
}

.toolbar-filter select {
  min-height: 32px;
  border: 1px solid #d4ddeb;
  border-radius: 8px;
  padding: 0 10px;
  color: #243047;
  background: #fff;
  font-weight: 700;
}

.pager-actions button {
  min-height: 32px;
  border: 1px solid #d4ddeb;
  border-radius: 8px;
  padding: 0 12px;
  color: #34415a;
  background: #fff;
  font-weight: 700;
}

.pager-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.link-table img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #edf1f6;
}

.link-title {
  max-width: 260px;
  font-weight: 700;
  line-height: 1.5;
}

.link-url {
  display: inline-block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f6feb;
}

.link-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.link-action-row button {
  min-height: 30px;
  border: 1px solid #d4ddeb;
  border-radius: 7px;
  padding: 0 9px;
  color: #1d2b42;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.link-action-row button:disabled {
  opacity: 0.55;
}

.muted-cell {
  color: #7a8494;
}

.review-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: #536078;
  background: #eef2f7;
}

.review-state.is-analyzed {
  color: #17633a;
  background: #e8f7ef;
}

.review-state.is-pending,
.review-state.is-collect {
  color: #7c5814;
  background: #fff7d6;
}

.review-state.is-failed {
  color: #8a1f1f;
  background: #feecec;
}

.review-state.is-muted {
  color: #647083;
  background: #f3f6fb;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.is-success {
  color: #17633a;
  background: #e8f7ef;
}

.status-pill.is-limited {
  color: #8a4b18;
  background: #fff2df;
}

.status-pill.is-warning {
  color: #7c5814;
  background: #fff7d6;
}

.status-pill.is-pending {
  color: #536078;
  background: #eef2f7;
}

.link-table small {
  display: block;
  margin-top: 4px;
  max-width: 160px;
  color: #7a8494;
  line-height: 1.4;
}

.platform-cell {
  display: grid;
  gap: 4px;
}

.platform-cell em,
.import-notice {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-style: normal;
  font-weight: 700;
}

.platform-cell em {
  min-height: 22px;
  padding: 0 8px;
  font-size: 12px;
}

.platform-cell em.is-test,
.import-notice.is-test {
  color: #7a4c00;
  background: #fff3cd;
}

.platform-cell em.is-warning,
.import-notice.is-warning {
  color: #8a1f1f;
  background: #fff0f0;
}

.import-notice {
  margin-top: 8px;
  padding: 8px 10px;
}

.job-log-list {
  display: grid;
  gap: 8px;
}

.job-log-item {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(120px, 0.8fr) minmax(260px, 1.6fr) minmax(140px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background: #fff;
  color: #536078;
  font-size: 13px;
}

.job-log-item strong {
  color: #1d2b42;
}

.job-log-item em {
  color: #8a1f1f;
  font-style: normal;
}

@media (max-width: 760px) {
  .niche-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 18px;
  }

  .selection-market-page {
    width: calc(100vw - 24px);
    margin-top: 12px;
  }

  .selection-searchbar,
  .selection-result-toolbar,
  .filter-line,
  .selection-table-head,
  .selection-product-row {
    grid-template-columns: 1fr;
  }

  .selection-searchbar {
    gap: 8px;
  }

  .selection-searchbar select,
  .selection-searchbar input,
  .selection-searchbar button,
  .selection-searchbar a {
    border: 1px solid #d6dce8;
    border-radius: 4px;
  }

  .selection-searchbar a {
    justify-self: stretch;
  }

  .filter-tags {
    padding: 14px 12px;
    gap: 12px;
  }

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

  .listing-time-row > span,
  .custom-date-range {
    grid-column: 1 / -1;
  }

  .custom-date-range input {
    flex: 1;
    min-width: 0;
  }

  .toolbar-right {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .selection-table-head > div:not(:first-child) {
    display: none;
  }

  .product-main {
    padding: 18px 14px 14px 124px;
  }

  .metric-cell,
  .painpoint-cell,
  .trend-cell,
  .platform-link-cell,
  .recommendation-cell,
  .favorite-cell,
  .candidate-cell {
    padding: 0 14px 14px 124px;
    text-align: left;
  }

  .trend-cell,
  .painpoint-cell,
  .platform-link-cell,
  .recommendation-cell,
  .favorite-cell,
  .candidate-cell {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .selection-header,
  .filter-row,
  .discovery-form,
  .import-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .selection-actions {
    justify-content: flex-start;
  }

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

  .job-log-item {
    grid-template-columns: 1fr;
  }
}
