:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #18202b;
  --muted: #667084;
  --border: #d9e0ea;
  --accent: #176b87;
  --accent-strong: #0e4e63;
  --danger: #a33b35;
  --shadow: 0 16px 40px rgba(24, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 760;
}

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

p,
.status,
#summary {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.status {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
  min-width: 220px;
  text-align: right;
}

.workspace {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  padding: 10px 11px;
  outline: none;
  min-height: 42px;
}

textarea {
  resize: vertical;
  line-height: 1.4;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.14);
}

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

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

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

.advanced {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.advanced summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.advanced[open] {
  display: grid;
  gap: 14px;
}

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

.inline input {
  width: 16px;
  min-height: 16px;
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 720;
  min-height: 42px;
  padding: 10px 14px;
  cursor: pointer;
}

button[type="button"] {
  background: #e8eef5;
  color: var(--ink);
}

button:hover {
  background: var(--accent-strong);
}

button[type="button"]:hover {
  background: #dbe5ef;
}

.results {
  min-height: 520px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.matches {
  display: grid;
  gap: 10px;
}

.match {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.match-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.sku {
  font-weight: 760;
}

.score {
  color: var(--accent-strong);
  font-weight: 760;
}

.key,
.reason {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.download-link {
  justify-self: start;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
}

.download-link:hover {
  text-decoration: underline;
}

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

@media (max-width: 920px) {
  .toolbar,
  .workspace {
    grid-template-columns: 1fr;
    display: grid;
  }

  .status {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 16px;
  }

  .grid.two,
  .grid.three,
  .actions {
    grid-template-columns: 1fr;
    display: grid;
  }
}
