*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7f2;
  color: #1f2933;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.app-header h1 {
  margin: 8px 0 8px;
  font-size: 1.9rem;
  letter-spacing: 0.03em;
  color: #14532d;
}

.subtitle {
  margin: 0;
  color: #4b5563;
  font-size: 0.98rem;
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Навигация */

.app-nav {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  overflow: hidden;
  background: #e5f2e8;
}

.nav-link {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.9rem;
  text-decoration: none;
  color: #475569;
  border-right: 1px solid rgba(148, 163, 184, 0.5);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:last-child {
  border-right: none;
}

.nav-link:hover {
  background: #bbf7d0;
  color: #14532d;
}

.nav-link-active {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #ecfdf5;
}

/* Панели */

.panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: #166534;
}

.panel-hint {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 0.95rem;
}

/* Список культур */

.plants-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 14px;
  margin-bottom: 16px;
}

.plant-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid transparent;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.plant-item:hover {
  border-color: rgba(34, 197, 94, 0.8);
  background: #f0fdf4;
  transform: translateY(-1px);
}

.plant-item-selected {
  border-color: rgba(22, 163, 74, 0.9);
  background: #dcfce7;
}

/* для списка без чекбоксов (index.html) */
.plant-item-clickable-no-checkbox {
  cursor: pointer;
}

/* чекбоксы на planner.html */
.plant-item input[type="checkbox"] {
  cursor: pointer;
}

.plant-type-pill {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: #4b5563;
}

.plant-type-vegetable {
  background: rgba(22, 163, 74, 0.16); /* насыщенный зелёный */
  color: #166534;
}

.plant-type-herb {
  background: rgba(56, 189, 248, 0.18); /* бирюзово-голубой для зелени */
  color: #0369a1;
}

.plant-type-flower {
  background: rgba(249, 115, 22, 0.16); /* тёплый оранжевый для цветов */
  color: #c2410c;
}

.plant-name {
  font-weight: 500;
}

.plant-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #6b7280;
  font-size: 0.75rem;
}

.btn-primary {
  appearance: none;
  border: none;
  outline: none;
  padding: 9px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #ecfdf5;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 4px;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.25);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(22, 163, 74, 0.28);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.22);
}

.error-message {
  margin: 6px 0 0;
  color: #b91c1c;
  font-size: 0.87rem;
}

/* Результаты одиночной культуры */

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.results-column h3 {
  margin: 0 0 4px;
}

.good-title {
  color: #166534;
}

.bad-title {
  color: #b91c1c;
}

.results-hint {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 0.9rem;
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-item {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #f9fafb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  font-size: 0.9rem;
}

.result-item.good {
  border-color: rgba(22, 163, 74, 0.8);
  background: #ecfdf5;
}

.result-item.bad {
  border-color: rgba(239, 68, 68, 0.9);
  background: #fef2f2;
}

.result-item.neutral {
  border-color: rgba(234, 179, 8, 0.9);
  background: #fefce8;
}

.result-name {
  font-weight: 500;
}

.result-score {
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 999px;
  align-self: flex-start;
  justify-self: flex-end;
}

.result-score.good {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
}

.result-score.bad {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}

.result-score.neutral {
  background: rgba(234, 179, 8, 0.16);
  color: #a16207;
}

.result-notes {
  grid-column: 1 / -1;
  color: #4b5563;
  font-size: 0.8rem;
}

.neutral-message {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Комбинации */

.combos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.combo-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #ffffff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.combo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.combo-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.combo-names {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.combo-plant {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 1px 5px;
  border-radius: 999px;
}

.combo-plant-good {
  background: rgba(22, 163, 74, 0.16);
  color: #15803d;
}

.combo-plant-neutral {
  background: rgba(234, 179, 8, 0.16);
  color: #a16207;
}

.combo-plant-bad {
  background: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.combo-size {
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.combo-body {
  font-size: 0.9rem;
  color: #374151;
}

.combo-extra {
  font-size: 0.86rem;
  color: #166534;
}

/* Примечания и футер */

.panel-notes .notes-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #6b7280;
  font-size: 0.9rem;
}

.app-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 0.82rem;
  color: #6b7280;
}

@media (max-width: 640px) {
  .app {
    padding: 16px 10px 28px;
  }

  .panel {
    padding: 14px 12px 14px;
  }

  .plants-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
