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

body {
  font-family: system-ui, sans-serif;
  background: #f5f5f5;
  color: #222;
  font-size: 15px;
}

nav {
  background: #1a1a2e;
  padding: 12px 24px;
  display: flex;
  gap: 24px;
}
nav a {
  color: #ccc;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
nav a:hover { color: #fff; }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

.flash {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
h1 { font-size: 22px; }
h2 { font-size: 17px; margin: 28px 0 14px; }

.season {
  font-size: 13px;
  background: #e8f4fd;
  color: #2980b9;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  vertical-align: middle;
}

.empty { color: #888; margin-top: 16px; }
.empty a { color: #2980b9; }

.hint {
  background: #fff8e1;
  border: 1px solid #ffe082;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}
.hint a { color: #e65100; }

.sub-hint { color: #888; font-size: 13px; margin-bottom: 16px; }

.group { margin-bottom: 28px; }
.group-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}

.card.warn { border-left-color: #f39c12; }

.no-slot { background: #fff3e0; color: #e65100; }
.no-slot-msg { font-size: 12px; color: #e65100; margin-bottom: 10px; }
.suboptimal { background: #fff8e1; color: #b26a00; }
.suboptimal-note { font-size: 12px; color: #b26a00; margin-bottom: 6px; }
.slot-radio-warn { border-color: #f39c12; background: #fffbf0; }

.card-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wiki-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  opacity: .85;
  flex-shrink: 0;
}
.form-actions { display: flex; gap: 8px; }

.form-label { font-size: 13px; color: #555; margin-bottom: 6px; }

.slot-options { display: flex; flex-direction: column; gap: 6px; }

.slot-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color .15s;
}
.slot-radio:has(input:checked) {
  border-color: #1a1a2e;
  background: #f0f0f8;
}
.slot-radio input { margin: 0; }
.slot-radio-name { flex: 1; font-size: 14px; }
.slot-radio-score {
  font-size: 12px;
  color: #888;
  background: #eee;
  padding: 2px 7px;
  border-radius: 10px;
}

.plant-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Autocomplete */
.ac-wrap { position: relative; }

.ac-list {
  position: absolute;
  z-index: 100;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 8px 8px;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.ac-list li {
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ac-list li:hover, .ac-list li.ac-active { background: #f0f0f8; }
.ac-name { font-size: 14px; }
.ac-meta { font-size: 11px; color: #999; white-space: nowrap; }

.selected-plant {
  font-size: 13px;
  color: #27ae60;
  margin-top: 6px;
  font-weight: 500;
}
.slot-placeholder { font-size: 13px; color: #aaa; }

/* Slider */
.range-row { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.range-row > div { display: flex; align-items: center; gap: 10px; }
.range-label { font-size: 12px; color: #888; width: 28px; }
.range-row input[type=range] { flex: 1; }
.range-row span:last-child { font-weight: 600; width: 18px; text-align: right; }
.range-hint { font-size: 12px; color: #888; margin-top: 4px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border-left: 4px solid #ddd;
  position: relative;
}
.card.alert { border-left-color: #e74c3c; }

/* × Löschen oben rechts */
.delete-form {
  position: absolute;
  top: 10px;
  right: 10px;
}
.btn-x {
  background: none;
  border: none;
  color: #ccc;
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color .15s;
}
.btn-x:hover { color: #e74c3c; }
.btn-x-confirm {
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  padding: 3px 7px;
  cursor: pointer;
  white-space: nowrap;
}

/* Wetter */
.weather-info {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.card-top strong { font-size: 16px; }
.sub { color: #888; font-size: 12px; display: block; }

.slot-badge {
  background: #eee;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  color: #555;
  white-space: nowrap;
}

.moisture-bar {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.moisture-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s;
}
.moisture-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 14px;
}

.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 7px 14px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.btn:hover { background: #2c2c4a; }
.btn-water { background: #2ecc71; }
.btn-water:hover { background: #27ae60; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-muted { background: #eee; color: #555; }
.btn-muted:hover { background: #ddd; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #555;
}
.form input, .form select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
}
.form input:focus, .form select:focus {
  outline: none;
  border-color: #1a1a2e;
}

/* App-Verbindung */
.connect-box {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: #FAF6F0;
  border: 1px solid #E4DDD3;
  border-radius: 12px;
  padding: 20px;
  margin-top: 12px;
}
.connect-actions { flex: 1; }
.btn-connect {
  display: inline-block;
  background: #3B6349;
  color: #fff !important;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.btn-connect:hover { background: #2D5016; }
#qrcode canvas, #qrcode img { border-radius: 8px; }
@media (max-width: 500px) {
  .connect-box { flex-direction: column; }
}
