:root {
  --bg: #f2fbf8;
  --surface: #ffffff;
  --surface-2: #eaf8f4;
  --ink: #10221c;
  --muted: #60746f;
  --line: #cfe4dd;
  --accent: #13a538;
  --accent-2: #087246;
  --accent-blue: #43c7e8;
  --accent-yellow: #f2dc2f;
  --focus: #f2dc2f;
  --shadow: 0 16px 34px rgba(8, 114, 70, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(67, 199, 232, 0.15) 0 14%, transparent 14% 100%),
    linear-gradient(155deg, transparent 0 72%, rgba(242, 220, 47, 0.16) 72% 100%),
    var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 18px;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), var(--accent-yellow), var(--accent-blue)) 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 220px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(190px, 25vw, 330px);
  height: auto;
  max-height: 138px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(8, 114, 70, 0.18));
}

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

.statline span {
  min-width: 112px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-2);
  text-align: center;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(16, 34, 28, 0.06);
}

.search-panel {
  margin: 22px 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.display-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(67, 199, 232, 0.11), rgba(242, 220, 47, 0.11));
}

.display-options legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(207, 228, 221, 0.8);
  background: var(--surface);
}

.check-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfffd;
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(242, 183, 5, 0.25);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

button {
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  padding: 9px 15px;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  border-color: var(--line);
  background: #f7fffc;
  color: var(--ink);
}

button:hover {
  filter: brightness(0.97);
}

.message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.results-list,
.detail {
  min-height: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.results-list {
  overflow: hidden;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #fbfffd, rgba(67, 199, 232, 0.1));
}

.list-head select {
  max-width: 170px;
  min-height: 38px;
}

#results {
  max-height: 72vh;
  overflow: auto;
}

.result-item {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
}

.result-item:hover,
.result-item.active {
  background: linear-gradient(90deg, rgba(242, 220, 47, 0.18), rgba(67, 199, 232, 0.12));
  filter: none;
}

.result-title {
  display: block;
  margin-bottom: 5px;
  font-weight: 800;
  line-height: 1.25;
}

.result-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.detail {
  padding: 18px;
}

.empty-state {
  display: grid;
  gap: 14px;
  place-items: center;
  min-height: 480px;
  color: var(--muted);
  text-align: center;
}

.hint-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
}

.hint-button {
  min-height: 30px;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
  padding: 5px 8px;
  font-size: 13px;
}

.detail h2 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.source {
  margin: 0 0 18px;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.info-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfffd;
}

.info-block.full {
  grid-column: 1 / -1;
}

.info-block h3 {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.info-block p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  border-radius: 5px;
  background: #eaf8f4;
  color: var(--ink);
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 700;
}

.compare-block {
  background: #ffffff;
}

.compare-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.compare-head h3 {
  margin: 0;
}

.compare-head span {
  color: var(--muted);
  font-size: 12px;
}

.compare-list {
  display: grid;
  gap: 10px;
}

.compare-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfffd;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.compare-item:hover {
  filter: none;
  border-color: var(--accent-2);
  background: linear-gradient(90deg, rgba(19, 165, 56, 0.08), rgba(67, 199, 232, 0.11));
}

.compare-score {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 70px;
  border-radius: 6px;
  background: linear-gradient(145deg, var(--accent), var(--accent-blue));
  color: #fff;
}

.compare-score strong {
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.compare-score small {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.88;
}

.compare-body {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.compare-title {
  display: grid;
  gap: 3px;
}

.compare-title strong {
  font-size: 15px;
  line-height: 1.25;
}

.compare-title em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.viscosity-note {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.viscosity-note.ok {
  background: rgba(19, 165, 56, 0.12);
  color: var(--accent-2);
}

.viscosity-note.warn {
  background: rgba(242, 220, 47, 0.34);
  color: #6f5d00;
}

.viscosity-note.neutral {
  background: rgba(67, 199, 232, 0.14);
  color: #176678;
}

.compare-section {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.compare-section b {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.match-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.match-chip {
  display: inline-flex;
  border-radius: 5px;
  background: #eaf8f4;
  color: var(--ink);
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
}

.missing-row {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

mark {
  border-radius: 3px;
  background: #fff07a;
  color: inherit;
  padding: 0 2px;
}

@media (max-width: 980px) {
  .field-grid,
  .layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  #results {
    max-height: 360px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding: 18px 0;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    justify-content: center;
    min-width: 0;
  }

  .brand-logo {
    width: min(78vw, 290px);
    max-height: 122px;
  }

  .statline {
    justify-content: stretch;
  }

  .statline span {
    flex: 1;
  }

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

  .compare-score {
    min-height: 44px;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 6px;
  }

  .compare-score small {
    margin-top: 0;
  }

  .compare-section {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
