:root {
  color-scheme: light;
  --ink: #333333;
  --muted: #6e6d6d;
  --paper: #f6f6f6;
  --card: #fff;
  --line: #d7d7d7;
  --accent: #d9671d;
  --accent-dark: #ad4e12;
  --success: #408263;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

.site-header {
  min-height: 82px;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px max(24px, calc((100vw - 1180px) / 2));
  background: #fff;
  border-bottom: 1px solid #ececec;
}

.brand img { display: block; width: 182px; height: auto; }
.header-label { color: #777; font-size: 13px; }
.catalog-link { color: var(--ink); font-size: 13px; font-weight: 700; text-underline-offset: 4px; }
.mobile-label { display: none; }

.hero {
  min-height: 310px;
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(260px, 1fr);
  align-items: end;
  gap: 48px;
  padding: 56px max(24px, calc((100vw - 1180px) / 2));
  background: linear-gradient(120deg, #272727, #3b3a3a);
  color: #fff;
}

.hero h1 {
  max-width: 760px;
  margin: 10px 0 8px;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 700;
  line-height: 1.02;
}

.hero p { margin: 18px 0 0; color: #d9d3c9; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .16em; }

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px;
  color: #d8d8d8;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.privacy-note span { color: var(--accent); font-weight: 900; }

main {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 72px;
}

.search-panel {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 55px rgb(52 40 22 / 7%);
}

h2 { margin: 0 0 8px; font-size: clamp(24px, 3vw, 34px); }
.upload-copy p { max-width: 580px; margin: 0 0 22px; color: var(--muted); line-height: 1.55; }

.upload-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.upload-button { background: var(--accent); color: #fff; }
.upload-button:hover { background: var(--accent-dark); }
.secondary-button { margin-left: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.secondary-button:disabled, .upload-button:has(+ input:disabled) { cursor: wait; opacity: .5; }

.preview-wrap {
  min-height: 230px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f7f7f7;
  border: 1px dashed #bdbdbd;
  border-radius: 16px;
}

.preview-wrap img { width: 100%; height: 260px; object-fit: contain; }
.preview-placeholder { color: #c0b7aa; font-size: 84px; transform: rotate(-25deg); }

.status-box {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: #f7f7f7;
  border-radius: 12px;
}

.status-box strong, .status-box span { display: block; }
.status-box span { margin-top: 2px; color: var(--muted); font-size: 13px; }
.status-dot { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgb(200 154 85 / 15%); }
.status-dot.ready { background: var(--success); box-shadow: 0 0 0 6px rgb(44 122 92 / 13%); }
.status-dot.error { background: #b94848; }

.test-report {
  margin-top: 24px;
  padding: 26px;
  border-radius: 18px;
  background: #333;
  color: #fff;
}

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.metrics div { padding: 18px; background: rgb(255 255 255 / 8%); border-radius: 12px; }
.metrics strong, .metrics span { display: block; }
.metrics strong { font-size: 30px; color: #ff8b3c; }
.metrics span { margin-top: 4px; color: #c8d4cf; font-size: 13px; }
.test-report p { margin-bottom: 0; color: #dce7e2; }

.results-section { margin-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin-top: 6px; }
.result-time { color: var(--muted); font-size: 14px; }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.product-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.image-frame { height: 220px; padding: 16px; background: #f8f8f8; }
.image-frame img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 16px; }
.match { display: inline-block; margin-bottom: 8px; color: var(--success); font-size: 12px; font-weight: 800; }
.card-body h3 { min-height: 44px; margin: 0; font-size: 15px; line-height: 1.4; }
.sku { display: block; margin: 7px 0 15px; color: var(--muted); font-size: 12px; }
.card-body a { color: var(--accent-dark); font-size: 13px; font-weight: 750; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .header-label { display: none; }
  .hero { grid-template-columns: 1fr; align-items: start; }
  .search-panel { grid-template-columns: 1fr; }
  .status-box { grid-column: auto; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .site-header { min-height: 68px; padding: 10px 16px; }
  .brand img { width: 140px; }
  .desktop-label { display: none; }
  .mobile-label { display: inline; }
  .hero { padding-top: 34px; padding-bottom: 34px; }
  .search-panel { padding: 20px; }
  .secondary-button { margin: 10px 0 0; width: 100%; }
  .upload-button { width: 100%; }
  .metrics { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
}
