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

body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-color: #f0fff4; }

header { background-color: #4caf7d; color: white; }

.header-inner {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.back-btn {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
}
.back-btn:hover, .back-btn:active { background: rgba(255,255,255,0.35); }

.header-inner h1 {
  margin: 0;
  font-size: clamp(1rem, 4vw, 1.5rem);
  flex: 1;
  text-align: center;
}

@media (max-width: 400px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .header-inner h1 { text-align: left; }
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 50px;
}

.task-form {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  margin-bottom: 16px;
}

.task-form h2, .task-filters h2, section h2 { margin-top: 0; color: #2e7d52; }

form { display: flex; flex-direction: column; gap: 10px; }

input[type="text"], input[type="date"], select {
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: white;
}

button {
  padding: 14px;
  background-color: #4caf7d;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  width: 100%;
  touch-action: manipulation;
}
button:hover, button:active { background-color: #3a9669; }

.task-filters { margin: 16px 0; }
.task-filters select { max-width: 220px; }

hr { border: none; border-top: 1px solid #c8e6d0; margin: 20px 0; }

ul { list-style: none; padding: 0; margin: 0; }

li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: white;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #4caf7d;
  gap: 10px;
}

li span {
  flex: 1;
  word-break: break-word;
  font-size: 0.95rem;
  line-height: 1.5;
}

#completedList li { border-left-color: #b0d4be; opacity: 0.75; }

.task-icons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
  margin-top: 2px;
}

.task-icons img {
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: transform 0.15s;
  touch-action: manipulation;
}
.task-icons img:hover, .task-icons img:active { transform: scale(1.2); }

.priority-high { color: #c0392b; font-weight: bold; }
.priority-medium { color: #e67e22; font-weight: bold; }
.priority-low { color: #27ae60; font-weight: bold; }
