:root {
  color-scheme: light;
  --canvas: #f7f8fa;
  --surface: #ffffff;
  --ink: #172027;
  --muted: #66717c;
  --line: #dce1e5;
  --green: #146c43;
  --green-soft: #e8f5ee;
  --red: #a82c35;
  --red-soft: #fff0f1;
  --blue: #245b92;
  --amber: #8a6415;
  --amber-soft: #fff7df;
  font-family: Tahoma, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}
a {
  color: inherit;
}
button,
input,
select {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 3px solid #5d9bd5;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 20;
  translate: 0 -150%;
  padding: 9px 14px;
  background: var(--ink);
  color: white;
}
.skip-link:focus {
  translate: 0;
}

.section-inner,
.header-inner {
  width: min(100% - 40px, 1180px);
  margin-inline: auto;
}
.app-header {
  border-block-end: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}
.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green);
  color: white;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-link {
  color: #34414b;
  text-decoration: none;
}
.seller-link {
  padding: 9px 13px;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.overview {
  border-block-end: 1px solid var(--line);
  background: var(--surface);
}
.overview-grid {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  align-items: center;
  gap: 56px;
  padding-block: 42px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1 {
  margin: 0;
  font-size: 2.65rem;
  line-height: 1.35;
  letter-spacing: 0;
}
.overview-copy {
  max-width: 660px;
  margin: 16px 0 0;
  color: #45515c;
  font-size: 1.02rem;
  line-height: 2;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-block: 1px solid var(--line);
}
.metrics div {
  padding: 18px 12px;
  text-align: center;
  border-inline-start: 1px solid var(--line);
}
.metrics div:last-child {
  border-inline-start: 0;
}
.metrics dt {
  margin-block-end: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}
.metrics dd {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
}

.data-notice {
  border-block-end: 1px solid #ead9aa;
  background: var(--amber-soft);
}
.data-notice-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #594a24;
  font-size: 0.8rem;
}
.data-notice-inner strong {
  color: #392f17;
  white-space: nowrap;
}
.data-notice-inner span {
  flex: 1;
  line-height: 1.8;
}
.data-notice-inner a {
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

.notification-band {
  border-block-end: 1px solid var(--line);
  background: #eef4f8;
}
.notification-inner {
  min-height: 126px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-block: 22px;
}
.notification-inner h2 {
  margin: 0 0 7px;
  font-size: 1.18rem;
}
.notification-inner p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}
.notification-actions {
  min-width: 230px;
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}
.notification-actions button {
  min-height: 42px;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}
.notification-actions button:disabled {
  cursor: default;
  opacity: 0.68;
}
.primary-action {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  font-weight: 700;
}
.secondary-action {
  border: 1px solid #9bacb8;
  background: white;
  color: var(--ink);
}
#notification-status {
  width: 100%;
  min-height: 1.5em;
  color: #42515d;
  font-size: 0.78rem;
  text-align: end;
}

.catalog {
  padding-block: 42px 68px;
}
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-block-end: 28px;
}
.catalog-heading h2,
.trust-inner h2 {
  margin: 0;
  font-size: 1.35rem;
}
#catalog-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.dataset-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}
.filters {
  display: flex;
  align-items: end;
  gap: 10px;
}
.filters label {
  display: grid;
  gap: 6px;
  color: #4e5963;
  font-size: 0.7rem;
}
.filters input,
.filters select {
  height: 40px;
  min-width: 150px;
  border: 1px solid #cbd2d8;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding-inline: 10px;
}
.filters .search-field input {
  width: 220px;
}
.reset-button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}
.reset-button:disabled {
  color: #9aa3aa;
  cursor: default;
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.deal-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.deal-image {
  aspect-ratio: 16/9;
  background-image: url("/assets/product-board.png");
  background-size: 300% 200%;
  background-color: #eef2f4;
}
.merchant-image {
  display: block;
  width: 100%;
  object-fit: contain;
  background: #fff;
}
.deal-image.slot-0 {
  background-position: 0 0;
}
.deal-image.slot-1 {
  background-position: 50% 0;
}
.deal-image.slot-2 {
  background-position: 100% 0;
}
.deal-image.slot-3 {
  background-position: 0 100%;
}
.deal-image.slot-4 {
  background-position: 50% 100%;
}
.deal-image.slot-5 {
  background-position: 100% 100%;
}
.deal-body {
  padding: 17px;
}
.deal-meta {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.discount-badge,
.category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding-inline: 8px;
  border-radius: 5px;
  font-size: 0.69rem;
}
.discount-badge {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}
.category-badge {
  background: #eef3f8;
  color: #4a5864;
}
.deal-card h3 {
  min-height: 52px;
  margin: 15px 0 5px;
  font-size: 0.98rem;
  line-height: 1.75;
}
.store-name {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}
.price-row {
  min-height: 50px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-block: 15px 6px;
}
.current-price {
  font-size: 1.08rem;
}
.previous-price {
  color: #89929a;
  font-size: 0.77rem;
}
.shipping-note,
.observed-at,
.merchant-notice {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.7;
}
.merchant-notice {
  color: #745b20;
}
.store-button {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-block-start: 15px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}
.store-button:hover {
  background: #0e5635;
}
.empty-state {
  min-height: 190px;
  display: grid;
  place-content: center;
  gap: 9px;
  border: 1px dashed #bdc6cd;
  text-align: center;
  color: var(--muted);
}
.empty-state .store-button {
  width: auto;
  padding-inline: 18px;
}

.trust-band {
  border-block: 1px solid var(--line);
  background: #eef3f1;
}
.trust-inner {
  min-height: 145px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
}
.trust-inner p:not(.eyebrow) {
  margin: 10px 0 0;
  color: #51605a;
  font-size: 0.8rem;
}
.trust-links {
  display: flex;
  gap: 20px;
  font-size: 0.8rem;
}
.trust-links a {
  color: var(--blue);
}

footer {
  border-block-start: 1px solid var(--line);
  background: #f1f2f3;
}
.footer-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.76rem;
}
.footer-inner > div {
  display: flex;
  gap: 9px;
}
.footer-inner strong {
  color: var(--ink);
}
.footer-inner nav {
  display: flex;
  gap: 16px;
}

.document-main {
  min-height: calc(100vh - 153px);
  background: var(--surface);
}
.document-header {
  border-block-end: 1px solid var(--line);
  background: var(--canvas);
}
.document-header .section-inner {
  padding-block: 44px 32px;
}
.document-header h1 {
  font-size: 2rem;
}
.document-body {
  max-width: 780px;
  padding-block: 38px 72px;
  font-size: 0.94rem;
  line-height: 2;
}
.document-body h2 {
  margin-block: 32px 8px;
  font-size: 1.12rem;
}
.document-body p,
.document-body li {
  color: #3e4751;
}
.document-body ul,
.document-body ol {
  padding-inline-start: 22px;
}
.document-callout {
  margin-block: 0 26px;
  padding: 16px 18px;
  border-inline-start: 4px solid var(--amber);
  background: var(--amber-soft);
  color: #5f4a14 !important;
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-block: 26px;
}
.process-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.process-item strong {
  display: block;
  margin-block-end: 8px;
}
.process-item span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.8;
}

.referral-report {
  max-width: 900px;
}
.report-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0 36px;
  border-block: 1px solid var(--line);
}
.report-metrics div {
  padding: 18px;
  border-inline-start: 1px solid var(--line);
}
.report-metrics div:last-child {
  border-inline-start: 0;
}
.report-metrics dt {
  color: var(--muted);
  font-size: 0.78rem;
}
.report-metrics dd {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 800;
}
.report-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
}
.report-table {
  width: 100%;
  border-collapse: collapse;
}
.report-table th,
.report-table td {
  padding: 13px 16px;
  border-block-end: 1px solid var(--line);
  text-align: start;
}
.report-table thead {
  background: var(--canvas);
}
.report-table tbody tr:last-child > * {
  border-block-end: 0;
}

@media (max-width: 1000px) {
  .overview-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .catalog-heading {
    align-items: start;
    flex-direction: column;
  }
  .filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .filters .search-field input,
  .filters input,
  .filters select {
    width: 100%;
    min-width: 0;
  }
  .deal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  html {
    font-size: 18px;
  }
  body {
    background: var(--surface);
  }
  .section-inner,
  .header-inner {
    width: min(100% - 18px, 1180px);
  }
  .header-inner {
    min-height: 66px;
  }
  .brand {
    font-size: 1.08rem;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
  }
  .header-link {
    display: none;
  }
  .seller-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.86rem;
  }
  .overview-grid {
    min-height: 0;
    gap: 22px;
    padding-block: 28px;
  }
  .eyebrow {
    font-size: 0.86rem;
  }
  h1 {
    font-size: 2.15rem;
    line-height: 1.45;
  }
  .overview-copy {
    font-size: 1.02rem;
    line-height: 1.9;
  }
  .metrics {
    grid-template-columns: 1fr;
  }
  .metrics div,
  .metrics div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    border-inline-start: 0;
    border-block-end: 1px solid var(--line);
  }
  .metrics div:last-child {
    border-block-end: 0;
  }
  .metrics dt {
    margin: 0;
  }
  .data-notice-inner,
  .notification-inner,
  .trust-inner,
  .trust-links,
  .footer-inner {
    align-items: start;
    flex-direction: column;
  }
  .data-notice-inner {
    padding-block: 15px;
    gap: 7px;
    font-size: 0.92rem;
  }
  .data-notice-inner strong,
  .data-notice-inner a {
    white-space: normal;
  }
  .notification-inner {
    align-items: stretch;
    gap: 14px;
    padding-block: 20px;
  }
  .notification-inner h2,
  .catalog-heading h2,
  .trust-inner h2 {
    font-size: 1.28rem;
  }
  .notification-inner p,
  .trust-inner p:not(.eyebrow) {
    font-size: 0.95rem;
    line-height: 1.85;
  }
  .notification-actions {
    min-width: 0;
    justify-content: start;
  }
  .notification-actions button {
    width: 100%;
    min-height: 52px;
    font-size: 0.98rem;
  }
  #notification-status {
    font-size: 0.88rem;
    text-align: start;
  }
  .catalog {
    padding-block: 24px 48px;
  }
  .catalog-heading {
    gap: 18px;
    margin-block-end: 18px;
  }
  #catalog-status {
    font-size: 0.92rem;
  }
  .dataset-meta {
    font-size: 0.82rem;
  }
  .filters {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fafb;
  }
  .filters label {
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
  }
  .filters input,
  .filters select {
    min-height: 54px;
    border-color: #b8c2ca;
    font-size: 1rem;
    line-height: 1.4;
    padding-inline: 12px;
  }
  .reset-button {
    min-height: 50px;
    border: 1px solid #b8c2ca;
    border-radius: 6px;
    background: white;
    font-size: 0.96rem;
  }
  .deal-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .deal-body {
    padding: 15px;
  }
  .deal-meta {
    min-height: 32px;
    flex-wrap: wrap;
  }
  .discount-badge,
  .category-badge {
    min-height: 30px;
    font-size: 0.82rem;
  }
  .deal-card h3 {
    min-height: 0;
    margin-block: 13px 7px;
    font-size: 1.1rem;
    line-height: 1.7;
  }
  .store-name,
  .previous-price,
  .shipping-note,
  .observed-at,
  .merchant-notice {
    font-size: 0.86rem;
  }
  .price-row {
    min-height: 42px;
    margin-block: 12px 4px;
  }
  .current-price {
    font-size: 1.2rem;
  }
  .store-button {
    min-height: 52px;
    font-size: 1rem;
  }
  .trust-inner {
    padding-block: 30px;
  }
  .trust-links {
    gap: 12px;
  }
  .footer-inner {
    justify-content: center;
    padding-block: 22px;
  }
  .footer-inner nav {
    flex-wrap: wrap;
  }
  .process-grid {
    grid-template-columns: 1fr;
  }
  .report-metrics {
    grid-template-columns: 1fr;
  }
  .report-metrics div,
  .report-metrics div:last-child {
    border-inline-start: 0;
    border-block-end: 1px solid var(--line);
  }
  .report-heading {
    align-items: start;
    flex-direction: column;
  }
  .report-heading .header-link {
    display: inline-flex;
  }
}

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