* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f7; color: #1d1d1f;
  max-width: 500px; margin: 0 auto; padding: 16px;
  padding-top: env(safe-area-inset-top, 16px);
}
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
header h1 { font-size: 28px; font-weight: 700; }
#add-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: #0071e3; color: white; border: none;
  font-size: 24px; cursor: pointer; line-height: 1;
}
.hidden { display: none; }
#add-form {
  background: white; border-radius: 12px; padding: 16px;
  margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#add-form input[type="text"] {
  width: 100%; padding: 12px; border: 1px solid #d2d2d7;
  border-radius: 8px; font-size: 16px; margin-bottom: 8px;
}
.form-row { display: flex; gap: 8px; margin-bottom: 8px; }
.form-row select, .form-row input {
  flex: 1; padding: 8px; border: 1px solid #d2d2d7;
  border-radius: 8px; font-size: 14px; background: white;
}
#add-form button {
  width: 100%; padding: 12px; background: #0071e3;
  color: white; border: none; border-radius: 8px;
  font-size: 16px; cursor: pointer;
}
#filters { display: flex; gap: 8px; margin-bottom: 16px; }
.filter {
  padding: 6px 14px; border-radius: 16px;
  border: 1px solid #d2d2d7; background: white;
  font-size: 14px; cursor: pointer;
}
.filter.active { background: #0071e3; color: white; border-color: #0071e3; }
.task-card {
  background: white; border-radius: 12px; padding: 14px;
  margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex; align-items: flex-start; gap: 12px;
}
.task-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #d2d2d7; cursor: pointer;
  flex-shrink: 0; margin-top: 2px;
}
.task-info { flex: 1; }
.task-title { font-size: 16px; font-weight: 500; }
.task-meta { font-size: 12px; color: #86868b; margin-top: 4px; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; margin-right: 4px;
}
.tag-P1 { background: #fee; color: #d00; }
.tag-P2 { background: #fff3e0; color: #e65100; }
.tag-P3 { background: #f5f5f5; color: #666; }
.tag-stream { background: #e3f2fd; color: #1565c0; }
.task-delete { display: none; }
.task-card:hover .task-delete {
  display: block; color: #d2d2d7; cursor: pointer; font-size: 18px; padding: 4px;
}
.task-card:hover .task-delete:hover { color: #ff3b30; }
@media (hover: none) {
  /* On touch devices: no delete X visible — use swipe or long-press later */
  .task-delete { display: none !important; }
}
.priority-header {
  font-size: 13px; font-weight: 600; color: #86868b;
  text-transform: uppercase; letter-spacing: 0.5px; margin: 16px 0 8px;
}
.undo-bar {
  position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%);
  background: #1d1d1f; color: white; padding: 12px 20px;
  border-radius: 12px; font-size: 14px; z-index: 999;
  transition: bottom 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.undo-bar.show { bottom: 30px; }
.undo-bar button {
  background: none; border: none; color: #0a84ff;
  font-size: 14px; font-weight: 600; cursor: pointer; margin-left: 12px;
}
