:root {
  --bg: #cfd3ea;
  --panel: #141925;
  --panel-2: #0c1018;
  --panel-3: #1d2433;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f6fb;
  --muted: rgba(245, 246, 251, 0.72);
  --soft: rgba(245, 246, 251, 0.54);
  --accent: #dce2ff;
  --accent-text: #182031;
  --exact-bg: rgba(185, 239, 196, 0.18);
  --exact-border: rgba(185, 239, 196, 0.42);
  --exact-text: #b9efc4;
  --shadow: 0 10px 28px rgba(6, 10, 18, 0.16);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --row-h: 46px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  padding: 12px;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.topbar {
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, #22293a 0%, #161c29 100%);
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: var(--shadow);
}

.topbar__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
}

.topbar__subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.searchbar {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 8px;
}

.searchbar__input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0e15;
  color: var(--text);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}

.searchbar__button,
.primary-button,
.ghost-button {
  height: 42px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.searchbar__button,
.primary-button {
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--text);
  padding: 0 12px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.toolbar__left,
.toolbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-text,
.result-count {
  font-size: 12px;
  color: var(--muted);
}

.results-panel {
  background: var(--panel);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.results-panel__head {
  background: #22293a;
  border-bottom: 1px solid var(--line);
}

.results-panel__body {
  background: var(--panel-2);
}

.results-grid {
  display: grid;
  grid-template-columns: 42px 220px 130px 120px minmax(180px, 1fr) 160px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.results-grid--head {
  min-height: 42px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.result-row {
  min-height: var(--row-h);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

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

.result-row__vendor {
  font-weight: 700;
  color: #fff;
}

.result-row__price {
  font-weight: 700;
  white-space: nowrap;
}

.result-row__model {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row__link {
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}

.result-row__link:hover {
  text-decoration: underline;
}

.match-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.match-badge--exact {
  background: var(--exact-bg);
  border: 1px solid var(--exact-border);
  color: var(--exact-text);
}

.match-badge--none {
  color: var(--soft);
}

.empty-state {
  padding: 18px 14px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .results-grid {
    grid-template-columns: 42px 170px 120px 110px minmax(140px, 1fr) 120px;
  }
}

@media (max-width: 760px) {
  body {
    padding: 8px;
  }

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

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

  .results-panel {
    overflow-x: auto;
  }

  .results-grid {
    min-width: 860px;
  }
}