/*  Design tokens */
:root {
  --green-900: #0b3d2c;
  --green-700: #14664a;
  --green-100: #e3f2ec;
  --orange:    #e07a1f;
  --red:       #b3261e;
  --ink:       #16211d;
  --muted:     #5c6b65;
  --line:      #dbe4e0;
  --surface:   #ffffff;
  --bg:        #f5f8f7;
  --radius:    10px;
  --shadow:    0 1px 3px rgba(11,61,44,.08), 0 4px 12px rgba(11,61,44,.06);
}

/*  Reset  */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

/*  Header  */
.site-header {
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  color: #fff;
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
}
.site-header h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.5px; }
.site-header h1 span { color: var(--orange); }
.tagline { color: rgba(255,255,255,.85); margin-top: .35rem; font-size: .95rem; }

/*  Layout  */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

/*  Search panel  */
.search-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-top: -1.5rem;
  position: relative;
}

.search-row { display: flex; gap: .6rem; }

#searchInput {
  flex: 1;
  padding: .8rem 1rem;
  font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
}
#searchInput:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px var(--green-100);
}

#searchBtn {
  padding: .8rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--green-700);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
#searchBtn:hover { background: var(--green-900); }
#searchBtn:disabled { background: var(--muted); cursor: not-allowed; }

.hint { font-size: .85rem; color: var(--muted); margin-top: .6rem; min-height: 1.2rem; }

/*  Filters  */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.filters select {
  padding: .5rem .75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.check { display: flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); cursor: pointer; }

/*  Status  */
.status { margin: 1.5rem 0 .5rem; font-size: .95rem; color: var(--muted); }
.status.error {
  background: #fdecea;
  color: var(--red);
  padding: .9rem 1.1rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--red);
}

/*  Result cards  */
.results { display: grid; gap: 1rem; margin-top: .5rem; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem;
  border-left: 4px solid var(--green-700);
}
.card h2 { font-size: 1.15rem; color: var(--green-900); margin-bottom: .2rem; }
.card .brand { font-size: .85rem; color: var(--muted); margin-bottom: .9rem; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.tag {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .25rem .6rem;
  border-radius: 100px;
  background: var(--green-100);
  color: var(--green-900);
}
.tag.warn { background: #fdf0e3; color: #8a4a08; }

.field { margin-bottom: .8rem; }
.field h3 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: .2rem;
}
.field p { font-size: .92rem; }

/*  Footer  */
footer {
  text-align: center;
  padding: 2rem 1.25rem;
  font-size: .85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
footer a { color: var(--green-700); }
.disclaimer { margin-top: .4rem; font-style: italic; }

/*  Mobile  */
@media (max-width: 600px) {
  .search-row { flex-direction: column; }
  .site-header h1 { font-size: 1.6rem; }
  main { padding: 0 1rem 2rem; }
}

/*  Expandable fields  */
.more-btn {
  margin-top: .4rem;
  background: none;
  border: none;
  color: var(--green-700);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.more-btn:hover { color: var(--green-900); text-decoration: underline; }
.field .full { margin-top: 0; }

/*  Serious warning callout  */
.field.danger {
  background: #fdecea;
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin-top: .9rem;
}
.field.danger h3 { color: var(--red); display: flex; align-items: center; gap: .4rem; }
.field.danger h3::before { content: "\26A0"; font-size: 1rem; }
.field.danger p { color: #7a1c16; }
.field.danger .more-btn { color: var(--red); }
.tag.warn { background: var(--red); color: #fff; }

/*  Analytics  */
.analytics {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.analytics-title { font-size: 1.1rem; color: var(--green-900); }
.analytics-sub { font-size: .85rem; color: var(--muted); margin-bottom: 1.2rem; }
.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.chart-box { min-height: 260px; position: relative; }
@media (max-width: 600px) { .chart-box { min-height: 240px; } }

/* Give the manufacturer bar chart more horizontal room */
.chart-box:nth-child(2) { grid-column: span 2; }
@media (max-width: 700px) { .chart-box:nth-child(2) { grid-column: span 1; } }
