:root {
  /* EnviAgri-like palette */
  --bg: #f4fbf6; /* very light green */
  --card: #ffffff;
  --accent: #2b8a3e; /* primary green */
  --accent-strong: #216b31;
  --muted: #666;
  --text: #0f1720;
  --danger: #b00020;
  --border: #e6efe6;
}
* {
  box-sizing: border-box;
}
body {
  font-family: Inter, system-ui, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 24px;
}
.container {
  max-width: 760px;
  margin: 0 auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
h1 {
  font-size: 18px;
  margin: 0;
}
.title-banner {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.back-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.back-link:hover {
  text-decoration: underline;
}
.lang select {
  padding: 6px;
}
form {
  background: var(--card);
  padding: 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(34, 60, 80, 0.04);
}
.row {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
label {
  font-weight: 600;
  margin-bottom: 6px;
}
input[type="text"],
input[type="number"],
select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

/* label + help icon row */
.label-with-help {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.label-with-help label {
  margin-bottom: 0;
}
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: help;
  position: relative;
  flex-shrink: 0;
}
.help-tooltip {
  display: none;
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  z-index: 10;
  white-space: normal;
}
.help-icon:hover .help-tooltip,
.help-icon:focus .help-tooltip {
  display: block;
}

/* recommendation badge */
.rec-acceptable {
  color: var(--accent-strong);
  font-weight: 600;
}
.rec-elevated {
  color: #e67700;
  font-weight: 600;
}
.rec-high {
  color: var(--danger);
  font-weight: 600;
}

/* small units label shown next to numeric inputs */
.input-units {
  display: inline-block;
  margin-left: 10px;
  color: var(--muted);
  font-size: 13px;
  align-self: center;
}
.actions {
  display: flex;
  gap: 8px;
}
button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
button#clear {
  background: #8a8f93;
}
button:hover:not(:disabled) {
  filter: brightness(0.95);
}
button:disabled {
  background: #8a8f93;
  cursor: not-allowed;
  opacity: 0.6;
}
.card {
  background: var(--card);
  padding: 14px;
  border-radius: 10px;
  margin-top: 12px;
  border: 1px solid var(--border);
}

/* result table */
.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.result-table th,
.result-table td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: left;
}
.result-table thead th {
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
}
.result-table tbody td {
  background: #f6fbf7; /* light green */
}
.hidden {
  display: none;
}
#messages {
  margin-top: 12px;
}
.error {
  color: var(--danger);
}
pre {
  white-space: pre-wrap;
}
footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

/* Combobox (searchable crop dropdown) */
.combobox {
  position: relative;
}
.combobox input[type="text"] {
  width: 100%;
}
.combobox-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  z-index: 100;
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.combobox-list li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}
.combobox-list li:hover,
.combobox-list li.active {
  background: var(--bg);
  color: var(--accent-strong);
}
